动态管理使用枚举类
This commit is contained in:
@@ -0,0 +1,17 @@
|
|||||||
|
package com.cool.store.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动态栏目枚举类
|
||||||
|
*/
|
||||||
|
public enum ContentSubjectEnum {
|
||||||
|
HY_CULTURE("沪姨文化"),
|
||||||
|
PARTNER_SAYS("加盟商说"),
|
||||||
|
BRAND_NEWS("品牌动态")
|
||||||
|
;
|
||||||
|
|
||||||
|
private String subjectName;
|
||||||
|
|
||||||
|
ContentSubjectEnum(String subjectName) {
|
||||||
|
this.subjectName = subjectName;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.cool.store.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动态类型(图文/视频)
|
||||||
|
*/
|
||||||
|
public enum ContentTypeEnum {
|
||||||
|
VIDEO("视频"),
|
||||||
|
IMAGE("图文")
|
||||||
|
;
|
||||||
|
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
ContentTypeEnum(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -153,10 +153,10 @@
|
|||||||
<if test="contentTitle != null and contentTitle != ''">
|
<if test="contentTitle != null and contentTitle != ''">
|
||||||
and content_title like concat('%', #{contentTitle}, '%')
|
and content_title like concat('%', #{contentTitle}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="subject != null and subject != ''">
|
<if test="subject != null">
|
||||||
and subject = #{subject}
|
and subject = #{subject}
|
||||||
</if>
|
</if>
|
||||||
<if test="contentType != null and contentType != ''">
|
<if test="contentType != null">
|
||||||
and content_type = #{contentType}
|
and content_type = #{contentType}
|
||||||
</if>
|
</if>
|
||||||
<if test="startTime != null and startTime != ''">
|
<if test="startTime != null and startTime != ''">
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.cool.store.dto.content;
|
package com.cool.store.dto.content;
|
||||||
|
|
||||||
|
import com.cool.store.enums.ContentSubjectEnum;
|
||||||
|
import com.cool.store.enums.ContentTypeEnum;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -13,10 +15,10 @@ public class ContentAddDto {
|
|||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
@ApiModelProperty(value = "栏目code", required = true)
|
@ApiModelProperty(value = "栏目code", required = true)
|
||||||
private String subject;
|
private ContentSubjectEnum subject;
|
||||||
|
|
||||||
@ApiModelProperty(value = "类型", required = true)
|
@ApiModelProperty(value = "类型", required = true)
|
||||||
private String contentType;
|
private ContentTypeEnum contentType;
|
||||||
|
|
||||||
@ApiModelProperty(value = "封面地址", required = true)
|
@ApiModelProperty(value = "封面地址", required = true)
|
||||||
private String cover;
|
private String cover;
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.cool.store.dto.content;
|
package com.cool.store.dto.content;
|
||||||
|
|
||||||
import com.cool.store.common.PageBasicInfo;
|
import com.cool.store.common.PageBasicInfo;
|
||||||
|
import com.cool.store.enums.ContentSubjectEnum;
|
||||||
|
import com.cool.store.enums.ContentTypeEnum;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -13,10 +15,10 @@ public class ContentQueryListDto extends PageBasicInfo {
|
|||||||
private String contentTitle;
|
private String contentTitle;
|
||||||
|
|
||||||
@ApiModelProperty("栏目Code")
|
@ApiModelProperty("栏目Code")
|
||||||
private String subject;
|
private ContentSubjectEnum subject;
|
||||||
|
|
||||||
@ApiModelProperty("类型,默认选中全部时不传值")
|
@ApiModelProperty("类型,默认选中全部时不传值")
|
||||||
private String contentType;
|
private ContentTypeEnum contentType;
|
||||||
|
|
||||||
@ApiModelProperty("筛选开始时间")
|
@ApiModelProperty("筛选开始时间")
|
||||||
private String startTime;
|
private String startTime;
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.cool.store.dto.content;
|
package com.cool.store.dto.content;
|
||||||
|
|
||||||
|
import com.cool.store.enums.ContentSubjectEnum;
|
||||||
|
import com.cool.store.enums.ContentTypeEnum;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -16,10 +18,10 @@ public class ContentUpdateDto {
|
|||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
@ApiModelProperty("栏目code")
|
@ApiModelProperty("栏目code")
|
||||||
private String subject;
|
private ContentSubjectEnum subject;
|
||||||
|
|
||||||
@ApiModelProperty("类型")
|
@ApiModelProperty("类型")
|
||||||
private String contentType;
|
private ContentTypeEnum contentType;
|
||||||
|
|
||||||
@ApiModelProperty("封面地址")
|
@ApiModelProperty("封面地址")
|
||||||
private String cover;
|
private String cover;
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
package com.cool.store.entity;
|
package com.cool.store.entity;
|
||||||
|
|
||||||
|
import com.cool.store.enums.ContentSubjectEnum;
|
||||||
|
import com.cool.store.enums.ContentTypeEnum;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -25,10 +27,10 @@ public class HyContentInfoDO implements Serializable {
|
|||||||
private String contentTitle;
|
private String contentTitle;
|
||||||
|
|
||||||
@ApiModelProperty("栏目CODE")
|
@ApiModelProperty("栏目CODE")
|
||||||
private String subject;
|
private ContentSubjectEnum subject;
|
||||||
|
|
||||||
@ApiModelProperty("类型 image-图文 video-视频")
|
@ApiModelProperty("类型 image-图文 video-视频")
|
||||||
private String contentType;
|
private ContentTypeEnum contentType;
|
||||||
|
|
||||||
@ApiModelProperty("封面URL")
|
@ApiModelProperty("封面URL")
|
||||||
private String cover;
|
private String cover;
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.cool.store.vo;
|
package com.cool.store.vo;
|
||||||
|
|
||||||
|
import com.cool.store.enums.ContentSubjectEnum;
|
||||||
|
import com.cool.store.enums.ContentTypeEnum;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -13,10 +15,10 @@ public class HyContentInfoVO {
|
|||||||
private String contentTitle;
|
private String contentTitle;
|
||||||
|
|
||||||
@ApiModelProperty("栏目CODE")
|
@ApiModelProperty("栏目CODE")
|
||||||
private String subject;
|
private ContentSubjectEnum subject;
|
||||||
|
|
||||||
@ApiModelProperty("类型 image-图文 video-视频")
|
@ApiModelProperty("类型 image-图文 video-视频")
|
||||||
private String contentType;
|
private ContentTypeEnum contentType;
|
||||||
|
|
||||||
@ApiModelProperty("封面URL")
|
@ApiModelProperty("封面URL")
|
||||||
private String cover;
|
private String cover;
|
||||||
|
|||||||
@@ -32,14 +32,16 @@ public class ContentController {
|
|||||||
|
|
||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
@ApiOperation("删除动态")
|
@ApiOperation("删除动态")
|
||||||
public void deleteContent(@RequestParam(value = "contentId") String contentId) {
|
public ResponseResult deleteContent(@RequestParam(value = "contentId") String contentId) {
|
||||||
contentService.deleteContent(contentId);
|
contentService.deleteContent(contentId);
|
||||||
|
return ResponseResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/modify")
|
@PostMapping("/modify")
|
||||||
@ApiOperation("修改动态")
|
@ApiOperation("修改动态")
|
||||||
public void updateContent(@RequestBody ContentUpdateDto dto) {
|
public ResponseResult updateContent(@RequestBody ContentUpdateDto dto) {
|
||||||
contentService.updateContent(dto);
|
contentService.updateContent(dto);
|
||||||
|
return ResponseResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/queryContentList")
|
@PostMapping("/queryContentList")
|
||||||
|
|||||||
Reference in New Issue
Block a user