/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package cn.ysk.cashier.dto.product;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import lombok.Data;
import cn.ysk.cashier.pojo.product.TbShopCategory;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
* @website https://eladmin.vip
* @description /
* @author lyf
* @date 2024-01-08
**/
@Data
public class TbShopCategoryDto implements Serializable {

    /** 自增id */
    private Integer id;

    /** 分类名称 */
    private String name;

    /** 简称 */
    private String shortName;

    /** 分类层级 */
    private Integer tree;

    /** 上级分类id-为0则表示是顶级 */
    private String pid;

    /** 图标 */
    private String pic;

    /** 商户Id */
    private String merchantId;

    /** 店铺Id */
    private String shopId;

    /** 颜色格式标识 */
    private String style;

    /** 是否显示：1显示 0不显示 */
    private Integer isShow;

    /** 分类描述 */
    private String detail;

    /** 排序 */
    private Integer sort;

    /** 关键词 */
    private String keyWord;

    private Long createdAt;

    private Long updatedAt;
    /**
     * 子分类
     */
    private List<TbShopCategory> childrenList = new ArrayList<>();

    public void copy(TbShopCategory source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}