123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- package com.sumbytes.common.base.domain.vo;
- import com.sumbytes.common.validator.Messages;
- import com.sumbytes.common.validator.annotion.IntegerNotNull;
- import com.sumbytes.common.validator.annotion.NotNull;
- import com.sumbytes.common.validator.group.Page;
- import com.sumbytes.common.validator.group.Update;
- import lombok.Data;
- import lombok.experimental.Accessors;
- /**
- * VO 层基础父类.
- *
- * @param <T> VO类型
- * @author Young
- */
- @Data
- @Accessors(chain = true)
- public class BaseVO<T> {
- /**
- * 主键
- */
- @NotNull(message = Messages.ID_NOT_NULL, groups = {Update.class})
- protected Long id;
- /**
- * 关键词搜索
- */
- protected String keywords;
- /**
- * 页数
- */
- @IntegerNotNull(groups = {Page.class}, message = Messages.PAGE_NOT_NULL)
- protected Integer page;
- /**
- * 每页大小
- */
- @IntegerNotNull(groups = {Page.class}, message = Messages.SIZE_NOT_NULL)
- protected Integer size;
- public Long getId() {
- return id;
- }
- public T setId(Long id) {
- this.id = id;
- return (T) this;
- }
- public Integer getSize() {
- return size;
- }
- public T setSize(Integer size) {
- this.size = size > 20 ? 20 : size;
- return (T) this;
- }
- }
|