Commit e7533ba2 authored by fhj's avatar fhj

模板服务 -> 活动页需求

parent b1bea796
package com.ssy.lingxi.platform.template.service.controller.web;
import com.ssy.lingxi.common.controller.BaseController;
import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.platform.template.service.entity.adorn.ActivityPage;
import com.ssy.lingxi.platform.template.service.model.dto.common.IdDTO;
import com.ssy.lingxi.platform.template.service.model.dto.web.SaveActivityPageDTO;
import com.ssy.lingxi.platform.template.service.model.qo.ActivityPageQO;
import com.ssy.lingxi.platform.template.service.service.web.ActivityPageWebService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
/**
* @menu web - 活动页
* @author fhj
* @version 2.0.0
* @date 2021/04/15
*/
@Api(tags = "web - SEO")
@RestController
@RequestMapping("/template/web/activityPage")
public class ActivityPageWebController extends BaseController {
@Resource
private ActivityPageWebService activityPageWebService;
@ApiOperation(value = "列表")
@GetMapping("/page")
public Wrapper<PageData<ActivityPage>> page(@Valid ActivityPageQO qo) {
return activityPageWebService.page(qo);
}
@ApiOperation(value = "详情")
@GetMapping(value = "/get")
public Wrapper<ActivityPage> get(@Valid IdDTO dto) {
return activityPageWebService.get(dto);
}
@ApiOperation(value = "新增")
@PostMapping(value = "/add")
public Wrapper<Void> add(@RequestBody @Validated({SaveActivityPageDTO.Add.class}) SaveActivityPageDTO dto) {
return activityPageWebService.add(dto, getSysUser());
}
@ApiOperation(value = "修改")
@PostMapping(value = "/update")
public Wrapper<Void> update(@RequestBody @Validated({SaveActivityPageDTO.Update.class}) SaveActivityPageDTO dto) {
return activityPageWebService.update(dto, getSysUser());
}
@ApiOperation(value = "删除")
@PostMapping(value = "/delete")
public Wrapper<Void> delete(@RequestBody @Valid IdDTO dto) {
return activityPageWebService.delete(dto, getSysUser());
}
}
package com.ssy.lingxi.platform.template.service.entity.adorn;
import com.ssy.lingxi.platform.template.service.handler.convert.JpaJsonToJsonObjectConverter;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.*;
import java.util.Map;
/**
* 活动页 - DO
* @author fhj
* @date 2021/08/05
* @version 2.0.0
*/
@Data
@Entity
@Table(schema = "public", name = "pt_activity_page")
public class ActivityPage {
@Id
@GeneratedValue(strategy= GenerationType.SEQUENCE, generator="activity_page_seq")
@SequenceGenerator(sequenceName="pt_activity_page_seq", name="activity_page_seq", allocationSize = 1)
@ApiModelProperty(value = "ID")
private Long id;
@Column(columnDefinition = "varchar(64)")
@ApiModelProperty(value = "活动页名称")
private String name;
@Column(columnDefinition = "int8")
@ApiModelProperty(value = "开始时间")
private Long startTime;
@Column(columnDefinition = "int8")
@ApiModelProperty(value = "结束时间")
private Long endTime;
@Column(columnDefinition = "int2")
@ApiModelProperty(value = "适用环境: 1.WEB 2.H5 3.小程序 4.APP")
private Integer environment;
@Column(columnDefinition = "int8")
@ApiModelProperty(value = "活动模板ID")
private Long templateId;
@Column(columnDefinition = "varchar(20)")
@ApiModelProperty(value = "活动模板名称")
private String templateName;
@Column(columnDefinition = "int8")
@ApiModelProperty(value = "商城ID")
private Long shopId;
@Column(columnDefinition = "varchar(20)")
@ApiModelProperty(value = "商城名称")
private String shopName;
@Column(columnDefinition = "int2")
@ApiModelProperty(value = "状态: 1.待上线 2.已上线 3.进行中 4.已下线 5.已结束")
private Integer status;
@Convert(converter = JpaJsonToJsonObjectConverter.class)
@Column(columnDefinition="jsonb")
@ApiModelProperty(value = "装修内容")
private Map<String, Object> adornContent;
@Column(columnDefinition = "int8")
@ApiModelProperty(value = "创建时间")
private Long createTime = System.currentTimeMillis();
}
package com.ssy.lingxi.platform.template.service.model.dto.web;
public class SaveActivityPageDTO {
public interface Add {
}
public interface Update {
}
}
package com.ssy.lingxi.platform.template.service.model.qo;
public class ActivityPageQO {
}
package com.ssy.lingxi.platform.template.service.repository;
import com.ssy.lingxi.platform.template.service.entity.adorn.ActivityPage;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface ActivityPageRepository extends JpaRepository<ActivityPage, Long> {
}
package com.ssy.lingxi.platform.template.service.service.web;
import com.ssy.lingxi.common.model.dto.UserLoginCacheDTO;
import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.platform.template.service.entity.adorn.ActivityPage;
import com.ssy.lingxi.platform.template.service.model.dto.common.IdDTO;
import com.ssy.lingxi.platform.template.service.model.dto.web.SaveActivityPageDTO;
import com.ssy.lingxi.platform.template.service.model.qo.ActivityPageQO;
public interface ActivityPageWebService {
Wrapper<PageData<ActivityPage>> page(ActivityPageQO qo);
Wrapper<ActivityPage> get(IdDTO dto);
Wrapper<Void> add(SaveActivityPageDTO dto, UserLoginCacheDTO sysUser);
Wrapper<Void> update(SaveActivityPageDTO dto, UserLoginCacheDTO sysUser);
Wrapper<Void> delete(IdDTO dto, UserLoginCacheDTO sysUser);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment