Commit f0f6ef26 authored by shiyu's avatar shiyu

一次性订阅新增类

parent 1a017c09
......@@ -73,4 +73,9 @@ public interface CommConsts {
* 平台收货地址
*/
public final static String SYSTEM_DEFAULT_ADDRESS = "换藏平台,13216703670,浙江省杭州市钱塘区2号大街海聚中心1幢1601";
/**
* 消息跳转专场页面
*/
public final static String SPECIAL_PERFORMANCE_URL = "/pages/saleSpecialList/index";
}
......@@ -11,6 +11,28 @@ public class AuctionOfferNoticeMsg implements Entity {
private String templetId;
/**
* 专场id
*/
private Integer specialId;
private String specialPerformanceTitle;
/**
* 专场开始时间
*/
private String specialPerformanceStartTime;
/**
* 专场结束时间
*/
private String specialPerformanceEndTime;
/**
* 专场剩余时间
*/
private String specialPerformanceSurplusTime;
/**
* 分销订单号
*/
......
package com.wwdz.ch.core.impl;
import com.wwdz.ch.core.api.OfficialAccountApi;
import com.wwdz.ch.core.consts.CommConsts;
import com.wwdz.ch.core.entity.*;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.core.util.OkHttpUtil;
......@@ -607,52 +608,92 @@ public class SendMsgServiceImpl implements SendMsgService {
/**
* 竞拍开始通知
* 专场即将开始订阅消息
* @param auctionOfferNoticeMsg
* @return
*/
public boolean sendAuctionStartMsg(AuctionOfferNoticeMsg auctionOfferNoticeMsg) {
public boolean sendSpecialPerformanceStartMsg(AuctionOfferNoticeMsg auctionOfferNoticeMsg) {
String openId = auctionOfferNoticeMsg.getOpenId();
String token = officialAccountApi.getAccessToken();
String url = SEND_SUBSCRIBE_MSG_URL + "?access_token=" + token;
OkHttpUtil okHttpUtil = OkHttpUtil.builder().url(url);
Map<String, Object> map = new HashMap<>();
map.put("touser", openId);
map.put("template_id", "RjUUMuLyyW1g6ULUr9HWO8oEKoE-Vd_3s3p0XRI7tS0");
map.put("template_id", "AzJht7hkLJHSCN7trT3zsV3TaOE0Xk8faqm2sTf3Pm4");
Map<String, Object> miniprogramMap = new HashMap<>();
miniprogramMap.put("appid", APPLET_APPID);
StringBuffer stringBuffer = new StringBuffer(AUCTION_MSG_URL);
stringBuffer.append("?itemId=" + auctionOfferNoticeMsg.getItemId());
if (StringUtils.hasLength(auctionOfferNoticeMsg.getShareRecordId())) {
stringBuffer.append("&shareRecordId=" + auctionOfferNoticeMsg.getShareRecordId());
StringBuffer stringBuffer = new StringBuffer(CommConsts.SPECIAL_PERFORMANCE_URL);
stringBuffer.append("?specialId==" + auctionOfferNoticeMsg.getSpecialId());
miniprogramMap.put("pagepath", stringBuffer.toString());
map.put("miniprogram", miniprogramMap);
Map<String, Object> paramMap = new LinkedHashMap<>();
paramMap.put("thing2", new HashMap() {{
put("value", auctionOfferNoticeMsg.getSpecialPerformanceTitle());
}});
paramMap.put("time4", new HashMap() {{
put("value", auctionOfferNoticeMsg.getSpecialPerformanceStartTime());
}});
map.put("data", paramMap);
logger.info("============ 专场即将开始订阅消息内容 : {}", JsonUtils.fromMap(map));
okHttpUtil.addParams(map);
okHttpUtil.post(true);
String responseStr = okHttpUtil.async();
logger.info("openid : {}, 发送专场即将开始订阅消息 response :{}", openId, responseStr);
String errorCode = JsonUtils.getValueByPath(responseStr, "errcode");
String errmsg = JsonUtils.getValueByPath(responseStr, "errmsg");
if (!"0".equals(errorCode)) {
logger.error("openid : {}, 发送专场即将开始订阅消息, errorCode : {}, errmsg : {} ", openId, errorCode, errmsg);
return false;
}
logger.info("============= 发送专场即将开始订阅消息成功 ===========");
return true;
}
/**
* 专场即将结束订阅消息
* @param auctionOfferNoticeMsg
* @return
*/
public boolean sendSpecialPerformanceEndMsg(AuctionOfferNoticeMsg auctionOfferNoticeMsg) {
String openId = auctionOfferNoticeMsg.getOpenId();
String token = officialAccountApi.getAccessToken();
String url = SEND_SUBSCRIBE_MSG_URL + "?access_token=" + token;
OkHttpUtil okHttpUtil = OkHttpUtil.builder().url(url);
Map<String, Object> map = new HashMap<>();
map.put("touser", openId);
map.put("template_id", "G-GwA4yn63RJ6IysFotHB4anctNqbOy5qrz_R6vBJkM");
Map<String, Object> miniprogramMap = new HashMap<>();
miniprogramMap.put("appid", APPLET_APPID);
StringBuffer stringBuffer = new StringBuffer(CommConsts.SPECIAL_PERFORMANCE_URL);
stringBuffer.append("?specialId==" + auctionOfferNoticeMsg.getSpecialId());
miniprogramMap.put("pagepath", stringBuffer.toString());
map.put("miniprogram", miniprogramMap);
Map<String, Object> paramMap = new LinkedHashMap<>();
paramMap.put("thing1", new HashMap() {{
put("value", auctionOfferNoticeMsg.getItemName());
paramMap.put("thing4", new HashMap() {{
put("value", auctionOfferNoticeMsg.getSpecialPerformanceTitle());
}});
paramMap.put("time2", new HashMap() {{
put("value", auctionOfferNoticeMsg.getCreateTime());
paramMap.put("thing3", new HashMap() {{
put("value", auctionOfferNoticeMsg.getSpecialPerformanceSurplusTime());
}});
paramMap.put("time3", new HashMap() {{
put("value", auctionOfferNoticeMsg.getContent());
paramMap.put("time7", new HashMap() {{
put("value", auctionOfferNoticeMsg.getSpecialPerformanceEndTime());
}});
map.put("data", paramMap);
logger.info("============ 竞拍开始通知内容 : {}", JsonUtils.fromMap(map));
logger.info("============ 专场即将结束订阅消息内容 : {}", JsonUtils.fromMap(map));
okHttpUtil.addParams(map);
okHttpUtil.post(true);
String responseStr = okHttpUtil.async();
logger.info("openid : {}, 发送竞拍开始通知 response :{}", openId, responseStr);
logger.info("openid : {}, 发送专场即将结束订阅消息 response :{}", openId, responseStr);
String errorCode = JsonUtils.getValueByPath(responseStr, "errcode");
String errmsg = JsonUtils.getValueByPath(responseStr, "errmsg");
if (!"0".equals(errorCode)) {
logger.error("openid : {}, 发送竞拍开始通知, errorCode : {}, errmsg : {} ", openId, errorCode, errmsg);
logger.error("openid : {}, 发送专场即将结束订阅消息, errorCode : {}, errmsg : {} ", openId, errorCode, errmsg);
return false;
}
logger.info("============= 发送竞拍开始通知成功 ===========");
logger.info("============= 发送专场即将结束订阅消息成功 ===========");
return true;
}
......
......@@ -16,7 +16,7 @@ public interface DisposableSubscribeRecordDao {
* @param templateId
* @return
*/
boolean isExisted(String openid, String templateId);
boolean isExisted(String openid, long targetId, String templateId);
/**
* 是否订阅
......@@ -24,7 +24,7 @@ public interface DisposableSubscribeRecordDao {
* @param templateId
* @return
*/
boolean isSubscribed(String openid, String templateId);
boolean isSubscribed(String openid, long targetId, String templateId);
List<DisposableSubscribeRecord> findList(long userId);
}
......@@ -10,7 +10,7 @@ import lombok.Data;
/**
* @author shiyu
* @date 2024/04/07
* @date 2024/07/01
*/
@Data
public class DisposableSubscribeRecord implements Entity {
......@@ -31,6 +31,11 @@ public class DisposableSubscribeRecord implements Entity {
*/
private String templateId;
/**
* 订阅对象id
*/
private Long targetId;
/**
* 创建时间
*/
......@@ -41,6 +46,11 @@ public class DisposableSubscribeRecord implements Entity {
*/
private Date updateTime;
/**
* 类型
*/
private Integer type;
/**
* 是否有效
*/
......@@ -58,8 +68,10 @@ public class DisposableSubscribeRecord implements Entity {
sb.append(", userId=").append(userId);
sb.append(", openid=").append(openid);
sb.append(", templateId=").append(templateId);
sb.append(", targetId=").append(targetId);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", type=").append(type);
sb.append(", isValid=").append(isValid);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
......@@ -82,8 +94,10 @@ public class DisposableSubscribeRecord implements Entity {
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getOpenid() == null ? other.getOpenid() == null : this.getOpenid().equals(other.getOpenid()))
&& (this.getTemplateId() == null ? other.getTemplateId() == null : this.getTemplateId().equals(other.getTemplateId()))
&& (this.getTargetId() == null ? other.getTargetId() == null : this.getTargetId().equals(other.getTargetId()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getIsValid() == null ? other.getIsValid() == null : this.getIsValid().equals(other.getIsValid()));
}
......@@ -95,8 +109,10 @@ public class DisposableSubscribeRecord implements Entity {
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getOpenid() == null) ? 0 : getOpenid().hashCode());
result = prime * result + ((getTemplateId() == null) ? 0 : getTemplateId().hashCode());
result = prime * result + ((getTargetId() == null) ? 0 : getTargetId().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getIsValid() == null) ? 0 : getIsValid().hashCode());
return result;
}
......@@ -113,8 +129,10 @@ public class DisposableSubscribeRecord implements Entity {
userId("user_id", "userId", "BIGINT", false),
openid("openid", "openid", "VARCHAR", false),
templateId("template_id", "templateId", "VARCHAR", false),
targetId("target_id", "targetId", "BIGINT", false),
createTime("create_time", "createTime", "TIMESTAMP", false),
updateTime("update_time", "updateTime", "TIMESTAMP", false),
type("type", "type", "INTEGER", true),
isValid("is_valid", "isValid", "BIT", false);
/**
......
package com.wwdz.ch.db.dto.request.distribution;
import com.wwdz.ch.db.dto.request.BaseRequestDto;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.util.Date;
@Data
public class DisposableSubscribeRecordRequestDto extends BaseRequestDto implements Entity {
private Integer id;
/**
* 用户id
*/
private Long userId;
/**
* openid
*/
private String openid;
/**
* 模板id
*/
private String templateId;
/**
* 订阅对象id
*/
private Long targetId;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 类型
*/
private Integer type;
/**
* 是否有效
*/
private Boolean isValid;
}
......@@ -28,25 +28,28 @@ public class DisposableSubscribeRecordDaoImpl implements DisposableSubscribeReco
DisposableSubscribeRecordExample example = new DisposableSubscribeRecordExample();
DisposableSubscribeRecordExample.Criteria criteria = example.createCriteria();
criteria.andOpenidEqualTo(disposableSubscribeRecord.getOpenid());
criteria.andTargetIdEqualTo(disposableSubscribeRecord.getTargetId());
criteria.andTemplateIdEqualTo(disposableSubscribeRecord.getTemplateId());
disposableSubscribeRecord.setUpdateTime(new Date());
return disposableSubscribeRecordMapper.updateByExampleSelective(disposableSubscribeRecord, example) > 0;
}
@Override
public boolean isExisted(String openid, String templateId) {
public boolean isExisted(String openid, long targetId, String templateId) {
DisposableSubscribeRecordExample example = new DisposableSubscribeRecordExample();
DisposableSubscribeRecordExample.Criteria criteria = example.createCriteria();
criteria.andOpenidEqualTo(openid);
criteria.andTargetIdEqualTo(targetId);
criteria.andTemplateIdEqualTo(templateId);
return disposableSubscribeRecordMapper.countByExample(example) > 0;
}
@Override
public boolean isSubscribed(String openid, String templateId) {
public boolean isSubscribed(String openid, long targetId, String templateId) {
DisposableSubscribeRecordExample example = new DisposableSubscribeRecordExample();
DisposableSubscribeRecordExample.Criteria criteria = example.createCriteria();
criteria.andOpenidEqualTo(openid);
criteria.andTargetIdEqualTo(targetId);
criteria.andTemplateIdEqualTo(templateId);
criteria.andIsValidEqualTo(true);
return disposableSubscribeRecordMapper.countByExample(example) > 0;
......
......@@ -6,8 +6,10 @@
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="openid" jdbcType="VARCHAR" property="openid" />
<result column="template_id" jdbcType="VARCHAR" property="templateId" />
<result column="target_id" jdbcType="BIGINT" property="targetId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="type" jdbcType="INTEGER" property="type" />
<result column="is_valid" jdbcType="BIT" property="isValid" />
</resultMap>
<sql id="Example_Where_Clause">
......@@ -69,7 +71,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, user_id, openid, template_id, create_time, update_time, is_valid
id, user_id, openid, template_id, target_id, create_time, update_time, `type`, is_valid
</sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.distribution.DisposableSubscribeRecordExample" resultMap="BaseResultMap">
select
......@@ -98,13 +100,14 @@
distinct
</if>
<choose>
<when test="selective != null and selective.length > 0">
<when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, user_id, openid, template_id, create_time, update_time, is_valid
id, user_id, openid, template_id, target_id, create_time, update_time, `type`, is_valid
</otherwise>
</choose>
from disposable_subscribe_record
......@@ -129,13 +132,14 @@
-->
select
<choose>
<when test="selective != null and selective.length > 0">
<when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, user_id, openid, template_id, create_time, update_time, is_valid
id, user_id, openid, template_id, target_id, create_time, update_time, `type`, is_valid
</otherwise>
</choose>
from disposable_subscribe_record
......@@ -156,11 +160,11 @@
SELECT LAST_INSERT_ID()
</selectKey>
insert into disposable_subscribe_record (user_id, openid, template_id,
create_time, update_time, is_valid
)
target_id, create_time, update_time,
`type`, is_valid)
values (#{userId,jdbcType=BIGINT}, #{openid,jdbcType=VARCHAR}, #{templateId,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{isValid,jdbcType=BIT}
)
#{targetId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{type,jdbcType=INTEGER}, #{isValid,jdbcType=BIT})
</insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.DisposableSubscribeRecord">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
......@@ -177,12 +181,18 @@
<if test="templateId != null">
template_id,
</if>
<if test="targetId != null">
target_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="type != null">
`type`,
</if>
<if test="isValid != null">
is_valid,
</if>
......@@ -197,12 +207,18 @@
<if test="templateId != null">
#{templateId,jdbcType=VARCHAR},
</if>
<if test="targetId != null">
#{targetId,jdbcType=BIGINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="type != null">
#{type,jdbcType=INTEGER},
</if>
<if test="isValid != null">
#{isValid,jdbcType=BIT},
</if>
......@@ -229,12 +245,18 @@
<if test="record.templateId != null">
template_id = #{record.templateId,jdbcType=VARCHAR},
</if>
<if test="record.targetId != null">
target_id = #{record.targetId,jdbcType=BIGINT},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.type != null">
`type` = #{record.type,jdbcType=INTEGER},
</if>
<if test="record.isValid != null">
is_valid = #{record.isValid,jdbcType=BIT},
</if>
......@@ -249,8 +271,10 @@
user_id = #{record.userId,jdbcType=BIGINT},
openid = #{record.openid,jdbcType=VARCHAR},
template_id = #{record.templateId,jdbcType=VARCHAR},
target_id = #{record.targetId,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
`type` = #{record.type,jdbcType=INTEGER},
is_valid = #{record.isValid,jdbcType=BIT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
......@@ -268,12 +292,18 @@
<if test="templateId != null">
template_id = #{templateId,jdbcType=VARCHAR},
</if>
<if test="targetId != null">
target_id = #{targetId,jdbcType=BIGINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="type != null">
`type` = #{type,jdbcType=INTEGER},
</if>
<if test="isValid != null">
is_valid = #{isValid,jdbcType=BIT},
</if>
......@@ -285,8 +315,10 @@
set user_id = #{userId,jdbcType=BIGINT},
openid = #{openid,jdbcType=VARCHAR},
template_id = #{templateId,jdbcType=VARCHAR},
target_id = #{targetId,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
`type` = #{type,jdbcType=INTEGER},
is_valid = #{isValid,jdbcType=BIT}
where id = #{id,jdbcType=INTEGER}
</update>
......@@ -317,13 +349,14 @@
select
'true' as QUERYID,
<choose>
<when test="selective != null and selective.length > 0">
<when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, user_id, openid, template_id, create_time, update_time, is_valid
id, user_id, openid, template_id, target_id, create_time, update_time, `type`, is_valid
</otherwise>
</choose>
from disposable_subscribe_record
......
......@@ -72,7 +72,7 @@
<javaClientGenerator type="XMLMAPPER" targetPackage="com.wwdz.ch.db.mapper.distribution"
targetProject="ch-dao/src/main/java"/>
<table tableName="special_performance" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<table tableName="disposable_subscribe_record" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<generatedKey column="id" sqlStatement="Mysql" identity="true" />
</table>
......
......@@ -5,6 +5,7 @@ import com.wwdz.ch.core.api.OfficialAccountApi;
import com.wwdz.ch.core.consts.OfficalAccountEnum;
import com.wwdz.ch.core.entity.ConsignSaleSubscribeMsg;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dao.DisposableSubscribeRecordDao;
import com.wwdz.ch.db.dao.UserDao;
import com.wwdz.ch.db.domain.OfficialAccountSubscribeRecord;
import com.wwdz.ch.db.domain.User;
......@@ -63,6 +64,9 @@ public class OfficialAccountCallbackController {
@Autowired
UserDao userDao;
@Autowired
DisposableSubscribeRecordDao disposableSubscribeRecordDao;
@RequestMapping(value ="/getNotice")
public Object getNotice(@RequestParam(required = false, name = "signature") String signature,
......@@ -132,7 +136,6 @@ public class OfficialAccountCallbackController {
}
} catch (Exception e) {
logger.error("微信公众号通知回调接口 error : {}", e);
......
......@@ -3,6 +3,7 @@ package com.wwdz.ch.wx.impl.distribution;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dao.DisposableSubscribeRecordDao;
import com.wwdz.ch.db.domain.distribution.DisposableSubscribeRecord;
import com.wwdz.ch.db.dto.request.distribution.DisposableSubscribeRecordRequestDto;
import com.wwdz.ch.wx.service.distribution.DisposableSubscribeRecordService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -20,16 +21,17 @@ public class DisposableSubscribeRecordServiceImpl implements DisposableSubscribe
DisposableSubscribeRecordDao disposableSubscribeRecordDao;
@Override
public Result insert(DisposableSubscribeRecord disposableSubscribeRecord) {
public Result subscribed(DisposableSubscribeRecordRequestDto dto) {
try {
Long userId = disposableSubscribeRecord.getUserId();
String openid = disposableSubscribeRecord.getOpenid();
String templateId = disposableSubscribeRecord.getTemplateId();
boolean isExisted = disposableSubscribeRecordDao.isExisted(openid, templateId);
Long userId = dto.getUserId();
String openid = dto.getOpenid();
String templateId = dto.getTemplateId();
long targetId = dto.getTargetId();
boolean isExisted = disposableSubscribeRecordDao.isExisted(openid, targetId, templateId);
DisposableSubscribeRecord disposableSubscribeRecord = new DisposableSubscribeRecord();
disposableSubscribeRecord.setIsValid(true);
//如果有历史记录,则做更新
if (isExisted) {
disposableSubscribeRecordDao.update(disposableSubscribeRecord);
} else {
if (!disposableSubscribeRecordDao.isSubscribed(openid, targetId, templateId)) {
disposableSubscribeRecordDao.insert(disposableSubscribeRecord);
}
return Result.success();
......@@ -46,12 +48,12 @@ public class DisposableSubscribeRecordServiceImpl implements DisposableSubscribe
}
@Override
public Result isExisted(String openid, String templateId) {
public Result isExisted(DisposableSubscribeRecordRequestDto dto) {
return null;
}
@Override
public Result isSubscribed(String openid, String templateId) {
public Result isSubscribed(DisposableSubscribeRecordRequestDto dto) {
return null;
}
......
......@@ -2,6 +2,7 @@ package com.wwdz.ch.wx.service.distribution;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.domain.distribution.DisposableSubscribeRecord;
import com.wwdz.ch.db.dto.request.distribution.DisposableSubscribeRecordRequestDto;
import java.util.List;
......@@ -10,13 +11,18 @@ import java.util.List;
*/
public interface DisposableSubscribeRecordService {
Result insert(DisposableSubscribeRecord disposableSubscribeRecord);
/**
* 用户订阅
* @param dto
* @return
*/
Result subscribed(DisposableSubscribeRecordRequestDto dto);
Result update(DisposableSubscribeRecord disposableSubscribeRecord);
Result isExisted(String openid, String templateId);
Result isExisted(DisposableSubscribeRecordRequestDto dto);
Result isSubscribed(String openid, String templateId);
Result isSubscribed(DisposableSubscribeRecordRequestDto dto);
List<DisposableSubscribeRecord> findList(long userId);
}
......@@ -25,8 +25,8 @@ public class LogisticsApiTest {
@Test
public void findTrails() {
LogisticsRequestDto dto = new LogisticsRequestDto();
dto.setLogisticsCode("YTO");
dto.setWaybill("YT1160805180957");
dto.setLogisticsCode("YD");
dto.setWaybill("312421269717964");
Result result = logisticsApi.findTrails(dto);
logger.info("物流轨迹: {}" + result);
}
......
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