Authored by csgyoho

no message

Showing 18 changed files with 223 additions and 373 deletions
package com.yoho.ufo.user.dal.inbox.enums;
/**
* Created by shengguo.cai on 2018/9/12.
*/
public enum InboxBusinessTypeEnum {
USER_WILL_DOWN_GRADE(Integer.valueOf(100), "userWillDownGrade", "您的会员级别即将降级", "您的{0}会员有效期即将到期!还需获得{1}成长值可继续保持!快来选购吧!", "http://img10.static.yhbimg.com/couponImg/2017/01/06/18/01bcf2f47b1f18d34293af4b2a71d9b953.png"),
USER_DOWN_GRADE(Integer.valueOf(101), "userDownGrade", "您的会员级别降级", "您的{0}等级会员有效期已到期,现会员等级为{1},购物享受{2}折优惠,更多会员权益请点击了解!", "http://img10.static.yhbimg.com/couponImg/2017/01/06/18/01bcf2f47b1f18d34293af4b2a71d9b953.png");
private Integer businessType;
private String beanName;
private String title;
private String content;
private String imgUrl;
InboxBusinessTypeEnum(Integer businessType, String beanName, String title, String content, String imgUrl) {
this.businessType = businessType;
this.beanName = beanName;
this.title = title;
this.content = content;
this.imgUrl = imgUrl;
}
public Integer getBusinessType() {
return businessType;
}
public void setBusinessType(Integer businessType) {
this.businessType = businessType;
}
public String getBeanName() {
return beanName;
}
public void setBeanName(String beanName) {
this.beanName = beanName;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getImgUrl() {
return imgUrl;
}
public void setImgUrl(String imgUrl) {
this.imgUrl = imgUrl;
}
public static String getBeanNameByBusinessType(int businessType) {
if(businessType == 0) {
return "";
}
InboxBusinessTypeEnum[] var1 = values();
int var2 = var1.length;
for(int var3 = 0; var3 < var2; ++var3) {
InboxBusinessTypeEnum b = var1[var3];
if(b.getBusinessType().intValue() == businessType) {
return b.getBeanName();
}
}
return "";
}
}
package com.yoho.ufo.user.dal.inbox;
package com.yohoufo.user.dal;
import com.yoho.ufo.user.dal.inbox.model.InBox;
import com.yoho.ufo.user.dal.inbox.model.TypeCountInbox;
import com.yohoufo.user.dal.model.InBox;
import com.yohoufo.user.dal.model.TypeCountInbox;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
... ...
package com.yohoufo.user.dal.enums;
/**
* Created by shengguo.cai on 2018/9/12.
*/
public enum InboxBusinessTypeEnum {
PURCHASE_UNPAID(0,0, "未付款提醒", "请尽快完成订单支付"),
PURCHASE_NOTIFIED_SELLER(0,1, "已通知卖家发货", "已通知卖家发货,请耐心等待"),
PURCHASE_SENDED(0,2, "平台已发货", "平台已发货,请查看物流详情"),
PURCHASE_CLOSED_SELLER(0,3, "交易关闭", "卖家取消:卖家取消商品出售,你已获得卖补偿款,请至有货账户查收"),
PURCHASE_CLOSED_BUYER(0,4, "交易关闭", "买家取消:您已取消商品购买"),
PURCHASE_CLOSED_PLATFORM(0,5, "交易关闭", "鉴定不通过:您购买的商品鉴定未通过,你已获得卖补偿款,请至有货账户查收"),
SALE_SHELF(1,0, "上架成功", "商品上架成功"),
SALE_UNSHELF(1,1, "下架成功", "商品下架成功"),
SALE_SELLED(1,2, "商品售出提醒", "你的商品已被下单,请关注发货提醒"),
SALE_SEND(1,3, "发货提醒", "买家已付款,请尽快完成发货,否则会扣除部分保证金"),
SALE_CLOSED_SELLER(1,4, "交易关闭", "卖家取消:您已取消商品出售,您支付的保证金作已为补偿赔付给买家"),
SALE_CLOSED_BUYER(1,5, "交易关闭", "买家取消:买家取消订单,您的商品已重新上架出售"),
SALE_CLOSED_PLATFORM(1,6, "交易关闭", "鉴定不通过:您出售的商品鉴定未通过,商品已寄回您提供的守护地址,您支付的保证金已作为补偿赔付给买家"),
SALE_NOTIFIED_UNSHELF(1,7, "商品下架提醒", "因为特殊原因,商品不能售卖,您支付的保证金已退回,请至有货账户查收"),
SYSTEM_NEWUSER(2,0, "新用户引导", "欢迎使用UFO,详情使用说明请点击"),
SYSTEM_VERIFED(2,1, "实名认证提醒", "请尽快完成实名认证,详情请点击"),
SYSTEM_BINDBANK(2,2, "绑定银行卡提醒", "请尽快绑定银行卡,详情请点击"),
SMS_SEND(3,0, "发货提醒", "买家已付款,请尽快完成发货,否则会扣除部分保证金");
private Integer businessType;
private String title;
private String content;
private Integer type;
InboxBusinessTypeEnum(Integer type, Integer businessType, String title, String content) {
this.businessType = businessType;
this.title = title;
this.content = content;
this.type = type;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Integer getBusinessType() {
return businessType;
}
public void setBusinessType(Integer businessType) {
this.businessType = businessType;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
}
... ...
package com.yoho.ufo.user.dal.inbox.enums;
package com.yohoufo.user.dal.enums;
/**
* Created by shengguo.cai on 2018/9/12.
... ...
package com.yoho.ufo.user.dal.inbox.model;
import java.util.List;
package com.yohoufo.user.dal.model;
/**
* Created by shengguo.cai on 2018/9/11.
... ... @@ -34,8 +32,6 @@ public class InBox {
private String tableName;
private List<Integer> ids;
private Integer businessType;
private Integer groupType;
... ... @@ -136,14 +132,6 @@ public class InBox {
this.tableName = tableName;
}
public List<Integer> getIds() {
return ids;
}
public void setIds(List<Integer> ids) {
this.ids = ids;
}
public Integer getBusinessType() {
return businessType;
}
... ...
package com.yoho.ufo.user.dal.inbox.model;
package com.yohoufo.user.dal.model;
/**
* Created by shengguo.cai on 2018/9/11.
... ...
<?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.yoho.ufo.user.dal.inbox.InBoxMapper">
<resultMap id="BaseResultMap" type="com.yoho.ufo.user.dal.inbox.model.InBox">
<mapper namespace="com.yohoufo.user.dal.InBoxMapper">
<resultMap id="BaseResultMap" type="com.yohoufo.user.dal.model.InBox">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="uid" property="uid" jdbcType="INTEGER"/>
<result column="send_uid" property="sendUid" jdbcType="INTEGER"/>
... ... @@ -16,7 +16,7 @@
<result column="business_type" property="businessType" jdbcType="INTEGER" />
<result column="group_type" property="groupType" jdbcType="INTEGER"/>
</resultMap>
<resultMap id="TypeCountInboxMap" type="com.yoho.ufo.user.dal.inbox.model.TypeCountInbox">
<resultMap id="TypeCountInboxMap" type="com.yohoufo.user.dal.model.TypeCountInbox">
<result column="type" property="type" jdbcType="INTEGER"/>
<result column="count" property="count" jdbcType="INTEGER"/>
</resultMap>
... ... @@ -39,7 +39,7 @@
SELECT type, count(1) count FROM #{tableName} WHERE uid = #{uid}
and is_read = #{isRead} and is_del = #{isDel} GROUP BY type
</select>
<select id="selectNewInboxs" resultType="com.yoho.ufo.user.dal.inbox.model.InBox">
<select id="selectNewInboxs" resultType="com.yohoufo.user.dal.model.InBox">
SELECT
<include refid="Base_Column_List"/>
FROM #{tableName} where uid = #{uid} and is_read='N' and is_del='N'
... ...
package com.yoho.ufo.user.responseVO;
/**
* Created by shengguo.cai on 2018/9/12.
*/
public class InboxDetailRespVO {
private int id;
private int uid;
private String from = "有货";
private String title;
private Object body;
private String type;
private String is_read;
private long create_time;
private String create_date;
private String content;
private Integer businessType;
private String pcLink;
private String appLink;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getUid() {
return uid;
}
public void setUid(int uid) {
this.uid = uid;
}
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Object getBody() {
return body;
}
public void setBody(Object body) {
this.body = body;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getIs_read() {
return is_read;
}
public void setIs_read(String is_read) {
this.is_read = is_read;
}
public long getCreate_time() {
return create_time;
}
public void setCreate_time(long create_time) {
this.create_time = create_time;
}
public String getCreate_date() {
return create_date;
}
public void setCreate_date(String create_date) {
this.create_date = create_date;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Integer getBusinessType() {
return businessType;
}
public void setBusinessType(Integer businessType) {
this.businessType = businessType;
}
public String getPcLink() {
return pcLink;
}
public void setPcLink(String pcLink) {
this.pcLink = pcLink;
}
public String getAppLink() {
return appLink;
}
public void setAppLink(String appLink) {
this.appLink = appLink;
}
}
package com.yoho.ufo.user.controller.inbox;
package com.yohoufo.user.controller.inbox;
import com.alibaba.fastjson.JSONArray;
import com.yoho.core.common.restbean.ResponseBean;
import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yoho.ufo.user.requestVO.InboxReqVO;
import com.yoho.ufo.user.requestVO.ListInboxTypeInfoReqVO;
import com.yoho.ufo.user.requestVO.ListNewInboxReqVO;
import com.yoho.ufo.user.responseVO.InboxDetailRespVO;
import com.yoho.ufo.user.responseVO.PageResponseVO;
import com.yoho.ufo.user.service.IInBoxService;
import com.yohoufo.user.dal.model.InBox;
import com.yohoufo.user.requestVO.InboxReqVO;
import com.yohoufo.user.requestVO.ListInboxTypeInfoReqVO;
import com.yohoufo.user.requestVO.ListNewInboxReqVO;
import com.yohoufo.user.requestVO.UpdateReadedReqVO;
import com.yohoufo.user.responseVO.PageResponseVO;
import com.yohoufo.user.service.IInBoxService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestBody;
... ... @@ -61,7 +62,7 @@ public class InBoxController {
public ResponseBean listNewInboxs(@RequestBody ListNewInboxReqVO reqVO){
logger.info("enter listNewInboxByTypes param is {}", reqVO);
ResponseBean responseBean = new ResponseBean();
PageResponseVO<InboxDetailRespVO> pageList = inBoxService.listNewInboxByTypes(reqVO);
PageResponseVO<InBox> pageList = inBoxService.listNewInboxByTypes(reqVO);
responseBean.setCode("200");
responseBean.setMessage("success");
responseBean.setData(pageList);
... ... @@ -83,15 +84,17 @@ public class InBoxController {
}
/**
* 删除消息
* 将某类型下的未读消息更新为已读
* @param reqVO
* @return
*/
@RequestMapping("/delInbox")
public ResponseBean delInbox(@RequestBody InboxReqVO reqVO){
logger.info("addInbox with param is {}", reqVO);
inBoxService.addInbox(reqVO);
@RequestMapping("/updateReadedByType")
public ResponseBean updateReadedByType(@RequestBody UpdateReadedReqVO reqVO){
logger.info("updateReadedByType with param is {}", reqVO);
inBoxService.updateReadedByType(reqVO);
ResponseBean responseBean = new ResponseBean();
responseBean.setCode("200");
responseBean.setMessage("保存成功");
responseBean.setMessage("更新成功");
return responseBean;
}
}
... ...
package com.yohoufo.user.requestVO;
/**
* Created by shengguo.cai on 2018/9/12.
*/
public class InboxReqVO {
private int uid;
private String type;
private Integer businessType;
public int getUid() {
return uid;
}
public void setUid(int uid) {
this.uid = uid;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Integer getBusinessType() {
return businessType;
}
public void setBusinessType(Integer businessType) {
this.businessType = businessType;
}
}
... ...
package com.yoho.ufo.user.requestVO;
package com.yohoufo.user.requestVO;
/**
* Created by shengguo.cai on 2018/9/11.
... ...
package com.yoho.ufo.user.requestVO;
package com.yohoufo.user.requestVO;
/**
* Created by shengguo.cai on 2018/9/12.
... ...
package com.yoho.ufo.user.requestVO;
package com.yohoufo.user.requestVO;
/**
* Created by shengguo.cai on 2018/9/12.
... ... @@ -12,7 +12,7 @@ public class PageReqVO {
}
public void setLimit(int limit) {
this.limit = limit<1 ? 1 : limit;
this.limit = limit<10 ? 1 : limit;
}
public int getPage() {
... ...
package com.yohoufo.user.requestVO;
/**
* Created by shengguo.cai on 2018/9/13.
*/
public class UpdateReadedReqVO {
private int uid;
private int type;
public int getUid() {
return uid;
}
public void setUid(int uid) {
this.uid = uid;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
}
... ...
package com.yoho.ufo.user.requestVO;
package com.yohoufo.user.responseVO;
/**
* Created by shengguo.cai on 2018/9/12.
*/
public class InboxReqVO {
public class InboxDetailRespVO {
private int id;
private int uid;
private String couponName;
private String client_type;
private String app_version;
private String isRead;
private String title;
private String content;
private String type;
private Integer verifyKey;
private Integer sendUid;
private Integer businessType=400;
public int getUid() {
return uid;
}
public void setUid(int uid) {
this.uid = uid;
}
private String isRead;
private int createTime;
private String content;
private Integer businessType;
public String getCouponName() {
return couponName;
public String getIsRead() {
return isRead;
}
public void setCouponName(String couponName) {
this.couponName = couponName;
public void setIsRead(String isRead) {
this.isRead = isRead;
}
public String getClient_type() {
return client_type;
public int getCreateTime() {
return createTime;
}
public void setClient_type(String client_type) {
this.client_type = client_type;
public void setCreateTime(int createTime) {
this.createTime = createTime;
}
public String getApp_version() {
return app_version;
public int getId() {
return id;
}
public void setApp_version(String app_version) {
this.app_version = app_version;
public void setId(int id) {
this.id = id;
}
public String getIsRead() {
return isRead;
public int getUid() {
return uid;
}
public void setIsRead(String isRead) {
this.isRead = isRead;
public void setUid(int uid) {
this.uid = uid;
}
public String getTitle() {
... ... @@ -64,14 +53,6 @@ public class InboxReqVO {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getType() {
return type;
}
... ... @@ -80,20 +61,12 @@ public class InboxReqVO {
this.type = type;
}
public Integer getVerifyKey() {
return verifyKey;
}
public void setVerifyKey(Integer verifyKey) {
this.verifyKey = verifyKey;
}
public Integer getSendUid() {
return sendUid;
public String getContent() {
return content;
}
public void setSendUid(Integer sendUid) {
this.sendUid = sendUid;
public void setContent(String content) {
this.content = content;
}
public Integer getBusinessType() {
... ... @@ -103,4 +76,5 @@ public class InboxReqVO {
public void setBusinessType(Integer businessType) {
this.businessType = businessType;
}
}
... ...
package com.yoho.ufo.user.responseVO;
package com.yohoufo.user.responseVO;
import java.util.List;
... ...
package com.yoho.ufo.user.service;
package com.yohoufo.user.service;
import com.alibaba.fastjson.JSONArray;
import com.yoho.ufo.user.requestVO.InboxReqVO;
import com.yoho.ufo.user.requestVO.ListInboxTypeInfoReqVO;
import com.yoho.ufo.user.requestVO.ListNewInboxReqVO;
import com.yoho.ufo.user.responseVO.InboxDetailRespVO;
import com.yoho.ufo.user.responseVO.PageResponseVO;
import com.yohoufo.user.dal.model.InBox;
import com.yohoufo.user.requestVO.InboxReqVO;
import com.yohoufo.user.requestVO.ListInboxTypeInfoReqVO;
import com.yohoufo.user.requestVO.ListNewInboxReqVO;
import com.yohoufo.user.requestVO.UpdateReadedReqVO;
import com.yohoufo.user.responseVO.PageResponseVO;
/**
* Created by shengguo.cai on 2018/9/11.
... ... @@ -18,7 +19,9 @@ public interface IInBoxService {
*/
JSONArray listInboxTypeInfo(ListInboxTypeInfoReqVO reqBO);
PageResponseVO<InboxDetailRespVO> listNewInboxByTypes(ListNewInboxReqVO reqVO);
PageResponseVO<InBox> listNewInboxByTypes(ListNewInboxReqVO reqVO);
void addInbox(InboxReqVO reqVO);
void updateReadedByType(UpdateReadedReqVO reqVO);
}
... ...
package com.yoho.ufo.user.service.impl;
package com.yohoufo.user.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yoho.core.common.utils.DateUtil;
import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yoho.ufo.user.dal.inbox.InBoxMapper;
import com.yoho.ufo.user.dal.inbox.enums.InboxTypeEnum;
import com.yoho.ufo.user.dal.inbox.model.InBox;
import com.yoho.ufo.user.dal.inbox.model.TypeCountInbox;
import com.yoho.ufo.user.requestVO.InboxReqVO;
import com.yoho.ufo.user.requestVO.ListInboxTypeInfoReqVO;
import com.yoho.ufo.user.requestVO.ListNewInboxReqVO;
import com.yoho.ufo.user.responseVO.InboxDetailRespVO;
import com.yoho.ufo.user.responseVO.PageResponseVO;
import com.yoho.ufo.user.service.IInBoxService;
import com.yohoufo.user.dal.InBoxMapper;
import com.yohoufo.user.dal.enums.InboxTypeEnum;
import com.yohoufo.user.dal.model.InBox;
import com.yohoufo.user.dal.model.TypeCountInbox;
import com.yohoufo.user.requestVO.InboxReqVO;
import com.yohoufo.user.requestVO.ListInboxTypeInfoReqVO;
import com.yohoufo.user.requestVO.ListNewInboxReqVO;
import com.yohoufo.user.requestVO.UpdateReadedReqVO;
import com.yohoufo.user.responseVO.PageResponseVO;
import com.yohoufo.user.service.IInBoxService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
... ... @@ -42,8 +40,8 @@ public class InBoxServiceImpl implements IInBoxService {
JSONArray result = new JSONArray();
for(InboxTypeEnum typeEnum : InboxTypeEnum.values()) {
JSONObject obj = new JSONObject();
obj.put("id", typeEnum.getId());
obj.put("img_url", typeEnum.getImgUrl());
obj.put("type", typeEnum.getId());
obj.put("imgUrl", typeEnum.getImgUrl());
obj.put("description", typeEnum.getDescription());
obj.put("unReadCount", typeCountMap.containsKey(typeEnum.getId()) ? typeCountMap.get(typeEnum.getId()) : 0);
result.add(obj);
... ... @@ -52,14 +50,14 @@ public class InBoxServiceImpl implements IInBoxService {
}
@Override
public PageResponseVO<InboxDetailRespVO> listNewInboxByTypes(ListNewInboxReqVO reqVO) {
public PageResponseVO<InBox> listNewInboxByTypes(ListNewInboxReqVO reqVO) {
log.info("entre listNewInboxByTypes with param is {}", reqVO);
//判断为空
if (reqVO.getUid() <= 0) {
log.warn("listNewInboxByTypes error because uid is null with param is {}", reqVO);
throw new ServiceException(ServiceError.SMS_INBOX_UID_NULL);
}
PageResponseVO<InboxDetailRespVO> response = new PageResponseVO<>();
PageResponseVO<InBox> response = new PageResponseVO<>();
int total = inBoxMapper.selectTotalNewInboxs(getTableName(reqVO.getUid()),reqVO.getType(),
reqVO.getUid());
... ... @@ -69,15 +67,10 @@ public class InBoxServiceImpl implements IInBoxService {
response.setTotal(0);
return response;
}
List<InBox> list = inBoxMapper.selectNewInboxs(getTableName(reqVO.getUid()),reqVO.getType(),
List<InBox> inBoxes = inBoxMapper.selectNewInboxs(getTableName(reqVO.getUid()),reqVO.getType(),
reqVO.getUid(),reqVO.getRowNo(),reqVO.getLimit());
List<InboxDetailRespVO> inboxDetailRespVOList = initInboxDetails(list);
// 将当前分类下用户所有的未读消息置为已读
if(null!=reqVO.getType()){
inBoxMapper.updateReadedByUidAndType(getTableName(reqVO.getUid()),reqVO.getUid(),reqVO.getType(),DateUtil.getCurrentTimeSecond());
}
response.setList(inboxDetailRespVOList);
response.setList(inBoxes);
response.setPage(reqVO.getPage());
response.setSize(reqVO.getLimit());
response.setTotal(total);
... ... @@ -88,8 +81,7 @@ public class InBoxServiceImpl implements IInBoxService {
public void addInbox(InboxReqVO reqVO) {
InBox inBox = new InBox();
inBox.setUid(reqVO.getUid());
inBox.setSendUid(reqVO.getSendUid());
inBox.setType(reqVO.getBusinessType() / 100);
inBox.setType(reqVO.getBusinessType());
inBox.setIsRead("N");
inBox.setIsDel("N");
inBox.setTitle(reqVO.getTitle());
... ... @@ -100,50 +92,13 @@ public class InBoxServiceImpl implements IInBoxService {
inBoxMapper.insertInbox(getTableName(inBox.getUid()),inBox);
}
private List<InboxDetailRespVO> initInboxDetails(List<InBox> inBoxList){
List<InboxDetailRespVO> inboxDetailRespVOList = new ArrayList<>();
InboxDetailRespVO resp = null;
String date = "";
//取当天的年月日的时间毫秒数
long now = DateUtil.stringToDate(DateUtil.long2DateStr(new Date().getTime(), DateUtil.DATE_FORMAT), DateUtil.DATE_FORMAT).getTime();
String lastDate = DateUtil.dateAdd(DateUtil.getcurrentDate(), "d", -1, DateUtil.DATE_FORMAT);
for (InBox box : inBoxList) {
// 校验消息业务类型
if (box.getBusinessType() == null) {
log.warn("initInboxDetails inbox BusinessType is null. with box={}", box);
continue;
}
date = DateUtil.long2DateStr((long) box.getCreateTime() * 1000, DateUtil.DATE_TIME_FORMAT);
if (box.getCreateTime() * 1000 >= now) {
date = "今天" + DateUtil.dateToString(DateUtil.long2Date(box.getCreateTime() * 1000), "HH:mm");
} else if (box.getCreateTime() * 1000 > DateUtil.stringToDate(lastDate, DateUtil.DATE_FORMAT).getTime()) {
date = "昨天" + DateUtil.dateToString(DateUtil.long2Date(box.getCreateTime() * 1000), "HH:mm");
}
resp = new InboxDetailRespVO();
resp.setContent(box.getContent());
resp.setId(box.getId());
resp.setUid(box.getUid());
resp.setTitle(box.getTitle());
resp.setBusinessType(box.getBusinessType());
if (box.getBusinessType() != null && box.getBusinessType() > 0) {
// final String beanName = InboxBusinessTypeEnum.getBeanNameByBusinessType(box.getBusinessType());
// IInBoxBusinessService service = SpringContextUtil.getBean(beanName, IInBoxBusinessService.class);
// Map<String, Object> map = service.getMessage(box);
// String imgUrl = BusinessTypeEnum.getImgUrlByBusinessType(box.getBusinessType());
// resp.setBody(map);
} else {
continue;
}
// Map<String, String> urlMap = InboxJumpUrlHelper.getJumpUrl(box, resp.getBody());
// resp.setPcLink(StringUtils.isNotEmpty(urlMap.get("pc_link")) ? urlMap.get("pc_link") : "");
// resp.setAppLink(StringUtils.isNotEmpty(urlMap.get("app_link")) ? urlMap.get("app_link") : "");
resp.setIs_read(box.getIsRead());
resp.setCreate_time(box.getCreateTime());
resp.setCreate_date(date);
resp.setType(String.valueOf(box.getType()));
inboxDetailRespVOList.add(resp);
@Override
public void updateReadedByType(UpdateReadedReqVO reqVO) {
if (reqVO.getUid() < 1) {
log.warn("updateReadedByType error because uid is null with param is {}", reqVO);
throw new ServiceException(ServiceError.SMS_INBOX_UID_NULL);
}
return inboxDetailRespVOList;
inBoxMapper.updateReadedByUidAndType(getTableName(reqVO.getUid()),reqVO.getUid(),reqVO.getType(),DateUtil.getCurrentTimeSecond());
}
private String getTableName(Integer uid) {
... ...