package com.yonge.cooleshow.biz.dal.wrapper;

import com.alibaba.fastjson.JSON;
import com.microsvc.toolkit.common.response.paging.QueryInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Optional;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

/**
 * 分账归还记录
 * 2023-10-18 10:59:05
 */
@ApiModel(value = "DivBackRecordWrapper对象", description = "分账归还记录查询对象")
public class DivBackRecordWrapper {

    @Data
	@Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @ApiModel(" DivBackRecordQuery-分账归还记录")
    public static class DivBackRecordQuery implements QueryInfo {
    
    	@ApiModelProperty("当前页")
        private Integer page;
        
        @ApiModelProperty("分页行数")
        private Integer rows;
        
        @ApiModelProperty("关键字匹配")
		private String keyword;
        
        public String getKeyword() {
            return Optional.ofNullable(keyword).filter(StringUtils::isNotBlank).orElse(null);
        }
        
        public String jsonString() {
            return JSON.toJSONString(this);
        }

        public static DivBackRecordQuery from(String json) {
            return JSON.parseObject(json, DivBackRecordQuery.class);
        }
    }  

	@ApiModel(" DivBackRecord-分账归还记录")
    public static class DivBackRecord {
        
        public String jsonString() {
            return JSON.toJSONString(this);
        }

        public static DivBackRecord from(String json) {
            return JSON.parseObject(json, DivBackRecord.class);
        }
	}

}