wexin-java升级4.0.0

springboot升级2.4.1
This commit is contained in:
xuwenbo
2020-12-21 13:10:53 +08:00
parent 4222a6e41a
commit a9ae138f04
20 changed files with 48 additions and 193 deletions

View File

@ -8,7 +8,7 @@
*/
package co.yixiang.modules.mp.service;
import cn.binarywang.wx.miniapp.bean.WxMaLiveResult;
import cn.binarywang.wx.miniapp.bean.live.WxMaLiveResult;
import co.yixiang.common.service.BaseService;
import co.yixiang.modules.mp.service.dto.UpdateGoodsDto;
import co.yixiang.modules.mp.service.dto.WxMaLiveInfo;

View File

@ -1,6 +1,6 @@
package co.yixiang.modules.mp.service.dto;
import cn.binarywang.wx.miniapp.util.json.WxMaGsonBuilder;
import cn.binarywang.wx.miniapp.json.WxMaGsonBuilder;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
@ -23,22 +23,22 @@ public class WxMaLiveResult implements Serializable {
private Integer total;
private Integer auditId;
private Integer goodsId;
private List<cn.binarywang.wx.miniapp.bean.WxMaLiveResult.Goods> goods;
private List<cn.binarywang.wx.miniapp.bean.live.WxMaLiveResult.Goods> goods;
/**
* 直播间列表
*/
@SerializedName("room_info")
private List<cn.binarywang.wx.miniapp.bean.WxMaLiveResult.RoomInfo> roomInfos;
private List<cn.binarywang.wx.miniapp.bean.live.WxMaLiveResult.RoomInfo> roomInfos;
/**
* 获取回放源视频列表
*/
@SerializedName("live_replay")
private List<cn.binarywang.wx.miniapp.bean.WxMaLiveResult.LiveReplay> liveReplay;
private List<cn.binarywang.wx.miniapp.bean.live.WxMaLiveResult.LiveReplay> liveReplay;
public static cn.binarywang.wx.miniapp.bean.WxMaLiveResult fromJson(String json) {
return WxMaGsonBuilder.create().fromJson(json, cn.binarywang.wx.miniapp.bean.WxMaLiveResult.class);
public static cn.binarywang.wx.miniapp.bean.live.WxMaLiveResult fromJson(String json) {
return WxMaGsonBuilder.create().fromJson(json, cn.binarywang.wx.miniapp.bean.live.WxMaLiveResult.class);
}
/**
@ -111,7 +111,7 @@ public class WxMaLiveResult implements Serializable {
private Integer closeGoods;
@SerializedName("close_comment")
private Integer closeComment;
private List<cn.binarywang.wx.miniapp.bean.WxMaLiveResult.Goods> goods;
private List<cn.binarywang.wx.miniapp.bean.live.WxMaLiveResult.Goods> goods;
}
/**

View File

@ -9,8 +9,8 @@
package co.yixiang.modules.mp.service.impl;
import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.bean.WxMaLiveInfo;
import cn.binarywang.wx.miniapp.bean.WxMaLiveResult;
import cn.binarywang.wx.miniapp.bean.live.WxMaLiveGoodInfo;
import cn.binarywang.wx.miniapp.bean.live.WxMaLiveResult;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
@ -19,6 +19,7 @@ import co.yixiang.common.utils.QueryHelpPlus;
import co.yixiang.dozer.service.IGenerator;
import co.yixiang.enums.LiveGoodsEnum;
import co.yixiang.exception.BadRequestException;
import co.yixiang.modules.mp.service.dto.WxMaLiveInfo;
import co.yixiang.modules.mp.service.mapper.YxWechatLiveGoodsMapper;
import co.yixiang.modules.mp.domain.YxWechatLiveGoods;
import co.yixiang.modules.mp.service.YxWechatLiveGoodsService;
@ -102,7 +103,7 @@ public class YxWechatLiveGoodsServiceImpl extends BaseServiceImpl<YxWechatLiveGo
YxWechatLiveGoods wechatLiveGoods = this.getById(resources.getGoodsId());
try {
WxMaService wxMaService = WxMaConfiguration.getWxMaService();
WxMaLiveInfo.Goods goods = generator.convert(resources, WxMaLiveInfo.Goods.class);
WxMaLiveGoodInfo goods = generator.convert(resources, WxMaLiveGoodInfo.class);
if(ObjectUtil.isNotEmpty(wechatLiveGoods)){
/** 审核状态 0未审核1审核中2:审核通过3审核失败 */
if(LiveGoodsEnum.IS_Audit_2.getValue().equals(wechatLiveGoods.getAuditStatus())){
@ -193,7 +194,7 @@ public class YxWechatLiveGoodsServiceImpl extends BaseServiceImpl<YxWechatLiveGo
WxMaService wxMaService = WxMaConfiguration.getWxMaService();
try {
resources.setCoverImgUrl(uploadPhotoToWx(wxMaService,resources.getCoverImgeUrl()).getMediaId());
WxMaLiveInfo.Goods goods = generator.convert(resources, WxMaLiveInfo.Goods.class);
WxMaLiveGoodInfo goods = generator.convert(resources, WxMaLiveGoodInfo.class);
WxMaLiveResult wxMaLiveResult = wxMaService.getLiveGoodsService().addGoods(goods);
resources.setGoodsId(Long.valueOf(wxMaLiveResult.getGoodsId()));
resources.setAuditId(Long.valueOf(wxMaLiveResult.getAuditId()));

View File

@ -9,8 +9,8 @@
package co.yixiang.modules.mp.service.impl;
import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.bean.WxMaLiveResult;
import cn.binarywang.wx.miniapp.util.json.WxMaGsonBuilder;
import cn.binarywang.wx.miniapp.bean.live.WxMaLiveResult;
import cn.binarywang.wx.miniapp.json.WxMaGsonBuilder;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import co.yixiang.common.service.impl.BaseServiceImpl;