Browse Source

heart-work:saveact初始化

master
yinzuomei 5 years ago
parent
commit
1c83d3a22c
  1. 31
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActContentFormDTO.java
  2. 182
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActInfoFormDTO.java
  3. 3
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java
  4. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PublishActInitResultDTO.java
  5. 21
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/SaveActDraftResultDTO.java
  6. 20
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java
  7. 13
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java
  8. 16
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java

31
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActContentFormDTO.java

@ -0,0 +1,31 @@
package com.epmet.dto.form.work;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 活动内容
*
* @author yinzuomei@elink-cn.com
* @date 2020/7/21 13:18
*/
@Data
public class SaveActContentFormDTO implements Serializable {
private static final long serialVersionUID = 5236509944250440348L;
public interface UserInternalGroup {}
public interface UserShowGroup extends CustomerClientShowGroup {}
/**
* 内容
*/
@NotBlank(message = "内容不能为空", groups = {UserShowGroup.class })
private String content;
/**
* 内容类型 图片img文字text
*/
@NotBlank(message = "内容类型不能为空,图片:img;文字:text", groups = {UserInternalGroup.class })
private String contentType;
}

182
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActInfoFormDTO.java

@ -0,0 +1,182 @@
package com.epmet.dto.form.work;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
* 预览-保存活动草稿入参DTO
*
* @author yinzuomei@elink-cn.com
* @date 2020/7/21 13:17
*/
@Data
public class SaveActInfoFormDTO implements Serializable {
private static final long serialVersionUID = -4967079570884814526L;
public interface AddUserInternalGroup {}
public interface AddUserShowGroup extends CustomerClientShowGroup {}
@Valid
private List<SaveActContentFormDTO> actContent;
/**
* 活动草稿id,如果是编辑之前的活动草稿此列是有值的
*/
private String actDraftId;
/**
* 如果是重新发布活动此列是有值的
*/
private String actId;
/**
* 活动标题
*/
@NotBlank(message = "活动标题不能为空", groups = {AddUserShowGroup.class })
private String title;
/**
* 封面图
*/
@NotBlank(message = "封面图不能为空", groups = {AddUserShowGroup.class })
private String coverPic;
/**
* 活动地点
*/
@NotBlank(message = "活动地点不能为空", groups = {AddUserShowGroup.class })
private String actAddress;
/**
* 活动地点-经度
*/
@NotBlank(message = "活动地点经度不能为空", groups = {AddUserInternalGroup.class })
private String actLongitude;
/**
* 活动地点-纬度
*/
@NotBlank(message = "活动地点经度不能为空", groups = {AddUserInternalGroup.class })
private String actLatitude;
/**
* 活动预计开始时间yyyy-MM-dd HH:mm
*/
@NotBlank(message = "活动预计开始时间不能为空", groups = {AddUserShowGroup.class })
private String actStartTime;
/**
* 活动预计结束时间yyyy-MM-dd HH:mm
*/
@NotBlank(message = "活动预计结束时间不能为空", groups = {AddUserShowGroup.class })
private String actEndTime;
/**
* 活动人数
*/
@Min(0)
private Integer actQuota;
/**
* 活动积分
*/
@Min(0)
private Integer reward;
/**
* 报名审核true只有志愿者才可以参加活动false: 只要是居民就可以参加活动
*/
@NotNull(message = "报名身份不能为空",groups = {AddUserInternalGroup.class})
private Boolean volunteerLimit;
/**
* 报名审核 true: 需人工审核 false: 无需审核
*/
@NotNull(message = "报名审核方式不能为空",groups = {AddUserInternalGroup.class})
private Boolean auditSwitch;
/**
* 报名截止时间yyyy-MM-dd HH:mm
*/
@NotBlank(message = "报名截止时间不能为空", groups = {AddUserShowGroup.class })
private String signUpEndTime;
/**
* 报名条件
*/
@NotBlank(message = "报名条件不能为空", groups = {AddUserShowGroup.class })
private String requirement;
/**
* 签到开始时间yyyy-MM-dd HH:mm
*/
@NotBlank(message = "签到开始时间不能为空", groups = {AddUserShowGroup.class })
private String signInStartTime;
/**
* 签到结束时间: yyyy-MM-dd HH:mm
*/
@NotBlank(message = "签到结束时间不能为空", groups = {AddUserShowGroup.class })
private String signInEndTime;
/**
* 签到地址
*/
@NotBlank(message = "签到地址不能为空", groups = {AddUserShowGroup.class })
private String signInAddress;
/**
* 签到地址-纬度
*/
@NotBlank(message = "签到地址-纬度不能为空", groups = {AddUserInternalGroup.class })
private String signInLatitude;
/**
* 签到地址-经度
*/
@NotBlank(message = "签到地址-经度不能为空", groups = {AddUserInternalGroup.class })
private String signInLongitude;
/**
* 签到有效范围()
*/
@Min(0)
private Integer signInRadius;
/**
* 主办方id
*/
@NotBlank(message = "主办方id不能为空", groups = {AddUserInternalGroup.class })
private String sponsorId;
/**
* 主办方类型以网格名义grid , 以机关名义 agency
*/
@NotBlank(message = "主办方类型不能为空", groups = {AddUserInternalGroup.class })
private String sponsorType;
/**
* 主办方名称
*/
@NotBlank(message = "主办方名称不能为空", groups = {AddUserShowGroup.class })
private String sponsorName;
/**
* 联系人
*/
@NotBlank(message = "联系人不能为空", groups = {AddUserShowGroup.class })
private String sponsorContacts;
/**
* 联系电话
*/
@NotBlank(message = "联系电话不能为空", groups = {AddUserShowGroup.class })
private String sponsorTel;
}

