diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/entity/QuestionAnswerCommentEntity.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/entity/QuestionAnswerCommentEntity.java index e8ee50c..bc27073 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/entity/QuestionAnswerCommentEntity.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/entity/QuestionAnswerCommentEntity.java @@ -1,14 +1,11 @@ package com.hnac.gglm.bigmodel.maintenance.entity; import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import lombok.Builder; import lombok.Data; import org.springblade.core.tenant.mp.TenantEntity; -import org.springframework.data.annotation.Transient; import java.io.Serializable; @@ -32,7 +29,7 @@ public class QuestionAnswerCommentEntity extends TenantEntity implements Seriali @ApiModelProperty("用户id") @TableField("user_id") - private Long userId; + private String userId; @ApiModelProperty("用户账号") @TableField(exist = false) diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/QuestionAnswerCommentService.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/QuestionAnswerCommentService.java index 6510c53..f507ff6 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/QuestionAnswerCommentService.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/QuestionAnswerCommentService.java @@ -12,7 +12,7 @@ import java.util.List; * @Date: 2024/9/21 13:29 */ public interface QuestionAnswerCommentService extends IService { - QuestionAnswerCommentEntity getComment(Long userId, String questionId); + QuestionAnswerCommentEntity getComment(String userId, String questionId); Boolean comment(AnswerCommentRequest req); diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/QuestionAnswerCommentServiceImpl.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/QuestionAnswerCommentServiceImpl.java index 7e1bd4f..afc1d3d 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/QuestionAnswerCommentServiceImpl.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/QuestionAnswerCommentServiceImpl.java @@ -11,7 +11,6 @@ import com.hnac.gglm.bigmodel.maintenance.vo.AnswerCommentRequest; import com.hnac.gglm.bigmodel.maintenance.vo.AnswerPraiseRequest; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.system.user.entity.User; @@ -32,7 +31,7 @@ public class QuestionAnswerCommentServiceImpl extends ServiceImpl queryWrapper = Wrappers.lambdaQuery() .eq(QuestionAnswerCommentEntity::getQuestionId, questionId) .eq(QuestionAnswerCommentEntity::getUserId, userId).last("limit 1"); @@ -41,7 +40,7 @@ public class QuestionAnswerCommentServiceImpl extends ServiceImpl { - R user = userClient.userInfoById(item.getUserId()); - if (user.isSuccess() && user.getData() != null) { - item.setUserName(user.getData().getName()); - item.setUserAccount(user.getData().getAccount()); + try { + R user = userClient.userInfoById(Long.parseLong(item.getUserId())); + if (user.isSuccess() && user.getData() != null) { + item.setUserName(user.getData().getName()); + item.setUserAccount(user.getData().getAccount()); + } + } catch (Exception e) { + log.error("获取用户信息失败", e); } }); return list; @@ -88,7 +91,7 @@ public class QuestionAnswerCommentServiceImpl extends ServiceImpl