From 10739f936c7500bf7a230d47a1f07d04084d3f9f Mon Sep 17 00:00:00 2001 From: huangdeliang Date: Thu, 15 Jul 2021 15:47:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom/WechatAppletController.java | 19 +++++++--------- .../custom/dto/response/BannerResponse.java | 22 +++++++++++-------- .../mapper/custom/SysWxUserInfoMapper.xml | 4 ++-- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/WechatAppletController.java b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/WechatAppletController.java index 8a0367d58..18adcdde5 100644 --- a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/WechatAppletController.java +++ b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/WechatAppletController.java @@ -790,7 +790,7 @@ public class WechatAppletController extends BaseController { public TableDataInfo getCommunityPunch() { startPage(); List list = sysWxUserLogService.getCommunityPunch(new SysWxUserLog()); - if(list != null && list.size() > 0){ + if (list != null && list.size() > 0) { for (CommunityPunchReponse comm : list) { comm.setId(AesUtils.encrypt(comm.getId())); comm.setCusId(AesUtils.encrypt(comm.getCusId())); @@ -806,20 +806,14 @@ public class WechatAppletController extends BaseController { * @return */ @PostMapping("/updateHealthManifesto") - public AjaxResult updateHealthManifesto(@RequestParam("cusId") String cusId, @RequestParam("healthManifesto") String healthManifesto) { - if (StringUtils.isEmpty(healthManifesto, cusId)) { - return AjaxResult.error("缺少必要参数"); - } - cusId = AesUtils.decrypt(cusId); - if (cusId == null) { + public AjaxResult updateHealthManifesto(@RequestBody SysWxUserInfo sysWxUserInfo) { + if (StringUtils.isNull(sysWxUserInfo.getOpenid())) { return AjaxResult.error("参数不合法"); } - if (healthManifesto.length() > 200) { + if (sysWxUserInfo.getHealthManifesto().length() > 200) { return AjaxResult.error("健康宣言字数过长"); } - SysWxUserInfo sysWxUserInfo = new SysWxUserInfo(); - sysWxUserInfo.setCusId(Long.parseLong(cusId)); - sysWxUserInfo.setHealthManifesto(healthManifesto); + return toAjax(sysWxUserInfoService.updateHealthManifestoByCusId(sysWxUserInfo)); } @@ -869,6 +863,9 @@ public class WechatAppletController extends BaseController { //获取可以显示的Banner sysWxBannerImage.setShowFlag(1L); List list = sysWxBannerImageService.getBannerListOrderByOrderNum(sysWxBannerImage); + for (BannerResponse banner : list) { + banner.setBannerUrl(AliyunOSSUtils.generatePresignedUrl(banner.getBannerUrl())); + } return AjaxResult.success(list); } diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/dto/response/BannerResponse.java b/stdiet-custom/src/main/java/com/stdiet/custom/dto/response/BannerResponse.java index 14ae1bd07..aead5cf59 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/dto/response/BannerResponse.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/dto/response/BannerResponse.java @@ -3,26 +3,30 @@ package com.stdiet.custom.dto.response; import com.stdiet.common.annotation.Excel; import lombok.Data; -import java.io.Serializable; - @Data -public class BannerResponse implements Serializable { +public class BannerResponse { - private static final long serialVersionUID = 1L; - - /** banner图标题 */ + /** + * banner图标题 + */ @Excel(name = "banner图标题") private String title; - /** banner图内容 */ + /** + * banner图内容 + */ @Excel(name = "banner图内容") private String content; - /** banner图片地址 */ + /** + * banner图片地址 + */ @Excel(name = "banner图片地址") private String bannerUrl; - /** 点击跳转地址 */ + /** + * 点击跳转地址 + */ @Excel(name = "点击跳转地址") private String jumpUrl; } diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysWxUserInfoMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysWxUserInfoMapper.xml index a2db510d5..035aa29ae 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysWxUserInfoMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysWxUserInfoMapper.xml @@ -144,9 +144,9 @@ update sys_wx_user_info set cus_id = null where openid = #{openid} - + - update sys_wx_user_info set health_manifesto = #{healthManifesto} where cus_id = #{cusId} + update sys_wx_user_info set health_manifesto = #{healthManifesto} where openid = #{openid} \ No newline at end of file