admin
2019-07-11 24739c7e321adca7729754cbd882f417f1b87d24
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package com.yeshi.fanli.util.factory.msg;
 
import java.util.Date;
 
import com.yeshi.fanli.dto.msg.MsgOtherCouponContentDTO;
import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail;
import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum;
import com.yeshi.fanli.entity.bus.user.UserInfo;
 
public class MsgOtherDetailFactory {
 
    /**
     * 券相关信息的通知
     * 
     * @param uid
     * @param content
     * @param type
     * @param beiZhu
     * @return
     */
    public static MsgOtherDetail createCouponMsg(Long uid, Long userCouponId, MsgOtherCouponContentDTO content,
            MsgTypeOtherTypeEnum type, String beiZhu) {
        if (uid == null)
            return null;
        MsgOtherDetail detail = new MsgOtherDetail();
        detail.setBeiZhu(beiZhu);
        detail.setCreateTime(new Date());
        detail.setRead(false);
        detail.setUser(new UserInfo(uid));
        detail.setCoupnContent(content);
        detail.setType(type);
        detail.setSourceId(userCouponId);
        return detail;
    }
    
    /**
     * 券相关信息的通知
     * 
     * @param uid
     * @param content
     * @param type
     * @param beiZhu
     * @return
     */
    public static MsgOtherDetail createTaoLiJinMsg(Long uid, Long userCouponId, MsgOtherCouponContentDTO content,
            MsgTypeOtherTypeEnum type, String beiZhu) {
        if (uid == null)
            return null;
        MsgOtherDetail detail = new MsgOtherDetail();
        detail.setBeiZhu(beiZhu);
        detail.setCreateTime(new Date());
        detail.setRead(false);
        detail.setUser(new UserInfo(uid));
        detail.setCoupnContent(content);
        detail.setType(type);
        detail.setSourceId(userCouponId);
        return detail;
    }
 
}