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 VO类型 * @author Young */ @Data @Accessors(chain = true) public class BaseVO { /** * 主键 */ @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; } }