Browse Source

add:问题点赞和评论

zhongwei
luyie 2 months ago
parent
commit
3d72bd3fcc
  1. 4
      hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/QuestionAnswerCommentServiceImpl.java
  2. 9
      hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/vo/AnswerPraiseRequest.java

4
hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/QuestionAnswerCommentServiceImpl.java

@ -58,8 +58,10 @@ public class QuestionAnswerCommentServiceImpl extends ServiceImpl<QuestionAnswer
if (ObjectUtil.isNotEmpty(entity)) { if (ObjectUtil.isNotEmpty(entity)) {
entity.setPraise(req.getPraise()); entity.setPraise(req.getPraise());
return this.updateById(entity); return this.updateById(entity);
} else {
entity = req.toEntity();
return this.save(entity);
} }
return Boolean.FALSE;
} }
@Override @Override

9
hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/vo/AnswerPraiseRequest.java

@ -1,5 +1,6 @@
package com.hnac.gglm.bigmodel.maintenance.vo; package com.hnac.gglm.bigmodel.maintenance.vo;
import com.hnac.gglm.bigmodel.maintenance.entity.QuestionAnswerCommentEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ -20,4 +21,12 @@ public class AnswerPraiseRequest {
@ApiModelProperty(value = "点赞,0取消点赞,1点赞") @ApiModelProperty(value = "点赞,0取消点赞,1点赞")
private Integer praise; private Integer praise;
public QuestionAnswerCommentEntity toEntity() {
QuestionAnswerCommentEntity entity = new QuestionAnswerCommentEntity();
entity.setChatId(chartId);
entity.setQuestionId(questionId);
entity.setPraise(praise);
return entity;
}
} }

Loading…
Cancel
Save