Commit e771de33 by jianan

公共枚举-排序字段

parent 09341f44
......@@ -14,6 +14,12 @@
<description>公共组件模块</description>
<dependencies>
<!-- knife4j -->
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-openapi3-spring-boot-starter</artifactId>
<version>4.3.0</version>
</dependency>
<!-- 测试 -->
<dependency>
<groupId>org.springframework.boot</groupId>
......
package com.yd.common.constant;
/**
* 通用常量
*
*/
public interface CommonConstant {
/**
* 升序
*/
String SORT_ORDER_ASC = "ascend";
/**
* 降序
*/
String SORT_ORDER_DESC = " descend";
}
package com.yd.common.dto;
import com.yd.common.constant.CommonConstant;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
......@@ -8,4 +10,16 @@ public class PageDto {
private Integer pageNo = 1;
private Integer pageSize = 10;
/**
* 排序字段
*/
@Schema(description = "排序字段")
private String sortField;
/**
* 排序顺序(默认降序)
*/
@Schema(description = "排序顺序(默认降序, ascend-升序/descend-降序)")
private String sortOrder = CommonConstant.SORT_ORDER_DESC;
}
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