package com.cool.store.vo.shop;

import com.cool.store.entity.ShopInfoDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhangchenbiao
 * @FileName: MiniHomePageShopVO
 * @Description:
 * @date 2024-04-11 16:50
 */
@Data
public class MiniShopPageVO {

    @ApiModelProperty("店铺id")
    private Long shopId;

    @ApiModelProperty("店铺名称")
    private String shopName;

    public MiniShopPageVO(Long shopId, String shopName) {
        this.shopId = shopId;
        this.shopName = shopName;
    }

    public static List<MiniShopPageVO> convertList(List<ShopInfoDO> shopInfoList) {
        List<MiniShopPageVO> resultList = new ArrayList<>();
        for (ShopInfoDO shopInfo : shopInfoList) {
            resultList.add(new MiniShopPageVO(shopInfo.getId(), shopInfo.getShopName()));
        }
        return resultList;
    }

}
