package com.zhongshu.card.client.model.scene;

import com.zhongshu.card.client.type.DataState;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

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

/**
 * @author TRX
 * @date 2024/11/22
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RoleSceneComTreeModel extends SceneInfoModel {

    @Schema(description = "项目应用的数据ID")
    private String projectSceneInfoId;

    @Schema(description = "项目应用排序")
    private Long pSort = 1L;

    @Schema(description = "状态")
    private DataState pState;

    private String pStateStr;

    public String getPStateStr() {
        if (pState != null) {
            return pState.getRemark();
        }
        return "";
    }

    @Schema(description = "包含的组件列表")
    private List<RoleSceneComponentModel> children = new ArrayList<>();

}
