xiaoyong931011
2022-07-07 bc43681f185af1edf833cf6c94833cb1cdd44a8e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.xcong.farmer.cms.modules.system.dto;
 
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
 
import java.util.Date;
 
@Data
@ApiModel(value = "WebArticleInPageDto", description = "参数接收类")
public class WebArticleInPageDto {
 
 
    @ApiModelProperty(value = "作者", example = "张")
    private String author;
 
    @ApiModelProperty(value = "关键词", example = "关于")
    private String queryKey;
 
    @ApiModelProperty(value = "栏目ID", example = "1")
    private Long columnId;
 
    @ApiModelProperty(value = "每页条数", example = "10")
    private Integer pageSize;
 
    @ApiModelProperty(value = "第几页", example = "1")
    private Integer pageNum;
 
    @ApiModelProperty(value = "一周内,一月内,一年内", example = "一月内")
    private String timeType;
 
    public String getTimeType() {
        if (this.timeType == null) {
            return null;
        }
        switch (this.timeType) {
            case "一周内" :
                return DateUtil.formatDateTime(DateUtil.offsetDay(new Date(),-7));
            case "一月内" :
                return DateUtil.formatDateTime(DateUtil.offsetMonth(new Date(),-1));
            case "一年内" :
                return DateUtil.formatDateTime(DateUtil.offsetMonth(new Date(),-12));
            default:
                return null;
        }
    }
 
}