|
|
|
@@ -1,138 +0,0 @@ |
|
|
|
package com.iformall.domain.po; |
|
|
|
|
|
|
|
import lombok.Data; |
|
|
|
import lombok.EqualsAndHashCode; |
|
|
|
import lombok.ToString; |
|
|
|
|
|
|
|
import javax.persistence.Id; |
|
|
|
import javax.persistence.Table; |
|
|
|
import javax.persistence.Transient; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
@Table(name = "wx_activity") |
|
|
|
@Data |
|
|
|
@ToString(callSuper = true) |
|
|
|
@EqualsAndHashCode(callSuper = true) |
|
|
|
public class WxActivity extends BaseEntity { |
|
|
|
|
|
|
|
@Id |
|
|
|
protected Long id; |
|
|
|
|
|
|
|
@Transient |
|
|
|
protected List<Long> ids; |
|
|
|
@Transient |
|
|
|
protected String sortColumns; |
|
|
|
|
|
|
|
@Override |
|
|
|
public String getSortColumns() { |
|
|
|
super.setSortColumns(this.sortColumns); |
|
|
|
return super.getSortColumns(); |
|
|
|
} |
|
|
|
|
|
|
|
@io.swagger.annotations.ApiModelProperty(value = "", name = "tenantId") |
|
|
|
private String tenantId; |
|
|
|
@io.swagger.annotations.ApiModelProperty(value = "封面图", name = "coverImg") |
|
|
|
private String coverImg; |
|
|
|
@io.swagger.annotations.ApiModelProperty(value = "主标题", name = "title") |
|
|
|
private String title; |
|
|
|
@io.swagger.annotations.ApiModelProperty(value = "副标题", name = "subTitle") |
|
|
|
private String subTitle; |
|
|
|
@io.swagger.annotations.ApiModelProperty(value = "使用积分1是0否", name = "useCredit") |
|
|
|
private Integer useCredit; |
|
|
|
@io.swagger.annotations.ApiModelProperty(value = "消耗积分", name = "credit") |
|
|
|
private Integer credit; |
|
|
|
@io.swagger.annotations.ApiModelProperty(value = "活动人数", name = "personLimit") |
|
|
|
private Integer personLimit; |
|
|
|
@io.swagger.annotations.ApiModelProperty(value = "活动正文", name = "detail") |
|
|
|
private String detail; |
|
|
|
@io.swagger.annotations.ApiModelProperty(value = "活动开始显示时间", name = "startTime") |
|
|
|
private Date startTime; |
|
|
|
@io.swagger.annotations.ApiModelProperty(value = "活动结束显示时间", name = "endTime") |
|
|
|
private Date endTime; |
|
|
|
@io.swagger.annotations.ApiModelProperty(value = "类型 1固定格式2自由图文", name = "type") |
|
|
|
private Integer type; |
|
|
|
@io.swagger.annotations.ApiModelProperty(value = "0上线 1下线", name = "status") |
|
|
|
private Integer status; |
|
|
|
@io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createTime") |
|
|
|
private Date createTime; |
|
|
|
@io.swagger.annotations.ApiModelProperty(value = "更新时间", name = "updateTime") |
|
|
|
private Date updateTime; |
|
|
|
@io.swagger.annotations.ApiModelProperty(value = "富文本", name = "html") |
|
|
|
private String html; |
|
|
|
|
|
|
|
@Transient |
|
|
|
@io.swagger.annotations.ApiModelProperty(value = "小程序路径", name = "weappPath") |
|
|
|
protected String weappPath; |
|
|
|
|
|
|
|
@Transient |
|
|
|
@io.swagger.annotations.ApiModelProperty(value = "小程序二维码Scene", name = "weappScene") |
|
|
|
protected String weappScene; |
|
|
|
|
|
|
|
public String getWeappPath() { |
|
|
|
if (type == null) |
|
|
|
return "pages/index/index"; |
|
|
|
return "pages/index/index?type=bd&bt=" + type + "&id=" + id; |
|
|
|
} |
|
|
|
|
|
|
|
public String getWeappScene() { |
|
|
|
if (type == null) |
|
|
|
return ""; |
|
|
|
return "t:bd:" + type + ":" + id; |
|
|
|
} |
|
|
|
|
|
|
|
public static enum Field { |
|
|
|
Id_ASC("`id` ASC"), Id_DESC("`id` DESC"), TenantId_ASC("`tenant_id` ASC"), TenantId_DESC("`tenant_id` DESC"), CoverImg_ASC("`cover_img` ASC"), CoverImg_DESC("`cover_img` DESC"), Title_ASC("`title` ASC"), Title_DESC("`title` DESC"), SubTitle_ASC("`sub_title` ASC"), SubTitle_DESC("`sub_title` DESC"), StartTime_ASC("`start_time` ASC"), StartTime_DESC("`start_time` DESC"), EndTime_ASC("`end_time` ASC"), EndTime_DESC("`end_time` DESC"), Type_ASC("`type` ASC"), Type_DESC("`type` DESC"), Status_ASC("`status` ASC"), Status_DESC("`status` DESC"), ActivityTime_ASC("`activity_time` ASC"), ActivityTime_DESC("`activity_time` DESC"), CreateTime_ASC("`create_time` ASC"), CreateTime_DESC("`create_time` DESC"), UpdateTime_ASC("`update_time` ASC"), UpdateTime_DESC("`update_time` DESC"); |
|
|
|
private String value; |
|
|
|
|
|
|
|
Field(String value) { |
|
|
|
this.value = value; |
|
|
|
} |
|
|
|
|
|
|
|
public String getValue() { |
|
|
|
return value; |
|
|
|
} |
|
|
|
|
|
|
|
public void setCol(String value) { |
|
|
|
this.value = value; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public String toString() { |
|
|
|
return this.getValue(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void setSortColumns(WxActivity.Field... fields) { |
|
|
|
if (fields == null || fields.length == 0) { |
|
|
|
return; |
|
|
|
} |
|
|
|
for (int k = 0; k < fields.length; k++) { |
|
|
|
if (fields[k] == null) { |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
StringBuilder sb = new StringBuilder(fields[0].toString()); |
|
|
|
for (int k = 1; k < fields.length; k++) { |
|
|
|
sb.append(","); |
|
|
|
sb.append(fields[k].toString()); |
|
|
|
} |
|
|
|
this.sortColumns = sb.toString(); |
|
|
|
} |
|
|
|
|
|
|
|
public void setSortColumns(String sortColumns) { |
|
|
|
if (sortColumns == null || "".equals(sortColumns.trim())) { |
|
|
|
return; |
|
|
|
} |
|
|
|
if (sortColumns.contains(",")) { |
|
|
|
String[] cols = sortColumns.split(","); |
|
|
|
List<Field> fList = new java.util.ArrayList(); |
|
|
|
for (int k = 0; k < cols.length; k++) { |
|
|
|
fList.add(Field.valueOf(cols[k])); |
|
|
|
} |
|
|
|
this.setSortColumns(fList.toArray(new Field[fList.size()])); |
|
|
|
} else { |
|
|
|
this.setSortColumns(Field.valueOf(sortColumns)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |