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;
|
}
|
}
|