Browse Source

Merge remote-tracking branch 'origin/prod-5.1.3' into prod-5.1.3

zhongwei
haungxing 2 months ago
parent
commit
c5b7c91bbb
  1. 6
      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

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

@ -45,6 +45,8 @@ public class QuestionAnswerCommentServiceImpl extends ServiceImpl<QuestionAnswer
req.getQuestionId());
if (ObjectUtil.isEmpty(entity)) {
entity = req.toEntity();
} else {
entity.setContent(req.getContent());
}
return this.saveOrUpdate(entity);
}
@ -56,8 +58,10 @@ public class QuestionAnswerCommentServiceImpl extends ServiceImpl<QuestionAnswer
if (ObjectUtil.isNotEmpty(entity)) {
entity.setPraise(req.getPraise());
return this.updateById(entity);
} else {
entity = req.toEntity();
return this.save(entity);
}
return Boolean.FALSE;
}
@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;
import com.hnac.gglm.bigmodel.maintenance.entity.QuestionAnswerCommentEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -20,4 +21,12 @@ public class AnswerPraiseRequest {
@ApiModelProperty(value = "点赞,0取消点赞,1点赞")
private Integer praise;
public QuestionAnswerCommentEntity toEntity() {
QuestionAnswerCommentEntity entity = new QuestionAnswerCommentEntity();
entity.setChatId(chartId);
entity.setQuestionId(questionId);
entity.setPraise(praise);
return entity;
}
}

Loading…
Cancel
Save