Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Akiyama-Mio-a committed Dec 11, 2023
1 parent f17cc0d commit 55b620b
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 8 deletions.
18 changes: 15 additions & 3 deletions src/main/java/sast/evento/controller/FeedbackController.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,21 @@ public String addFeedback(@RequestParam(required = false) String content,
return null;
}

String userIdStr = userProFile.getUserId();
Integer userIdInt = Integer.valueOf(userIdStr);
return feedbackService.addFeedback(userIdInt, content, score, eventId);
return feedbackService.addFeedback(userProFile.getUserId(), content, score, eventId);
}

@OperateLog("用户添加反馈")
@DefaultActionState(ActionState.LOGIN)
@GetMapping("/info")
public String addFeed(@RequestParam(required = false) String content,
@RequestParam Double score,
@RequestParam Integer eventId) {
UserProFile userProFile = HttpInterceptor.userProFileHolder.get();
if (userProFile == null) {
return null;
}

return feedbackService.addFeedback(userProFile.getUserId(), content, score, eventId);
}

@OperateLog("用户获取自己的反馈列表")
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/sast/evento/controller/UserController.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public List<EventModel> getSubscribed() {
return eventService.getSubscribed(userIdInt);
}

@OperateLog("报名活动")
@OperateLog("报名活动 / 取消报名")
@DefaultActionState(ActionState.LOGIN)
@GetMapping("/register")
public String register(@RequestParam Integer eventId,
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/sast/evento/interceptor/HttpInterceptor.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons
}
}
}
UserProFile userProFile = sastLinkServiceCacheAble.getUserProFile(userId);//todo 等待对接sastLink
// UserProFile userProFile = sastLinkServiceCacheAble.getUserProFile(userId);//todo 等待对接sastLink
UserProFile userProFile = new UserProFile();
userProFile.setUserId("mio");
userProFileHolder.set(userProFile);
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/sast/evento/mapper/FeedbackMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
@Repository
public interface FeedbackMapper extends BaseMapper<Feedback> {

Integer addFeedback(@Param("userId") Integer userId, @Param("content") String content, @Param("score") Integer score, @Param("eventId") Integer eventId);
Integer addFeedback(@Param("userId") String userId, @Param("content") String content, @Param("score") Integer score, @Param("eventId") Integer eventId);

}
2 changes: 1 addition & 1 deletion src/main/java/sast/evento/service/FeedbackService.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
public interface FeedbackService {

// 用户添加反馈
String addFeedback(Integer userId, String content, Double score, Integer eventId);
String addFeedback(String userId, String content, Double score, Integer eventId);

// 用户获取自己的反馈列表
List<FeedbackModel> getListByUserId(Integer userId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class FeedbackServiceImpl implements FeedbackService {

// 用户添加反馈
@Override
public String addFeedback(Integer userId, String content, Double scoreDou, Integer eventId) {
public String addFeedback(String userId, String content, Double scoreDou, Integer eventId) {
if (userId == null || eventId == null) {
throw new LocalRunTimeException(ErrorEnum.PARAM_ERROR);
}
Expand Down

0 comments on commit 55b620b

Please sign in to comment.