小程序二维码改成正式版,小程序聊天头像恢复

This commit is contained in:
sonjinyon 2024-11-04 13:12:27 +08:00
parent 9443f4959a
commit ef9ebbfaba
7 changed files with 38 additions and 2 deletions

View File

@ -5,6 +5,8 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
import cn.iocoder.yudao.module.promotion.controller.admin.kefu.vo.message.KeFuMessageRespVO;
import cn.iocoder.yudao.module.promotion.controller.app.kefu.vo.message.AppKeFuMessagePageReqVO;
import cn.iocoder.yudao.module.promotion.controller.app.kefu.vo.message.AppKeFuMessageSendReqVO;
@ -31,6 +33,10 @@ public class AppKeFuMessageController {
@Resource
private KeFuMessageService kefuMessageService;
@Resource
private MemberUserApi memberUserApi;
@PostMapping("/send")
@Operation(summary = "发送客服消息")
@PreAuthenticated
@ -53,6 +59,19 @@ public class AppKeFuMessageController {
@PreAuthenticated
public CommonResult<PageResult<KeFuMessageRespVO>> getKefuMessagePage(@Valid AppKeFuMessagePageReqVO pageReqVO) {
PageResult<KeFuMessageDO> pageResult = kefuMessageService.getKeFuMessagePage(pageReqVO, getLoginUserId());
for (int i = 0; i < pageResult.getList().size(); i++) {
KeFuMessageDO keFuMessageDO = pageResult.getList().get(i);
if (keFuMessageDO.getSenderType() == 1){
MemberUserRespDTO user = memberUserApi.getUser(keFuMessageDO.getSenderId());
keFuMessageDO.setSenderAvatar(user.getAvatar());
}
if (keFuMessageDO.getSenderType() == 2){
String systemUserAvatar = kefuMessageService.findSystemUserAvatar(keFuMessageDO.getSenderId());
keFuMessageDO.setSenderAvatar(systemUserAvatar);
}
}
return success(BeanUtils.toBean(pageResult, KeFuMessageRespVO.class));
}

View File

@ -4,6 +4,7 @@ import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.module.promotion.enums.kefu.KeFuMessageContentTypeEnum;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
@ -78,4 +79,7 @@ public class KeFuMessageDO extends BaseDO {
*/
private Boolean readStatus;
@TableField(exist = false)
private String senderAvatar;
}

View File

@ -9,6 +9,7 @@ import cn.iocoder.yudao.module.promotion.dal.dataobject.kefu.KeFuMessageDO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.Collection;
import java.util.List;
@ -46,4 +47,8 @@ public interface KeFuMessageMapper extends BaseMapperX<KeFuMessageDO> {
.orderByDesc(KeFuMessageDO::getCreateTime));
}
@Select(" SELECT avatar FROM system_users where id = #{id} ")
String findSystemUserAvatar(Long id);
}

View File

@ -59,4 +59,6 @@ public interface KeFuMessageService {
*/
PageResult<KeFuMessageDO> getKeFuMessagePage(AppKeFuMessagePageReqVO pageReqVO, Long userId);
String findSystemUserAvatar(Long id);
}

View File

@ -159,6 +159,11 @@ public class KeFuMessageServiceImpl implements KeFuMessageService {
return keFuMessageMapper.selectPage(pageReqVO);
}
@Override
public String findSystemUserAvatar(Long id) {
return keFuMessageMapper.findSystemUserAvatar(id);
}
private KeFuMessageServiceImpl getSelf() {
return SpringUtil.getBean(getClass());
}

View File

@ -254,6 +254,7 @@ public class SocialClientServiceImpl implements SocialClientService {
ObjUtil.defaultIfNull(reqVO.getAutoColor(), SocialWxQrcodeReqDTO.AUTO_COLOR),
null,
ObjUtil.defaultIfNull(reqVO.getHyaline(), SocialWxQrcodeReqDTO.HYALINE));
} catch (WxErrorException e) {
log.error("[getWxQrcode][reqVO({})) 获得小程序码失败]", reqVO, e);
throw exception(SOCIAL_CLIENT_WEIXIN_MINI_APP_QRCODE_ERROR);

View File

@ -57,7 +57,7 @@ spring:
# url: jdbc:kingbase8://127.0.0.1:54321/test # 人大金仓 KingbaseES 连接的示例
# url: jdbc:postgresql://127.0.0.1:5432/postgres # OpenGauss 连接的示例
username: root
# password: 123456
# password: 123456
password: xpower1234
# username: sa # SQL Server 连接的示例
# password: Yudao@2024 # SQL Server 连接的示例
@ -228,7 +228,7 @@ yudao:
enable: false
demo: false # 关闭演示模式
wxa-code:
env-version: develop # 小程序版本: 正式版为 "release";体验版为 "trial";开发版为 "develop"
env-version: release # 小程序版本: 正式版为 "release";体验版为 "trial";开发版为 "develop"
tencent-lbs-key: TVDBZ-TDILD-4ON4B-PFDZA-RNLKH-VVF6E # QQ 地图的密钥 https://lbs.qq.com/service/staticV2/staticGuide/staticDoc
justauth: