记得上下班打卡 | git大法好,push需谨慎

Commit 1ec2d4bf authored by jiangxiulong's avatar jiangxiulong

sweet add api do

parent 8623bd68
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>liquidnet-bus-api</artifactId>
<groupId>com.liquidnet</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>liquidnet-service-sweet-api</artifactId>
<dependencies>
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-miniapp</artifactId>
<version>4.1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
<version>2.2.3.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-mp</artifactId>
<version>4.1.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
package com.liquidnet.service.sweet.config;
import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl;
import cn.binarywang.wx.miniapp.config.impl.WxMaRedisBetterConfigImpl;
import me.chanjar.weixin.common.redis.RedisTemplateWxRedisOps;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;
import javax.annotation.PostConstruct;
@Configuration
public class WechatMaConfigure {
private static String appletAppidZhengzai;
private static String appletSecretZhengzai;
private static String appletAppidStrawberry;
private static String appletSecretStrawberry;
private static String appletAppidFive;
private static String appletSecretFive;
private static String appletAppidMdsk;
private static String appletSecretMdsk;
@Value("${liquidnet.wechat.applet.zhengzai.appid}")
public void setAppletAppidZhengzai(String appletAppidZhengzai) {
WechatMaConfigure.appletAppidZhengzai = appletAppidZhengzai;
}
@Value("${liquidnet.wechat.applet.zhengzai.secret}")
public void setAppletSecretZhengzai(String appletSecretZhengzai) {
WechatMaConfigure.appletSecretZhengzai = appletSecretZhengzai;
}
@Value("${liquidnet.wechat.applet.strawberry.appid}")
public void setAppletAppidStrawberry(String appletAppidStrawberry) {
WechatMaConfigure.appletAppidStrawberry = appletAppidStrawberry;
}
@Value("${liquidnet.wechat.applet.strawberry.secret}")
public void setAppletSecretStrawberry(String appletSecretStrawberry) {
WechatMaConfigure.appletSecretStrawberry = appletSecretStrawberry;
}
@Value("${liquidnet.wechat.applet.five.appid}")
public void setAppletAppidFive(String appletAppidFive) {
WechatMaConfigure.appletAppidFive = appletAppidFive;
}
@Value("${liquidnet.wechat.applet.five.secret}")
public void setAppletSecretFive(String appletSecretFive) {
WechatMaConfigure.appletSecretFive = appletSecretFive;
}
@Value("${liquidnet.wechat.applet.mdsk.appid}")
public void setAppletAppidMdsk(String appletAppidMdsk) {
WechatMaConfigure.appletAppidMdsk = appletAppidMdsk;
}
@Value("${liquidnet.wechat.applet.mdsk.secret}")
public void setAppletSecretMdsk(String appletSecretMdsk) {
WechatMaConfigure.appletSecretMdsk = appletSecretMdsk;
}
private WxMaService wxMaAppletZhengzaiService;
private WxMaService wxMaAppletStrawberryService;
private WxMaService wxMaAppletFiveService;
private WxMaService wxMaAppletMdskService;
@Autowired
private StringRedisTemplate stringRedisTemplate;
@PostConstruct
public void init() {
wxMaAppletZhengzaiService = new WxMaServiceImpl() {
{
RedisTemplateWxRedisOps redisTemplateWxRedisOps = new RedisTemplateWxRedisOps(stringRedisTemplate);
WxMaRedisBetterConfigImpl wxMaDefaultConfig = new WxMaRedisBetterConfigImpl(redisTemplateWxRedisOps, "sweet:accessToken:applet:zhengzai");
// WxMaDefaultConfigImpl wxMaDefaultConfig = new WxMaDefaultConfigImpl();
wxMaDefaultConfig.setAppid(appletAppidZhengzai);
wxMaDefaultConfig.setSecret(appletSecretZhengzai);
wxMaDefaultConfig.setMsgDataFormat("JSON");
this.setWxMaConfig(wxMaDefaultConfig);
}
};
wxMaAppletStrawberryService = new WxMaServiceImpl() {
{
RedisTemplateWxRedisOps redisTemplateWxRedisOps = new RedisTemplateWxRedisOps(stringRedisTemplate);
WxMaRedisBetterConfigImpl wxMaDefaultConfig = new WxMaRedisBetterConfigImpl(redisTemplateWxRedisOps, "sweet:accessToken:applet:strawberry");
// WxMaDefaultConfigImpl wxMaDefaultConfig = new WxMaDefaultConfigImpl();
wxMaDefaultConfig.setAppid(appletAppidStrawberry);
wxMaDefaultConfig.setSecret(appletSecretStrawberry);
wxMaDefaultConfig.setMsgDataFormat("JSON");
this.setWxMaConfig(wxMaDefaultConfig);
}
};
wxMaAppletFiveService = new WxMaServiceImpl() {
{
RedisTemplateWxRedisOps redisTemplateWxRedisOps = new RedisTemplateWxRedisOps(stringRedisTemplate);
WxMaRedisBetterConfigImpl wxMaDefaultConfig = new WxMaRedisBetterConfigImpl(redisTemplateWxRedisOps, "sweet:accessToken:applet:five");
// WxMaDefaultConfigImpl wxMaDefaultConfig = new WxMaDefaultConfigImpl();
wxMaDefaultConfig.setAppid(appletAppidFive);
wxMaDefaultConfig.setSecret(appletSecretFive);
wxMaDefaultConfig.setMsgDataFormat("JSON");
this.setWxMaConfig(wxMaDefaultConfig);
}
};
wxMaAppletMdskService = new WxMaServiceImpl() {
{
RedisTemplateWxRedisOps redisTemplateWxRedisOps = new RedisTemplateWxRedisOps(stringRedisTemplate);
WxMaRedisBetterConfigImpl wxMaDefaultConfig = new WxMaRedisBetterConfigImpl(redisTemplateWxRedisOps, "sweet:accessToken:applet:mdsk");
// WxMaDefaultConfigImpl wxMaDefaultConfig = new WxMaDefaultConfigImpl();
wxMaDefaultConfig.setAppid(appletAppidMdsk);
wxMaDefaultConfig.setSecret(appletSecretMdsk);
wxMaDefaultConfig.setMsgDataFormat("JSON");
this.setWxMaConfig(wxMaDefaultConfig);
}
};
}
public WxMaService getWxMaService(Integer anum) {
switch (anum) {
case 4:
return wxMaAppletZhengzaiService;
case 1:
return wxMaAppletStrawberryService;
case 2:
return wxMaAppletFiveService;
case 3:
return wxMaAppletMdskService;
}
return null;
}
public String getWxMaAppid(Integer anum) {
switch (anum) {
case 4:
return appletAppidZhengzai;
case 1:
return appletAppidStrawberry;
case 2:
return appletAppidFive;
case 3:
return appletAppidMdsk;
}
return "";
}
}
package com.liquidnet.service.sweet.config;
import me.chanjar.weixin.common.redis.RedisTemplateWxRedisOps;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
import me.chanjar.weixin.mp.config.impl.WxMpRedisConfigImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;
import javax.annotation.PostConstruct;
@Configuration
public class WechatMpConfigure {
private static String appidZhengzai;
private static String secretZhengzai;
private static String tokenZhengzai;
private static String aeskeyZhengzai;
private static String appidModernsky;
private static String secretModernsky;
@Value("${liquidnet.wechat.service.zhengzai.appid}")
public void setAppidZhengzai(String appidZhengzai) { WechatMpConfigure.appidZhengzai = appidZhengzai; }
@Value("${liquidnet.wechat.service.zhengzai.secret}")
public void setSecretZhengzai(String secretZhengzai) {
WechatMpConfigure.secretZhengzai = secretZhengzai;
}
@Value("${liquidnet.wechat.service.zhengzai.token}")
public void setTokenZhengzai(String tokenZhengzai) {
WechatMpConfigure.tokenZhengzai = tokenZhengzai;
}
@Value("${liquidnet.wechat.service.zhengzai.aeskey}")
public void setAeskeyZhengzai(String aeskeyZhengzai) {
WechatMpConfigure.aeskeyZhengzai = aeskeyZhengzai;
}
@Value("${liquidnet.wechat.service.modernsky.appid}")
public void setAppidModernsky(String appidModernsky) {
WechatMpConfigure.appidModernsky = appidModernsky;
}
@Value("${liquidnet.wechat.service.modernsky.secret}")
public void setSecretModernsky(String secretModernsky) {
WechatMpConfigure.secretModernsky = secretModernsky;
}
private WxMpService wxMpZhengzaiService;
private WxMpService wxMpModernskyService;
@Autowired
private StringRedisTemplate stringRedisTemplate;
@PostConstruct
public void init() {
wxMpZhengzaiService = new WxMpServiceImpl() {
{
RedisTemplateWxRedisOps redisTemplateWxRedisOps = new RedisTemplateWxRedisOps(stringRedisTemplate);
WxMpRedisConfigImpl wxMpDefaultConfig = new WxMpRedisConfigImpl(redisTemplateWxRedisOps, "sweet:accessToken:service:zhengzai");
wxMpDefaultConfig.setAppId(appidZhengzai);
wxMpDefaultConfig.setSecret(secretZhengzai);
wxMpDefaultConfig.setToken(tokenZhengzai);
wxMpDefaultConfig.setAesKey(aeskeyZhengzai);
this.setWxMpConfigStorage(wxMpDefaultConfig);
}
};
wxMpModernskyService = new WxMpServiceImpl() {
{
RedisTemplateWxRedisOps redisTemplateWxRedisOps = new RedisTemplateWxRedisOps(stringRedisTemplate);
WxMpRedisConfigImpl wxMpDefaultConfig = new WxMpRedisConfigImpl(redisTemplateWxRedisOps, "sweet:accessToken:service:modernsky");
wxMpDefaultConfig.setAppId(appidModernsky);
wxMpDefaultConfig.setSecret(secretModernsky);
this.setWxMpConfigStorage(wxMpDefaultConfig);
}
};
}
public WxMpService getWxMpService(Integer pnum) {
switch (pnum) {
case 1:
return wxMpZhengzaiService;
case 2:
return wxMpModernskyService;
}
return null;
}
}
package com.liquidnet.service.sweet.constant;
/**
*
*/
public class SweetConstant {
public final static String REDIS_KEY_SWEET_MANUAL_PUSH_LIST = "sweet:manual:pushList";
public final static String REDIS_KEY_SWEET_MANUAL_TIME_LIST = "sweet:manual:timeList:manual:";
public final static String REDIS_KEY_SWEET_MANUAL_NOTIFY_LIST = "sweet:manual:notify:manual:";
public final static String REDIS_KEY_SWEET_MANUAL_RICH_TEXT = "sweet:manual:richText:manual:";
public final static String REDIS_KEY_SWEET_MANUAL_SORT = "sweet:manual:sort:manual:";
public final static String REDIS_KEY_SWEET_ARTISTS_RELATION = "sweet:artists:relation:uid:";
public final static String REDIS_KEY_SWEET_ARTISTS_DETAILS = "sweet:artists:details:";
public final static String REDIS_KEY_SWEET_SHOP = "sweet:artists:shop:manual:";
public final static String REDIS_KEY_SWEET_LUCK_DRAW = "sweet:luckDraw:mobile:";
public final static String REDIS_KEY_SWEET_LUCK_DRAW_RESULT = "sweet:luckDraw:num:";
public final static String REDIS_KEY_SWEET_LUCK_DRAW_SURPLUS = "sweet:luckDraw:num:";//中奖库存
public final static String REDIS_KEY_SWEET_LUCK_DRAW_ALL = "sweet:luckDraw:num:";//中奖总量
public final static String REDIS_KEY_SWEET_LUCK_DRAW_PRESENT_MOBILE = "sweet:luckDraw:present:mobile:";//中奖库存
public final static String REDIS_KEY_SWEET_WECHAT_USER_INFO="sweet:wechatUser:unionId:";
public final static String REDIS_KEY_SWEET_WECHAT_USER_INFO_STR="sweet:wechatUser:unionIdStr:";
public final static String REDIS_KEY_SWEET_WECHAT_USER_UNIONID="sweet:wechatUser:openId:";
public final static String REDIS_KEY_SWEET_ANSWER_PHONE="sweet:answer:phone:";
// public enum ManualPosition {
// artist("艺人","artist"),
// signingTime("签售时间","signingTime"),
// foodAndAmusement("吃喝玩乐","foodAndAmusement"),
// siteMap("现场地图","siteMap"),
// howToReach("如何到达","howToReach"),
// relatedProduct ("官方售卖","relatedProduct"),
// officialSupport("官方支持","officialSupport"),
// audienceNotice("观众须知","audienceNotice"),
// preventionGuidelines("防疫指南","preventionGuidelines"),
// notice("通知","notice"),
// strategy("观演攻略","strategy");
//
// private String message;
// private String code;
//
// private ManualPosition(String message, String code) {
// this.message = message;
// this.code = code;
// }
//
// public void setCode(String code) {
// this.code = code;
// }
//
// public String getCode() {
// return code;
// }
//
// public void setMessage(String message) {
// this.message = message;
// }
//
// public String getMessage() {
// return message;
// }
//
// public static String getMessage(String code) {
// for (ManualPosition c : ManualPosition.values()) {
// if (c.getCode().equalsIgnoreCase(code)) {
// return c.message;
// }
// }
// return null;
// }
// }
public final static String REDIS_KEY_SWEET_MDSK_MANUAL_PUSH_LIST = "sweet:mdsk:manual:pushList";
public final static String REDIS_KEY_SWEET_MDSK_MANUAL_TIME_LIST = "sweet:mdsk:manual:timeList:manual:";
public final static String REDIS_KEY_SWEET_MDSK_MANUAL_NOTIFY_LIST = "sweet:mdsk:manual:notify:manual:";
public final static String REDIS_KEY_SWEET_MDSK_MANUAL_RICH_TEXT = "sweet:mdsk:manual:richText:manual:";
public final static String REDIS_KEY_SWEET_MDSK_MANUAL_SORT = "sweet:mdsk:manual:sort:manual:";
public final static String REDIS_KEY_SWEET_MDSK_ARTISTS_RELATION = "sweet:mdsk:artists:relation:uid:";
public final static String REDIS_KEY_SWEET_MDSK_ARTISTS_DETAILS = "sweet:mdsk:artists:details:";
public final static String REDIS_KEY_SWEET_MDSK_SHOP = "sweet:mdsk:artists:shop:manual:";
}
package com.liquidnet.service.sweet.dto.param;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.*;
import java.io.Serializable;
@ApiModel(value = "SweetOpenSendMsgParam", description = "发送模版消息公共接口入参")
@Data
public class SweetOpenSendMsgParam implements Serializable {
private static final long serialVersionUID = 675588088506034208L;
@ApiModelProperty(position = 11, required = true, allowableValues = "1,2", value = "发送目标类型 1正在服务号 2摩登服务号")
@NotNull(message = "sendTargetType不能为空") @Min(value = 1, message = "sendTargetType无效") @Max(value = 2, message = "sendTargetType无效")
private Integer sendTargetType;
@ApiModelProperty(position = 12, required = true, value = "模版消息ID", example = "y-j82V1TYhlTH1j8QscuDPcPQtNiDtENb7N5IZMBvqU")
@NotBlank(message = "templateId不能为空")
private String templateId;
@ApiModelProperty(position = 13, required = true, value = "模版消息数据", example = "{\"first\": \"感谢关注「正在现场」服务号\", \"keyword2\": \"4006-310-750\"}")
@NotBlank(message = "templateData不能为空")
private String templateData;
@ApiModelProperty(position = 14, required = true, allowableValues = "1,2,3,4,5", value = "点击跳转类型 1草莓小程序 2五百里小程序 3mdsk小程序 4正在小程序 5url")
@NotNull(message = "jumpType不能为空") @Min(value = 1, message = "jumpType无效") @Max(value = 5, message = "jumpType无效")
private Integer jumpType;
@ApiModelProperty(position = 15, value = "跳转url", example = "www.zhengzai.tv")
private String jumpUrl;
@ApiModelProperty(position = 16, allowableValues = "false,true", value = "是否需要前端配合处理跳转,直接跳转jumpAppletPagePath为false,true时需要前端根据状态码做跳转处理")
private Boolean jumpAppletUsePath;
@ApiModelProperty(position = 17, value = "跳转小程序需要的某页地址", example = "pages/webview?query=lottery")
private String jumpAppletPagePath;
/*@ApiModelProperty(position = 18, required = true, value = "openId", example = "oUpkkuNe4yuVs77aaKFvuvpgNOSw")
@NotBlank(message = "openId不能为空")
private String openId;*/
@ApiModelProperty(position = 18, required = true, value = "phone", example = "15888888888")
@NotBlank(message = "phone不能为空")
private String phone;
}
......@@ -17,6 +17,7 @@
<module>liquidnet-service-adam-api</module>
<module>liquidnet-service-kylin-api</module>
<module>liquidnet-service-dragon-api</module>
<module>liquidnet-service-sweet-api</module>
</modules>
<dependencies>
<dependency>
......
......@@ -294,6 +294,16 @@ public class PerformancesExpressController extends BaseController {
}
}
// 导出数据
@PostMapping("/export")
@ResponseBody
public AjaxResult export(@RequestParam("ids") String performanceId)
{
List<Xxxx> list = xxxxService.selectXxxxList(xxxx);
ExcelUtil<Xxxx> util = new ExcelUtil<Xxxx>(Xxxx.class);
return util.exportExcel(list, "xx数据");
}
/**
* 打印单条获取数据
*/
......
......@@ -44,6 +44,7 @@
var prefix = ctx + "kylin/performancesExpress";
var batchGenerateImageFlag = [[${@permission.hasPermi('kylin:performancesExpress:batchGenerateImage')}]];
var batchPrintExpressFlag = [[${@permission.hasPermi('kylin:performancesExpress:batchPrintExpress')}]];
var exportExcelFlag = [[${@permission.hasPermi('kylin:performancesExpress:exportExcelFlag')}]];
function generateImage(performanceId) {
var configPrint = {
......@@ -293,6 +294,7 @@
batchCancelOrderUrl: prefix + "/batchCancelOrder",
batchGenerateImageUrl: prefix + "/batchGenerateImage",
batchPrintExpressUrl: prefix + "/batchPrintExpress",
exportUrl: prefix + "/export",
modalName: "演出快递",
columns: [
{
......@@ -333,6 +335,7 @@
actions.push('<a class="btn btn-warning btn-xs ' + batchCancelOrderFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.performancesId + '\', \'确定批量取消吗?\', table.options.batchCancelOrderUrl)"></i>取消</a> ');
// actions.push('<a class="btn btn-warning btn-xs ' + batchGenerateImageFlag + '" href="javascript:void(0)" onclick="generateImage(\'' + row.performancesId + '\',)"></i>下载快递单</a> ');
actions.push('<a class="btn btn-warning btn-xs ' + batchPrintExpressFlag + '" href="javascript:void(0)" onclick="printExpress(\'' + row.performancesId + '\',)"></i>打印快递单</a> ');
actions.push('<a class="btn btn-warning btn-xs ' + exportExcelFlag + '" href="javascript:void(0)" onclick="$.table.exportExcel()"></i>导出快递单</a> ');
return actions.join('');
}
}]
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>liquidnet-bus-do</artifactId>
<groupId>com.liquidnet</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>liquidnet-service-sweet-do</artifactId>
</project>
\ No newline at end of file
package com.liquidnet.service.sweet.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 小程序登录记录用户解密后信息表
* </p>
*
* @author jiangxiulong
* @since 2021-09-22
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class SweetAppletUser implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "mid", type = IdType.AUTO)
private Long mid;
/**
* user_id
*/
private String userId;
/**
* openId
*/
@TableField("openId")
private String openId;
/**
* unionId
*/
@TableField("unionId")
private String unionId;
/**
* 手机号
*/
@TableField("getPhoneNumber")
private String getPhoneNumber;
/**
* 手机号
*/
@TableField("getPurePhoneNumber")
private String getPurePhoneNumber;
/**
* 地区码
*/
@TableField("getCountryCode")
private String getCountryCode;
/**
* 1草莓 2五百里 3mdsk 4正在
*/
private Integer type;
/**
* 创建时间
*/
private LocalDateTime createdAt;
/**
* 更新时间
*/
private LocalDateTime updatedAt;
}
package com.liquidnet.service.sweet.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 正在现场服务号关注事件储存用户信息表
* </p>
*
* @author jiangxiulong
* @since 2021-08-03
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class SweetWechatUser implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "mid", type = IdType.AUTO)
private Long mid;
/**
* user_id
*/
private String userId;
/**
* openId
*/
@TableField("openId")
private String openId;
/**
* unionId
*/
@TableField("unionId")
private String unionId;
/**
* 昵称
*/
private String nickname;
/**
* 性别
*/
@TableField("sexDesc")
private String sexDesc;
/**
* 性别 男1
*/
private Integer sex;
/**
* 头像
*/
@TableField("headImgUrl")
private String headImgUrl;
/**
* zh_CN
*/
private String language;
/**
* 国家
*/
private String country;
/**
* 省
*/
private String province;
/**
* 市
*/
private String city;
/**
* 关注时间
*/
@TableField("subscribeTime")
private LocalDateTime subscribeTime;
/**
* ADD_SCENE_SEARCH 关注方式
*/
@TableField("subscribeScene")
private String subscribeScene;
/**
* 是否取消关注
*/
private Integer isCancel;
/**
* 创建时间
*/
private LocalDateTime createdAt;
/**
* 更新时间
*/
private LocalDateTime updatedAt;
private static final SweetWechatUser obj = new SweetWechatUser();
public static SweetWechatUser getNew() {
try {
return (SweetWechatUser) obj.clone();
} catch (CloneNotSupportedException e) {
return new SweetWechatUser();
}
}
}
package com.liquidnet.service.sweet.mapper;
import com.liquidnet.service.sweet.entity.SweetAppletUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.liquidnet.service.sweet.entity.SweetAppletUser;
/**
* <p>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.liquidnet.service.sweet.mapper.SweetWechatUserMapper">
</mapper>
......@@ -19,6 +19,7 @@
<module>liquidnet-service-kylin-do</module>
<module>liquidnet-service-adam-do</module>
<module>liquidnet-service-dragon-do</module>
<module>liquidnet-service-sweet-do</module>
</modules>
<dependencies>
......
......@@ -42,7 +42,13 @@
</dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-service-sweet</artifactId>
<artifactId>liquidnet-service-sweet-do</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-service-sweet-api</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
......
package com.liquidnet.service;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
......@@ -13,6 +14,7 @@ import java.util.Arrays;
@Slf4j
@SpringBootApplication(scanBasePackages = {"com.liquidnet"})
@MapperScan(basePackages = {"com.liquidnet.service.sweet.mapper"})
public class ServiceConsumerSweetApplication implements CommandLineRunner {
@Autowired
private Environment environment;
......
......@@ -4,7 +4,7 @@ import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.consumer.sweet.service.impl.SweetWechatTemplateMsgServiceImpl;
import com.liquidnet.service.sweet.param.SweetOpenSendMsgParam;
import com.liquidnet.service.sweet.dto.param.SweetOpenSendMsgParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.stream.MapRecord;
......
......@@ -2,13 +2,13 @@ package com.liquidnet.service.consumer.sweet.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.liquidnet.service.consumer.sweet.utils.RedisDataUtils;
import com.liquidnet.service.sweet.config.WechatMaConfigure;
import com.liquidnet.service.sweet.config.WechatMpConfigure;
import com.liquidnet.service.sweet.dto.param.SweetOpenSendMsgParam;
import com.liquidnet.service.sweet.entity.SweetAppletUser;
import com.liquidnet.service.sweet.entity.SweetWechatUser;
import com.liquidnet.service.sweet.mapper.SweetAppletUserMapper;
import com.liquidnet.service.sweet.param.SweetOpenSendMsgParam;
import com.liquidnet.service.sweet.utils.RedisDataUtils;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.api.WxMpService;
......
package com.liquidnet.service.consumer.sweet.utils;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.service.sweet.constant.SweetConstant;
import com.liquidnet.service.sweet.entity.SweetWechatUser;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
@Slf4j
public class RedisDataUtils {
@Autowired
private RedisUtil redisUtil;
public SweetWechatUser getSweetWechatUser(String unionid) {
if (unionid.isEmpty()) {
return null;
}
String redisKey = SweetConstant.REDIS_KEY_SWEET_WECHAT_USER_INFO.concat(unionid);
return (SweetWechatUser) redisUtil.get(redisKey);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment