|
@@ -19,6 +19,9 @@ import com.qxgmat.data.inline.UserQuestionStat;
|
|
|
import com.qxgmat.data.relation.entity.*;
|
|
import com.qxgmat.data.relation.entity.*;
|
|
|
import com.qxgmat.dto.extend.*;
|
|
import com.qxgmat.dto.extend.*;
|
|
|
import com.qxgmat.dto.request.*;
|
|
import com.qxgmat.dto.request.*;
|
|
|
|
|
+import com.qxgmat.dto.request.CommentDto;
|
|
|
|
|
+import com.qxgmat.dto.request.FaqDto;
|
|
|
|
|
+import com.qxgmat.dto.request.UserCollectQuestionDto;
|
|
|
import com.qxgmat.dto.request.UserNoteQuestionDto;
|
|
import com.qxgmat.dto.request.UserNoteQuestionDto;
|
|
|
import com.qxgmat.dto.response.*;
|
|
import com.qxgmat.dto.response.*;
|
|
|
import com.qxgmat.help.AiHelp;
|
|
import com.qxgmat.help.AiHelp;
|
|
@@ -110,9 +113,18 @@ public class MyController {
|
|
|
private CourseDataService courseDataService;
|
|
private CourseDataService courseDataService;
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
|
|
+ private CourseExperienceService courseExperienceService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
private CourseDataHistoryService courseDataHistoryService;
|
|
private CourseDataHistoryService courseDataHistoryService;
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
|
|
+ private FaqService faqService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private CommentService commentService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
private UsersService usersService;
|
|
private UsersService usersService;
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -131,6 +143,9 @@ public class MyController {
|
|
|
private UserCollectQuestionService userCollectQuestionService;
|
|
private UserCollectQuestionService userCollectQuestionService;
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
|
|
+ private UserCollectExperienceService userCollectExperienceService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
private UserNoteQuestionService userNoteQuestionService;
|
|
private UserNoteQuestionService userNoteQuestionService;
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -708,9 +723,45 @@ public class MyController {
|
|
|
return ResponseHelp.success(dtoMap);
|
|
return ResponseHelp.success(dtoMap);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @RequestMapping(value = "/collect/experience/add", method = RequestMethod.PUT)
|
|
|
|
|
+ @ApiOperation(value = "添加心经收藏", notes = "添加心经收藏", httpMethod = "PUT")
|
|
|
|
|
+ public Response<Boolean> addExperienceCollect(@RequestBody @Validated UserCollectExperienceDto dto) {
|
|
|
|
|
+ UserCollectExperience entity = Transform.dtoToEntity(dto);
|
|
|
|
|
+ User user = (User) shiroHelp.getLoginUser();
|
|
|
|
|
+ entity.setUserId(user.getId());
|
|
|
|
|
+ userCollectExperienceService.addExperience(entity);
|
|
|
|
|
+
|
|
|
|
|
+ return ResponseHelp.success(true);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @RequestMapping(value = "/collect/experience/delete", method = RequestMethod.DELETE)
|
|
|
|
|
+ @ApiOperation(value = "移除心经收藏", notes = "移除心经收藏", httpMethod = "DELETE")
|
|
|
|
|
+ public Response<Boolean> deleteExperienceCollect(Integer experienceId) {
|
|
|
|
|
+ User user = (User) shiroHelp.getLoginUser();
|
|
|
|
|
+ Boolean result = userCollectExperienceService.deleteExperience(user.getId(), experienceId);
|
|
|
|
|
+
|
|
|
|
|
+ return ResponseHelp.success(result);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @RequestMapping(value = "/collect/experience/list", method = RequestMethod.GET)
|
|
|
|
|
+ @ApiOperation(value = "获取收藏题目列表", notes = "获取收藏题目列表", httpMethod = "GET")
|
|
|
|
|
+ public Response<PageMessage<CourseExperience>> listExperienceCollect(
|
|
|
|
|
+ @RequestParam(required = false, defaultValue = "1") int page,
|
|
|
|
|
+ @RequestParam(required = false, defaultValue = "100") int size,
|
|
|
|
|
+ @RequestParam(required = false) String startTime,
|
|
|
|
|
+ @RequestParam(required = false) String endTime,
|
|
|
|
|
+ @RequestParam(required = false, defaultValue = "id") String order, // collect_time, update_time
|
|
|
|
|
+ @RequestParam(required = false, defaultValue = "desc") String direction,
|
|
|
|
|
+ HttpSession session) {
|
|
|
|
|
+ User user = (User) shiroHelp.getLoginUser();
|
|
|
|
|
+ Page<CourseExperience> p = courseExperienceService.listWithUser(page, size, user.getId(), startTime, endTime, order, DirectionStatus.ValueOf(direction));
|
|
|
|
|
+
|
|
|
|
|
+ return ResponseHelp.success(p, page, size, p.getTotal());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@RequestMapping(value = "/collect/question/add", method = RequestMethod.PUT)
|
|
@RequestMapping(value = "/collect/question/add", method = RequestMethod.PUT)
|
|
|
- @ApiOperation(value = "添加收藏", notes = "添加收藏", httpMethod = "PUT")
|
|
|
|
|
- public Response<Boolean> addQuestionCollect(@RequestBody @Validated UserCollectDto dto) {
|
|
|
|
|
|
|
+ @ApiOperation(value = "添加题目收藏", notes = "添加题目收藏", httpMethod = "PUT")
|
|
|
|
|
+ public Response<Boolean> addQuestionCollect(@RequestBody @Validated UserCollectQuestionDto dto) {
|
|
|
UserCollectQuestion entity = Transform.dtoToEntity(dto);
|
|
UserCollectQuestion entity = Transform.dtoToEntity(dto);
|
|
|
User user = (User) shiroHelp.getLoginUser();
|
|
User user = (User) shiroHelp.getLoginUser();
|
|
|
switch (QuestionModule.ValueOf(dto.getQuestionModule())){
|
|
switch (QuestionModule.ValueOf(dto.getQuestionModule())){
|
|
@@ -740,7 +791,7 @@ public class MyController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@RequestMapping(value = "/collect/question/delete", method = RequestMethod.DELETE)
|
|
@RequestMapping(value = "/collect/question/delete", method = RequestMethod.DELETE)
|
|
|
- @ApiOperation(value = "移除收藏", notes = "移除收藏", httpMethod = "DELETE")
|
|
|
|
|
|
|
+ @ApiOperation(value = "移除题目收藏", notes = "移除题目收藏", httpMethod = "DELETE")
|
|
|
public Response<Boolean> deleteQuestionCollect(String questionModule, Integer questionNoId) {
|
|
public Response<Boolean> deleteQuestionCollect(String questionModule, Integer questionNoId) {
|
|
|
User user = (User) shiroHelp.getLoginUser();
|
|
User user = (User) shiroHelp.getLoginUser();
|
|
|
Boolean result = userCollectQuestionService.deleteQuestion(user.getId(), QuestionModule.ValueOf(questionModule), questionNoId);
|
|
Boolean result = userCollectQuestionService.deleteQuestion(user.getId(), QuestionModule.ValueOf(questionModule), questionNoId);
|
|
@@ -749,7 +800,7 @@ public class MyController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@RequestMapping(value = "/collect/question/bind", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/collect/question/bind", method = RequestMethod.POST)
|
|
|
- @ApiOperation(value = "收藏组卷", notes = "收藏组卷", httpMethod = "POST")
|
|
|
|
|
|
|
+ @ApiOperation(value = "收藏题目组卷", notes = "收藏题目组卷", httpMethod = "POST")
|
|
|
public Response<UserPaper> bindQuestionCollect(@RequestBody @Validated UserCustomBindDto dto) {
|
|
public Response<UserPaper> bindQuestionCollect(@RequestBody @Validated UserCustomBindDto dto) {
|
|
|
User user = (User) shiroHelp.getLoginUser();
|
|
User user = (User) shiroHelp.getLoginUser();
|
|
|
|
|
|
|
@@ -766,7 +817,7 @@ public class MyController {
|
|
|
|
|
|
|
|
@RequestMapping(value = "/collect/question/list", method = RequestMethod.GET)
|
|
@RequestMapping(value = "/collect/question/list", method = RequestMethod.GET)
|
|
|
@ApiOperation(value = "获取收藏题目列表", notes = "获取收藏题目列表", httpMethod = "GET")
|
|
@ApiOperation(value = "获取收藏题目列表", notes = "获取收藏题目列表", httpMethod = "GET")
|
|
|
- public Response<PageMessage<UserCollectQuestionDto>> listQuestionCollect(
|
|
|
|
|
|
|
+ public Response<PageMessage<UserCollectQuestionInfoDto>> listQuestionCollect(
|
|
|
@RequestParam(required = false, defaultValue = "1") int page,
|
|
@RequestParam(required = false, defaultValue = "1") int page,
|
|
|
@RequestParam(required = false, defaultValue = "100") int size,
|
|
@RequestParam(required = false, defaultValue = "100") int size,
|
|
|
@RequestParam(required = false) String module,
|
|
@RequestParam(required = false) String module,
|
|
@@ -776,7 +827,7 @@ public class MyController {
|
|
|
@RequestParam(required = false) String endTime,
|
|
@RequestParam(required = false) String endTime,
|
|
|
@RequestParam(required = false) Boolean latest,
|
|
@RequestParam(required = false) Boolean latest,
|
|
|
@RequestParam(required = false) String year,
|
|
@RequestParam(required = false) String year,
|
|
|
- @RequestParam(required = false, defaultValue = "id") String order,
|
|
|
|
|
|
|
+ @RequestParam(required = false, defaultValue = "id") String order, // title, time, correct, question_type, latest_time
|
|
|
@RequestParam(required = false, defaultValue = "desc") String direction,
|
|
@RequestParam(required = false, defaultValue = "desc") String direction,
|
|
|
HttpSession session) {
|
|
HttpSession session) {
|
|
|
User user = (User) shiroHelp.getLoginUser();
|
|
User user = (User) shiroHelp.getLoginUser();
|
|
@@ -797,32 +848,32 @@ public class MyController {
|
|
|
}else{
|
|
}else{
|
|
|
throw new ParameterException("参数逻辑错误");
|
|
throw new ParameterException("参数逻辑错误");
|
|
|
}
|
|
}
|
|
|
- List<UserCollectQuestionDto> pr = Transform.convert(p, UserCollectQuestionDto.class);
|
|
|
|
|
|
|
+ List<UserCollectQuestionInfoDto> pr = Transform.convert(p, UserCollectQuestionInfoDto.class);
|
|
|
|
|
|
|
|
// 获取题目信息
|
|
// 获取题目信息
|
|
|
- Collection questionIds = Transform.getIds(pr, UserCollectQuestionDto.class, "questionId");
|
|
|
|
|
|
|
+ Collection questionIds = Transform.getIds(pr, UserCollectQuestionInfoDto.class, "questionId");
|
|
|
List<Question> questionList = questionService.select(questionIds);
|
|
List<Question> questionList = questionService.select(questionIds);
|
|
|
- Transform.combine(pr, questionList, UserCollectQuestionDto.class, "questionId", "question", Question.class, "id", QuestionExtendDto.class);
|
|
|
|
|
|
|
+ Transform.combine(pr, questionList, UserCollectQuestionInfoDto.class, "questionId", "question", Question.class, "id", QuestionExtendDto.class);
|
|
|
|
|
|
|
|
- List<UserCollectQuestionDto> basePr = pr.stream().filter((row)->row.getQuestionModule().equals(QuestionModule.BASE.key)).collect(Collectors.toList());
|
|
|
|
|
- Collection baseQuestionNoIds = Transform.getIds(basePr, UserCollectQuestionDto.class, "questionNoId");
|
|
|
|
|
|
|
+ List<UserCollectQuestionInfoDto> basePr = pr.stream().filter((row)->row.getQuestionModule().equals(QuestionModule.BASE.key)).collect(Collectors.toList());
|
|
|
|
|
+ Collection baseQuestionNoIds = Transform.getIds(basePr, UserCollectQuestionInfoDto.class, "questionNoId");
|
|
|
List<QuestionNo> baseQuestionNoList = questionNoService.select(baseQuestionNoIds);
|
|
List<QuestionNo> baseQuestionNoList = questionNoService.select(baseQuestionNoIds);
|
|
|
- Transform.combine(basePr, baseQuestionNoList, UserCollectQuestionDto.class, "questionNoId", "questionNo", QuestionNo.class, "id", QuestionNoExtendDto.class);
|
|
|
|
|
|
|
+ Transform.combine(basePr, baseQuestionNoList, UserCollectQuestionInfoDto.class, "questionNoId", "questionNo", QuestionNo.class, "id", QuestionNoExtendDto.class);
|
|
|
|
|
|
|
|
- List<UserCollectQuestionDto> sentencePr = pr.stream().filter((row)->row.getQuestionModule().equals(QuestionModule.SENTENCE.key)).collect(Collectors.toList());
|
|
|
|
|
- Collection sentenceQuestionNoIds = Transform.getIds(sentencePr, UserCollectQuestionDto.class, "questionNoId");
|
|
|
|
|
|
|
+ List<UserCollectQuestionInfoDto> sentencePr = pr.stream().filter((row)->row.getQuestionModule().equals(QuestionModule.SENTENCE.key)).collect(Collectors.toList());
|
|
|
|
|
+ Collection sentenceQuestionNoIds = Transform.getIds(sentencePr, UserCollectQuestionInfoDto.class, "questionNoId");
|
|
|
List<SentenceQuestion> sentenceQuestionList = sentenceQuestionService.select(sentenceQuestionNoIds);
|
|
List<SentenceQuestion> sentenceQuestionList = sentenceQuestionService.select(sentenceQuestionNoIds);
|
|
|
- Transform.combine(sentencePr, sentenceQuestionList, UserCollectQuestionDto.class, "questionNoId", "questionNo", SentenceQuestion.class, "id", QuestionNoExtendDto.class);
|
|
|
|
|
|
|
+ Transform.combine(sentencePr, sentenceQuestionList, UserCollectQuestionInfoDto.class, "questionNoId", "questionNo", SentenceQuestion.class, "id", QuestionNoExtendDto.class);
|
|
|
|
|
|
|
|
- List<UserCollectQuestionDto> textbookPr = pr.stream().filter((row)->row.getQuestionModule().equals(QuestionModule.TEXTBOOK.key)).collect(Collectors.toList());
|
|
|
|
|
- Collection textbookQuestionNoIds = Transform.getIds(textbookPr, UserCollectQuestionDto.class, "questionNoId");
|
|
|
|
|
|
|
+ List<UserCollectQuestionInfoDto> textbookPr = pr.stream().filter((row)->row.getQuestionModule().equals(QuestionModule.TEXTBOOK.key)).collect(Collectors.toList());
|
|
|
|
|
+ Collection textbookQuestionNoIds = Transform.getIds(textbookPr, UserCollectQuestionInfoDto.class, "questionNoId");
|
|
|
List<TextbookQuestion> textbookQuestionList = textbookQuestionService.select(textbookQuestionNoIds);
|
|
List<TextbookQuestion> textbookQuestionList = textbookQuestionService.select(textbookQuestionNoIds);
|
|
|
- Transform.combine(textbookPr, textbookQuestionList, UserCollectQuestionDto.class, "questionNoId", "questionNo", TextbookQuestion.class, "id", QuestionNoExtendDto.class);
|
|
|
|
|
|
|
+ Transform.combine(textbookPr, textbookQuestionList, UserCollectQuestionInfoDto.class, "questionNoId", "questionNo", TextbookQuestion.class, "id", QuestionNoExtendDto.class);
|
|
|
|
|
|
|
|
// 绑定题目统计
|
|
// 绑定题目统计
|
|
|
List<UserQuestion> userQuestionList = userQuestionService.listByQuestion(user.getId(), questionIds);
|
|
List<UserQuestion> userQuestionList = userQuestionService.listByQuestion(user.getId(), questionIds);
|
|
|
Map<Object, UserQuestionStat> stats = userQuestionService.statQuestionMap(userQuestionList);
|
|
Map<Object, UserQuestionStat> stats = userQuestionService.statQuestionMap(userQuestionList);
|
|
|
- Transform.combine(pr, stats, UserCollectQuestionDto.class, "questionId", "stat");
|
|
|
|
|
|
|
+ Transform.combine(pr, stats, UserCollectQuestionInfoDto.class, "questionId", "stat");
|
|
|
|
|
|
|
|
return ResponseHelp.success(pr, page, size, p.getTotal());
|
|
return ResponseHelp.success(pr, page, size, p.getTotal());
|
|
|
}
|
|
}
|
|
@@ -839,7 +890,7 @@ public class MyController {
|
|
|
@RequestParam(required = false) String endTime,
|
|
@RequestParam(required = false) String endTime,
|
|
|
@RequestParam(required = false) Boolean latest,
|
|
@RequestParam(required = false) Boolean latest,
|
|
|
@RequestParam(required = false) String year,
|
|
@RequestParam(required = false) String year,
|
|
|
- @RequestParam(required = false, defaultValue = "id") String order,
|
|
|
|
|
|
|
+ @RequestParam(required = false, defaultValue = "id") String order, // title, time, correct, question_type, latest_time
|
|
|
@RequestParam(required = false, defaultValue = "desc") String direction
|
|
@RequestParam(required = false, defaultValue = "desc") String direction
|
|
|
) {
|
|
) {
|
|
|
User user = (User) shiroHelp.getLoginUser();
|
|
User user = (User) shiroHelp.getLoginUser();
|
|
@@ -882,6 +933,7 @@ public class MyController {
|
|
|
List<TextbookQuestion> textbookQuestionList = textbookQuestionService.select(textbookQuestionNoIds);
|
|
List<TextbookQuestion> textbookQuestionList = textbookQuestionService.select(textbookQuestionNoIds);
|
|
|
Transform.combine(textbookPr, textbookQuestionList, UserQuestionErrorInfoDto.class, "questionNoId", "questionNo", TextbookQuestion.class, "id", QuestionNoExtendDto.class);
|
|
Transform.combine(textbookPr, textbookQuestionList, UserQuestionErrorInfoDto.class, "questionNoId", "questionNo", TextbookQuestion.class, "id", QuestionNoExtendDto.class);
|
|
|
|
|
|
|
|
|
|
+ // 最近做题,及做题统计
|
|
|
return ResponseHelp.success(pr, page, size, p.getTotal());
|
|
return ResponseHelp.success(pr, page, size, p.getTotal());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -971,7 +1023,7 @@ public class MyController {
|
|
|
@RequestParam(required = false) String endTime,
|
|
@RequestParam(required = false) String endTime,
|
|
|
@RequestParam(required = false) Boolean latest,
|
|
@RequestParam(required = false) Boolean latest,
|
|
|
@RequestParam(required = false) String year,
|
|
@RequestParam(required = false) String year,
|
|
|
- @RequestParam(required = false, defaultValue = "id") String order,
|
|
|
|
|
|
|
+ @RequestParam(required = false, defaultValue = "id") String order, // update_time
|
|
|
@RequestParam(required = false, defaultValue = "desc") String direction,
|
|
@RequestParam(required = false, defaultValue = "desc") String direction,
|
|
|
HttpSession session) {
|
|
HttpSession session) {
|
|
|
User user = (User) shiroHelp.getLoginUser();
|
|
User user = (User) shiroHelp.getLoginUser();
|
|
@@ -1041,8 +1093,8 @@ public class MyController {
|
|
|
@RequestParam(required = false) String endTime,
|
|
@RequestParam(required = false) String endTime,
|
|
|
@RequestParam(required = false) Boolean latest,
|
|
@RequestParam(required = false) Boolean latest,
|
|
|
@RequestParam(required = false) String year,
|
|
@RequestParam(required = false) String year,
|
|
|
- @RequestParam(required = false) String courseModule,
|
|
|
|
|
- @RequestParam(required = false, defaultValue = "id") String order,
|
|
|
|
|
|
|
+ @RequestParam(required = false) String[] courseModules,
|
|
|
|
|
+ @RequestParam(required = false, defaultValue = "id") String order, // title, latest_time,correct,time
|
|
|
@RequestParam(required = false, defaultValue = "desc") String direction,
|
|
@RequestParam(required = false, defaultValue = "desc") String direction,
|
|
|
HttpSession session) {
|
|
HttpSession session) {
|
|
|
User user = (User) shiroHelp.getLoginUser();
|
|
User user = (User) shiroHelp.getLoginUser();
|
|
@@ -1052,7 +1104,7 @@ public class MyController {
|
|
|
if (questionNoModule != null && (paperOrigin == PaperOrigin.COLLECT || paperOrigin == PaperOrigin.ERROR)){
|
|
if (questionNoModule != null && (paperOrigin == PaperOrigin.COLLECT || paperOrigin == PaperOrigin.ERROR)){
|
|
|
p = userPaperService.list(page, size, user.getId(), paperOrigin, startTime, endTime, order, DirectionStatus.ValueOf(direction));
|
|
p = userPaperService.list(page, size, user.getId(), paperOrigin, startTime, endTime, order, DirectionStatus.ValueOf(direction));
|
|
|
}else if(questionNoModule == QuestionNoModule.EXERCISE){
|
|
}else if(questionNoModule == QuestionNoModule.EXERCISE){
|
|
|
- p = userPaperService.listExercise(page, size, user.getId(), questionTypes, structIds, courseModule, startTime, endTime, order, DirectionStatus.ValueOf(direction));
|
|
|
|
|
|
|
+ p = userPaperService.listExercise(page, size, user.getId(), questionTypes, structIds, courseModules, startTime, endTime, order, DirectionStatus.ValueOf(direction));
|
|
|
}else if (questionNoModule == QuestionNoModule.EXAMINATION){
|
|
}else if (questionNoModule == QuestionNoModule.EXAMINATION){
|
|
|
Integer libraryId = null;
|
|
Integer libraryId = null;
|
|
|
if (latest != null){
|
|
if (latest != null){
|
|
@@ -1063,7 +1115,7 @@ public class MyController {
|
|
|
year = null;
|
|
year = null;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- p = userPaperService.listExamination(page, size, user.getId(), questionTypes, structIds, libraryId, year, order, startTime, endTime, DirectionStatus.ValueOf(direction));
|
|
|
|
|
|
|
+ p = userPaperService.listExamination(page, size, user.getId(), structIds, libraryId, year, order, startTime, endTime, DirectionStatus.ValueOf(direction));
|
|
|
}else{
|
|
}else{
|
|
|
throw new ParameterException("参数逻辑错误");
|
|
throw new ParameterException("参数逻辑错误");
|
|
|
}
|
|
}
|
|
@@ -1195,7 +1247,7 @@ public class MyController {
|
|
|
@RequestParam(required = false) Integer askStatus,
|
|
@RequestParam(required = false) Integer askStatus,
|
|
|
@RequestParam(required = false) Boolean latest,
|
|
@RequestParam(required = false) Boolean latest,
|
|
|
@RequestParam(required = false) String year,
|
|
@RequestParam(required = false) String year,
|
|
|
- @RequestParam(required = false, defaultValue = "id") String order,
|
|
|
|
|
|
|
+ @RequestParam(required = false, defaultValue = "id") String order, // create_time, answer_time
|
|
|
@RequestParam(required = false, defaultValue = "desc") String direction,
|
|
@RequestParam(required = false, defaultValue = "desc") String direction,
|
|
|
HttpSession session) {
|
|
HttpSession session) {
|
|
|
User user = (User) shiroHelp.getLoginUser();
|
|
User user = (User) shiroHelp.getLoginUser();
|
|
@@ -1320,16 +1372,26 @@ public class MyController {
|
|
|
return ResponseHelp.success(true);
|
|
return ResponseHelp.success(true);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @RequestMapping(value = "/feedback/textbook", method = RequestMethod.POST)
|
|
|
|
|
- @ApiOperation(value = "添加机经反馈", notes = "添加机经反馈", httpMethod = "POST")
|
|
|
|
|
- public Response<Boolean> addFeedbackTextbook(@RequestBody @Validated UserTextbookFeedbackDto dto) {
|
|
|
|
|
- UserTextbookFeedback entity = Transform.dtoToEntity(dto);
|
|
|
|
|
|
|
+ @RequestMapping(value = "/faq", method = RequestMethod.POST)
|
|
|
|
|
+ @ApiOperation(value = "添加faq", notes = "添加faq", httpMethod = "POST")
|
|
|
|
|
+ public Response<Boolean> addFaq(@RequestBody @Validated FaqDto dto) {
|
|
|
|
|
+ Faq entity = Transform.dtoToEntity(dto);
|
|
|
User user = (User) shiroHelp.getLoginUser();
|
|
User user = (User) shiroHelp.getLoginUser();
|
|
|
- TextbookTopic topic = textbookTopicService.get(dto.getTopicId());
|
|
|
|
|
entity.setUserId(user.getId());
|
|
entity.setUserId(user.getId());
|
|
|
- entity.setStatus(0);
|
|
|
|
|
- entity.setLibraryId(topic.getLibraryId());
|
|
|
|
|
- userTextbookFeedbackService.add(entity);
|
|
|
|
|
|
|
+ entity.setMessage(1);
|
|
|
|
|
+ entity.setEmail(user.getEmail());
|
|
|
|
|
+ faqService.add(entity);
|
|
|
|
|
+
|
|
|
|
|
+ return ResponseHelp.success(true);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @RequestMapping(value = "/comment", method = RequestMethod.POST)
|
|
|
|
|
+ @ApiOperation(value = "添加评论", notes = "添加评论", httpMethod = "POST")
|
|
|
|
|
+ public Response<Boolean> addComment(@RequestBody @Validated CommentDto dto) {
|
|
|
|
|
+ Comment entity = Transform.dtoToEntity(dto);
|
|
|
|
|
+ User user = (User) shiroHelp.getLoginUser();
|
|
|
|
|
+ entity.setUserId(user.getId());
|
|
|
|
|
+ commentService.add(entity);
|
|
|
|
|
|
|
|
return ResponseHelp.success(true);
|
|
return ResponseHelp.success(true);
|
|
|
}
|
|
}
|