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;
|
}
|
}
|
|
}
|