From 0006e8191433861138eabdce4d27e4cacea36d5b Mon Sep 17 00:00:00 2001 From: gongbiao Date: Tue, 4 Jun 2019 17:46:20 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=A3=E4=BC=A0=E6=B4=BB=E5=8A=A8=E6=8A=A5?= =?UTF-8?q?=E5=90=8D][=E4=BF=AE=E6=94=B9][=E5=88=A0=E9=99=A4=E4=B8=8D?= =?UTF-8?q?=E9=9C=80=E8=A6=81wx=5Factivity=E8=A1=A8=E5=8F=8A=E5=AE=9E?= =?UTF-8?q?=E4=BD=93]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../V201906041745__ALTER_ACTIVITY_TABLE.sql | 1 + .../com/iformall/domain/po/WxActivity.java | 138 ------------------ 2 files changed, 1 insertion(+), 138 deletions(-) create mode 100644 mallinkAdmin/src/main/resources/db/migration/V201906041745__ALTER_ACTIVITY_TABLE.sql delete mode 100644 mallinkService/src/main/java/com/iformall/domain/po/WxActivity.java diff --git a/mallinkAdmin/src/main/resources/db/migration/V201906041745__ALTER_ACTIVITY_TABLE.sql b/mallinkAdmin/src/main/resources/db/migration/V201906041745__ALTER_ACTIVITY_TABLE.sql new file mode 100644 index 000000000..51952d1ce --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V201906041745__ALTER_ACTIVITY_TABLE.sql @@ -0,0 +1 @@ +drop table if exists `wx_activity`; \ No newline at end of file diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxActivity.java b/mallinkService/src/main/java/com/iformall/domain/po/WxActivity.java deleted file mode 100644 index 451df0ba8..000000000 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxActivity.java +++ /dev/null @@ -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 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 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)); - } - } -}