package com.zhongshu.card.client.model.devices.permiss;

import com.zhongshu.card.client.model.base.SuperModel;
import com.zhongshu.card.client.type.DataState;
import com.zhongshu.card.client.type.device.TimeSlotType;
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/12/19
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PermissTimeSlotModel extends SuperModel {

    @Schema(description = "名称")
    private String name;

    @Schema(description = "时间段类型")
    private TimeSlotType type;

    private String typeStr;

    public String getTypeStr() {
        if (type != null) {
            return type.getRemark();
        }
        return "";
    }

    @Schema(description = "星期数据")
    private List<TimeSlotWeekModel> timeSlotWeekModels = new ArrayList<>();

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

    private String stateStr;

    public String getStateStr() {
        if (state != null) {
            return state.getRemark();
        }
        return "";
    }
}
