package com.ylx.merchant.domain.vo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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

@Data
@ApiModel("商户相册vo")
public class MerchantPictureVO implements Serializable {
    private static final long serialVersionUID = 1218151463428678293L;


    @JsonIgnore
    @ApiModelProperty(name = "商户生活照")
    private String lifestyleStr;

    @ApiModelProperty(name = "商户生活照")
    private List<String> lifestyles;

    public List<String> getLifestyles() {
        return convertToList(this.lifestyleStr);
    }

    private List<String> convertToList(String str) {
        if (str == null || str.isEmpty()) {
            return new ArrayList<>();
        }
        return Arrays.asList(str.split(","));
    }

}
