Commit a2ab7467 by huluobin

update

parent 8b40df8d
...@@ -26,7 +26,18 @@ public interface IBeautyExpoQuestionnaireService extends IService<BeautyExpoQues ...@@ -26,7 +26,18 @@ public interface IBeautyExpoQuestionnaireService extends IService<BeautyExpoQues
* *
* @param customerId * @param customerId
* @param type * @param type
* @return * @return yes or no
*/ */
Boolean hasSubmitted(Integer customerId, Integer type); Boolean hasSubmitted(Integer customerId, Integer type);
/**
* 是否已经填写调查问卷
*
* @param customerId
* @param type
* @return 问卷id
*/
Integer submittedQuestionnaire(Integer customerId, Integer type);
}
} }
...@@ -36,4 +36,13 @@ public class BeautyExpoQuestionnaireServiceImpl extends ServiceImpl<BeautyExpoQu ...@@ -36,4 +36,13 @@ public class BeautyExpoQuestionnaireServiceImpl extends ServiceImpl<BeautyExpoQu
.eq(BeautyExpoQuestionnaire::getType, type)); .eq(BeautyExpoQuestionnaire::getType, type));
return questionnaire != null; return questionnaire != null;
} }
@Override
public Integer submittedQuestionnaire(Integer customerId, Integer type) {
BeautyExpoQuestionnaire questionnaire = this.getOne(new LambdaQueryWrapper<BeautyExpoQuestionnaire>()
.eq(BeautyExpoQuestionnaire::getCustomerId, customerId)
.eq(BeautyExpoQuestionnaire::getType, type));
return questionnaire == null ? 0 : questionnaire.getId();
}
} }
...@@ -32,6 +32,12 @@ public class BeautyExpoQuestionnaireController { ...@@ -32,6 +32,12 @@ public class BeautyExpoQuestionnaireController {
return JsonResult.success(beautyExpoQuestionnaireService.hasSubmitted(SessionUtils.getCustomerId(), type)); return JsonResult.success(beautyExpoQuestionnaireService.hasSubmitted(SessionUtils.getCustomerId(), type));
} }
@ApiOperation("/是否已经填写美博会调查问卷")
@GetMapping("/customer/beautyExpoQuestionnaire/submittedQuestionnaire")
public JsonResult<Integer> submittedQuestionnaire(@RequestParam Integer type) {
return JsonResult.success(beautyExpoQuestionnaireService.submittedQuestionnaire(SessionUtils.getCustomerId(), type));
}
@ApiOperation("/提交美博会调查问卷") @ApiOperation("/提交美博会调查问卷")
@PostMapping("/customer/beautyExpoQuestionnaire/submitQuestionnaire") @PostMapping("/customer/beautyExpoQuestionnaire/submitQuestionnaire")
public JsonResult<Integer> submitQuestionnaire(@RequestBody BeautyExpoQuestionnaire beautyExpoQuestionnaire) { public JsonResult<Integer> submitQuestionnaire(@RequestBody BeautyExpoQuestionnaire beautyExpoQuestionnaire) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment