Commit 80730267 authored by liuyang's avatar liuyang

提问后返回问题ID

parent 5782105c
......@@ -107,7 +107,7 @@ public class QAService {
* @param model
*/
@Transactional
public void ask(AskModel model) {
public Long ask(AskModel model) {
QuestionPO questionPO = new QuestionPO();
questionPO.setUserId(UserContext.getUserId());
questionPO.setCourseId(model.getCourseId());
......@@ -121,7 +121,7 @@ public class QAService {
answerPO.setType(AnswerTypeEnum.USER);
answerPO.setContent(questionPO.getContent());
answerMapper.insert(answerPO);
return questionPO.getId();
}
/**
......
......@@ -27,9 +27,9 @@ public class FrontendQAController {
@SysLog("提问")
@PostMapping("/ask")
@RequiresRoles(value = {BizConstants.ROLE_USER,BizConstants.ROLE_ENTERPRISE_ADMIN},logical = Logical.OR)
public Result<String> ask(@RequestBody @Validated AskModel model){
qaService.ask(model);
return Result.succeed("ok");
public Result<Long> ask(@RequestBody @Validated AskModel model){
Long id = qaService.ask(model);
return Result.succeed(id);
}
@ApiOperation("我的提问列表")
......
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