|
|
@ -12,7 +12,10 @@ import com.hnac.gglm.bigmodel.maintenance.vo.AnswerPraiseRequest; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
|
|
|
|
import org.springblade.system.user.entity.User; |
|
|
|
|
|
|
|
import org.springblade.system.user.feign.IUserClient; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
@ -26,6 +29,8 @@ import java.util.List; |
|
|
|
@AllArgsConstructor |
|
|
|
@AllArgsConstructor |
|
|
|
@DS("hznlm") |
|
|
|
@DS("hznlm") |
|
|
|
public class QuestionAnswerCommentServiceImpl extends ServiceImpl<QuestionAnswerCommentMapper, QuestionAnswerCommentEntity> implements QuestionAnswerCommentService { |
|
|
|
public class QuestionAnswerCommentServiceImpl extends ServiceImpl<QuestionAnswerCommentMapper, QuestionAnswerCommentEntity> implements QuestionAnswerCommentService { |
|
|
|
|
|
|
|
private final IUserClient userClient; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public QuestionAnswerCommentEntity getComment(Long userId, String questionId) { |
|
|
|
public QuestionAnswerCommentEntity getComment(Long userId, String questionId) { |
|
|
|
LambdaQueryWrapper<QuestionAnswerCommentEntity> queryWrapper = Wrappers.<QuestionAnswerCommentEntity>lambdaQuery() |
|
|
|
LambdaQueryWrapper<QuestionAnswerCommentEntity> queryWrapper = Wrappers.<QuestionAnswerCommentEntity>lambdaQuery() |
|
|
@ -57,10 +62,17 @@ public class QuestionAnswerCommentServiceImpl extends ServiceImpl<QuestionAnswer |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<QuestionAnswerCommentEntity> listByQuestionId(String questionId) { |
|
|
|
public List<QuestionAnswerCommentEntity> listByQuestionId(String questionId) { |
|
|
|
|
|
|
|
List<QuestionAnswerCommentEntity> list = this.list(Wrappers.<QuestionAnswerCommentEntity>lambdaQuery() |
|
|
|
return this.list(Wrappers.<QuestionAnswerCommentEntity>lambdaQuery() |
|
|
|
|
|
|
|
.eq(QuestionAnswerCommentEntity::getQuestionId, questionId) |
|
|
|
.eq(QuestionAnswerCommentEntity::getQuestionId, questionId) |
|
|
|
.orderByAsc(QuestionAnswerCommentEntity::getCreateTime)); |
|
|
|
.orderByAsc(QuestionAnswerCommentEntity::getCreateTime)); |
|
|
|
|
|
|
|
list.forEach(item -> { |
|
|
|
|
|
|
|
R<User> user = userClient.userInfoById(item.getUserId()); |
|
|
|
|
|
|
|
if (user.isSuccess() && user.getData() != null) { |
|
|
|
|
|
|
|
item.setUserName(user.getData().getName()); |
|
|
|
|
|
|
|
item.setUserAccount(user.getData().getAccount()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return list; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|