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-10 10:17:38
 */
@ApiModel(value = "TenantAlbumCategoryDetailWrapper对象", description = "机构专辑分类详情查询对象")
public class TenantAlbumCategoryDetailWrapper {

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @ApiModel(" TenantAlbumCategoryDetailQuery-机构专辑分类详情")
    public static class TenantAlbumCategoryDetailQuery 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 TenantAlbumCategoryDetailQuery from(String json) {
            return JSON.parseObject(json, TenantAlbumCategoryDetailQuery.class);
        }
    }

    @ApiModel(" TenantAlbumCategoryDetail-机构专辑分类详情")
    public static class TenantAlbumCategoryDetail {

        public String jsonString() {
            return JSON.toJSONString(this);
        }

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

}