3
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java

@ -17,6 +17,9 @@ import java.util.List;
@Data
public class LatestDraftActInfoResultDTO implements Serializable {
private static final long serialVersionUID = 4104775168048712734L;
/**
* 活动草稿id
*/
private String actDraftId;
/**
* 客户id

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInitResultDTO.java → epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PublishActInitResultDTO.java

@ -1,4 +1,4 @@
package com.epmet.dto.form.work;
package com.epmet.dto.result.work;
import lombok.Data;

21
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/SaveActDraftResultDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.result.work;
import lombok.Data;
import java.io.Serializable;
/**
* 预览-保存活动草稿返参DTO
*
* @author yinzuomei@elink-cn.com
* @date 2020/7/21 12:53
*/
@Data
public class SaveActDraftResultDTO implements Serializable {
private static final long serialVersionUID = -111427814347693729L;
/**
* 活动草稿id
*/
private String actDraftId;
}

20
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java

@ -1,11 +1,15 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.work.PublishActInitResultDTO;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.work.SaveActInfoFormDTO;
import com.epmet.dto.result.work.LatestDraftActInfoResultDTO;
import com.epmet.dto.result.work.PublishActInitResultDTO;
import com.epmet.dto.result.work.SaveActDraftResultDTO;
import com.epmet.service.WorkActDraftService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -60,4 +64,18 @@ public class WorkActDraftController {
LatestDraftActInfoResultDTO resultDTO=workActDraftService.getLatestDraft();
return new Result<LatestDraftActInfoResultDTO>().ok(resultDTO);
}
/**
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.work.SaveActDraftResultDTO>
* @param formDTO
* @author yinzuomei
* @description 预览按下-调用此接口保存活动信息活动内容
* @Date 2020/7/21 14:00
**/
@PostMapping("saveact")
public Result<SaveActDraftResultDTO> saveAct(@RequestBody SaveActInfoFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO);
SaveActDraftResultDTO resultDTO=workActDraftService.saveAct(formDTO);
return new Result<SaveActDraftResultDTO>().ok(resultDTO);
}
}

13
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java

@ -1,7 +1,9 @@
package com.epmet.service;
import com.epmet.dto.form.work.PublishActInitResultDTO;
import com.epmet.dto.form.work.SaveActInfoFormDTO;
import com.epmet.dto.result.work.LatestDraftActInfoResultDTO;
import com.epmet.dto.result.work.PublishActInitResultDTO;
import com.epmet.dto.result.work.SaveActDraftResultDTO;
/**
* 工作端活动草稿
@ -37,4 +39,13 @@ public interface WorkActDraftService {
* @Date 2020/7/20 22:29
**/
LatestDraftActInfoResultDTO getLatestDraft();
/**
* @return com.epmet.dto.result.work.SaveActDraftResultDTO
* @param formDTO
* @author yinzuomei
* @description 预览按下-调用此接口保存活动信息活动内容
* @Date 2020/7/21 14:00
**/
SaveActDraftResultDTO saveAct(SaveActInfoFormDTO formDTO);
}

16
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java

@ -1,9 +1,11 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.dto.form.work.PublishActInitResultDTO;
import com.epmet.dto.form.work.SaveActInfoFormDTO;
import com.epmet.dto.result.work.ActDraftContentDTOResultDTO;
import com.epmet.dto.result.work.LatestDraftActInfoResultDTO;
import com.epmet.dto.result.work.PublishActInitResultDTO;
import com.epmet.dto.result.work.SaveActDraftResultDTO;
import com.epmet.service.LatestActContentService;
import com.epmet.service.LatestActInfoService;
import com.epmet.service.WorkActDraftService;
@ -89,4 +91,16 @@ public class WorkActDraftServiceImpl implements WorkActDraftService {
}
return null;
}
/**
* @param formDTO
* @return com.epmet.dto.result.work.SaveActDraftResultDTO
* @author yinzuomei
* @description 预览按下-调用此接口保存活动信息活动内容
* @Date 2020/7/21 14:00
**/
@Override
public SaveActDraftResultDTO saveAct(SaveActInfoFormDTO formDTO) {
return null;
}
}

Loading…
Cancel
Save