File tree 2 files changed +6
-5
lines changed
src/main/kotlin/plus/maa/backend
controller/request/comments
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,7 @@ data class CommentsAddDTO(
13
13
@field:NotBlank(message = "请填写评论内容")
14
14
val message : String ,
15
15
// 评论的作业id
16
- @field:NotBlank(message = "作业id不可为空")
17
- val copilotId : String ,
16
+ val copilotId : Long ,
18
17
// 子评论来源评论id(回复评论)
19
18
val fromCommentId : String? = null ,
20
19
val notification : Boolean = true
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ class CommentsAreaService(
48
48
* @param commentsAddDTO CommentsRequest
49
49
*/
50
50
fun addComments (userId : String , commentsAddDTO : CommentsAddDTO ) {
51
- val copilotId = commentsAddDTO.copilotId.toLong()
51
+ val copilotId = commentsAddDTO.copilotId
52
52
val message = commentsAddDTO.message
53
53
val copilotOptional = copilotRepository.findByCopilotId(copilotId)
54
54
Assert .isTrue(StringUtils .isNotBlank(message), " 评论不可为空" )
@@ -171,8 +171,10 @@ class CommentsAreaService(
171
171
val dislikeCountChange: Long
172
172
173
173
val ratingOptional =
174
- ratingRepository.findByTypeAndKeyAndUserId(Rating .KeyType .COMMENT ,
175
- commentsArea.id!! , userId)
174
+ ratingRepository.findByTypeAndKeyAndUserId(
175
+ Rating .KeyType .COMMENT ,
176
+ commentsArea.id!! , userId
177
+ )
176
178
// 判断该用户是否存在评分
177
179
if (ratingOptional != null ) {
178
180
// 如果评分发生变化则更新
You can’t perform that action at this time.
0 commit comments