| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285 |
- package com.goafanti.common.model;
- import java.util.Date;
- import org.apache.commons.lang3.time.DateFormatUtils;
- import com.fasterxml.jackson.annotation.JsonFormat;
- import com.fasterxml.jackson.annotation.JsonFormat.Shape;
- import com.goafanti.common.constant.AFTConstants;
- import com.goafanti.common.enums.ActivityStatus;
- import com.fasterxml.jackson.annotation.JsonIgnore;
- public class Activity {
- private Long id;
- /**
- * 开始时间
- */
- private Date startTime;
- /**
- * 结束时间
- */
- private Date endTime;
- /**
- * 标题
- */
- private String name;
- /**
- * 状态
- */
- private Integer status;
- /**
- * 活动地址
- */
- private String address;
- /**
- * 主办单位
- */
- private String host;
- /**
- * 承办单位
- */
- private String undertake;
- /**
- * 协办单位,逗号隔开
- */
- private String asist;
- /**
- * 活动类型
- */
- private Integer type;
- /**
- * 活动形式
- */
- private Integer form;
- /**
- * 活动图片地址
- */
- private String imgUrls;
- /**
- * 活动结果描述
- */
- private String result;
- /**
- * 创建时间(报名开始时间)
- */
- private Date createTime;
- /**
- * 报名截止时间
- */
- private Date enrollDeadline;
- /**
- * 题图地址
- */
- private String titleUrl;
- /**
- * 描述
- */
- private String summary;
-
- @JsonFormat(shape = Shape.STRING)
- public Long getId() {
- return id;
- }
- public void setId(Long id) {
- this.id = id;
- }
- public Date getStartTime() {
- return startTime;
- }
- public void setStartTime(Date startTime) {
- this.startTime = startTime;
- }
- public Date getEndTime() {
- return endTime;
- }
- public void setEndTime(Date endTime) {
- this.endTime = endTime;
- }
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public Integer getStatus() {
- return status;
- }
- public void setStatus(Integer status) {
- this.status = status;
- }
- public String getAddress() {
- return address;
- }
- public void setAddress(String address) {
- this.address = address;
- }
- public String getHost() {
- return host;
- }
- public void setHost(String host) {
- this.host = host;
- }
- public String getUndertake() {
- return undertake;
- }
- public void setUndertake(String undertake) {
- this.undertake = undertake;
- }
- public String getAsist() {
- return asist;
- }
- public void setAsist(String asist) {
- this.asist = asist;
- }
- @JsonFormat(shape = Shape.STRING)
- public Integer getType() {
- return type;
- }
- public void setType(Integer type) {
- this.type = type;
- }
- @JsonFormat(shape = Shape.STRING)
- public Integer getForm() {
- return form;
- }
- public void setForm(Integer form) {
- this.form = form;
- }
- public String getImgUrls() {
- return imgUrls;
- }
- public void setImgUrls(String imgUrls) {
- this.imgUrls = imgUrls;
- }
- public String getResult() {
- return result;
- }
- public void setResult(String result) {
- this.result = result;
- }
- @JsonIgnore
- public Date getCreateTime() {
- return createTime;
- }
- public void setCreateTime(Date createTime) {
- this.createTime = createTime;
- }
- public Date getEnrollDeadline() {
- return enrollDeadline;
- }
- public void setEnrollDeadline(Date enrollDeadline) {
- this.enrollDeadline = enrollDeadline;
- }
- public String getTitleUrl() {
- return titleUrl;
- }
- public void setTitleUrl(String titleUrl) {
- this.titleUrl = titleUrl;
- }
- public String getSummary() {
- return summary;
- }
- public void setSummary(String summary) {
- this.summary = summary;
- }
- public String getStartTimeFormattedDate() {
- if (this.startTime == null) {
- return null;
- } else {
- return DateFormatUtils.format(this.startTime, AFTConstants.YYYYMMDDHHMMSS);
- }
- }
- public void setStartTimeFormattedDate(String startTimeFormattedDate) {
- }
- public String getEndTimeFormattedDate() {
- if (this.endTime == null) {
- return null;
- } else {
- return DateFormatUtils.format(this.endTime, AFTConstants.YYYYMMDDHHMMSS);
- }
- }
- public void setEndTimeFormattedDate(String endTimeFormattedDate) {
- }
- public String getEnrollDeadlineFormattedDate() {
- if (this.enrollDeadline == null) {
- return null;
- } else {
- return DateFormatUtils.format(this.enrollDeadline, AFTConstants.YYYYMMDDHHMMSS);
- }
- }
- public void setEnrollDeadlineFormattedDate(String enrollDeadlineFormattedDate) {
- }
-
- public Integer getActivityStatus(){
- if (this.enrollDeadline == null){
- return ActivityStatus.ENROLL.getCode();
- }
- if (new Date().getTime() > this.enrollDeadline.getTime()){
- return ActivityStatus.CLOSED.getCode();
- }
- return ActivityStatus.ENROLL.getCode();
- }
-
- public void setActivityStatus(Integer activityStatus){
-
- }
- }
|