问答中心 跳转回填提问和回答问题

This commit is contained in:
gaojiabao
2023-04-11 12:50:56 +08:00
parent 06e9c0a3e7
commit 2b468f9149
@@ -316,4 +316,22 @@ public class AskQuestionsController extends BaseController<AskQuestions> {
return askQuestionsService.selectAskReply(id);
}
@PostMapping("/jump")
public ResponseMessage jump(String standId ,String userId){
if(StringUtils.isNotBlank(standId) && StringUtils.isNotBlank(userId)){
QueryWrapper<AskQuestions> objectQueryWrapper = new QueryWrapper<>();
objectQueryWrapper.eq("STANDARD_ID",standId);
objectQueryWrapper.eq("questioner",userId);
List<AskQuestions> list = askQuestionsService.list(objectQueryWrapper);
if(!list.isEmpty()){
//提问
return Result.success("myQue");
}else {
//回答
return askQuestionsService.selectAskReply("myAns");
}
}
return Result.error();
}
}