yujian
2019-01-22 88b54772dbcf5ecab1e2316e4e4626ac901b8908
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
package com.yeshi.fanli.entity.bus.recommend;
 
import java.math.BigDecimal;
import java.util.HashSet;
import java.util.Set;
 
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;
 
import com.google.gson.annotations.Expose;
import com.yeshi.fanli.entity.bus.user.UserInfo;
@Entity
@Table(name="yeshi_ec_dynamic_recommend")
public class DynamicRecommend {
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    @Column(name="`id`")
    @Expose
    private long id;
    @JoinColumn(name="`uid`")
    @ManyToOne(fetch = FetchType.EAGER)
    @Expose
    private UserInfo userInfo; //推荐�?
    @Expose
    @Column(name="`uPicUrl`",length=1024)
    private String uPicUrl; //用户选择的图�?
//    @Transient
    @Expose
    private String gPicUrl; //商品本身的图�?
//    @Transient
    @Expose
    private String gname; //商品名称
//    @Transient
    @Expose
    private BigDecimal zkPrice; //价格
//    @Transient
    @Expose
    private BigDecimal hongbao; //红包
    @Column(name="`reason`",length=1024)
    @Expose
    private String reason; //推荐理由
    @Column(name="`url`",length=1024)
    @Expose
    private String url; //商品URL
    @Expose
    private long createtime;
    @Expose
    private int goodsType; //商品类型 1:淘宝 2:天猫
    @Expose
    private int likeCount;
    @Expose
    private int replyCount;
    @Expose
    private String auctionId; //商品id
    @OneToMany(fetch=FetchType.EAGER,mappedBy="dynamicRecommend",cascade=CascadeType.ALL)
    private Set<RecommendLike> likers = new HashSet<RecommendLike>();
    @Expose
    @Transient
    private boolean islike;
    
    private int type;  //0:用户发布  1:后台虚拟发布
    
    public DynamicRecommend() {
        // TODO Auto-generated constructor stub
    }
    public DynamicRecommend(long id) {
        super();
        this.id = id;
    }
    public long getId() {
        return id;
    }
    public void setId(long id) {
        this.id = id;
    }
    
    public int getType() {
        return type;
    }
    public void setType(int type) {
        this.type = type;
    }
    public Set<RecommendLike> getLikers() {
        return likers;
    }
    public void setLikers(Set<RecommendLike> likers) {
        this.likers = likers;
    }
    public boolean isIslike() {
        return islike;
    }
    public void setIslike(boolean islike) {
        this.islike = islike;
    }
    public String getAuctionId() {
        return auctionId;
    }
    public void setAuctionId(String auctionId) {
        this.auctionId = auctionId;
    }
    public int getReplyCount() {
        return replyCount;
    }
    public void setReplyCount(int replyCount) {
        this.replyCount = replyCount;
    }
    public int getLikeCount() {
        return likeCount;
    }
    public void setLikeCount(int likeCount) {
        this.likeCount = likeCount;
    }
    public int getGoodsType() {
        return goodsType;
    }
    public void setGoodsType(int goodsType) {
        this.goodsType = goodsType;
    }
    public long getCreatetime() {
        return createtime;
    }
    public void setCreatetime(long createtime) {
        this.createtime = createtime;
    }
    public UserInfo getUserInfo() {
        return userInfo;
    }
    public void setUserInfo(UserInfo userInfo) {
        this.userInfo = userInfo;
    }
    public String getuPicUrl() {
        return uPicUrl;
    }
    public void setuPicUrl(String uPicUrl) {
        this.uPicUrl = uPicUrl;
    }
    public String getgPicUrl() {
        return gPicUrl;
    }
    public void setgPicUrl(String gPicUrl) {
        this.gPicUrl = gPicUrl;
    }
    public String getGname() {
        return gname;
    }
    public void setGname(String gname) {
        this.gname = gname;
    }
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    public BigDecimal getZkPrice() {
        return zkPrice;
    }
    public void setZkPrice(BigDecimal zkPrice) {
        this.zkPrice = zkPrice;
    }
    public BigDecimal getHongbao() {
        return hongbao;
    }
    public void setHongbao(BigDecimal hongbao) {
        this.hongbao = hongbao;
    }
    public String getReason() {
        return reason;
    }
    public void setReason(String reason) {
        this.reason = reason;
    }
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + (int) (id ^ (id >>> 32));
        return result;
    }
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        DynamicRecommend other = (DynamicRecommend) obj;
        if (id != other.id)
            return false;
        return true;
    }
}