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-07-28 16:53:51
 */
@ApiModel(value = "PaymentMerchantConfigWrapper对象", description = "支付三方账户配置查询对象")
public class PaymentMerchantConfigWrapper {

    @Data
	@Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @ApiModel(" PaymentMerchantConfigQuery-支付三方账户配置")
    public static class PaymentMerchantConfigQuery 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 PaymentMerchantConfigQuery from(String json) {
            return JSON.parseObject(json, PaymentMerchantConfigQuery.class);
        }
    }  

	@ApiModel(" PaymentMerchantConfig-支付三方账户配置")
    public static class PaymentMerchantConfig {
        
        public String jsonString() {
            return JSON.toJSONString(this);
        }

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

}