package com.zhongshu.card.server.core.domain.dictionary;

import com.github.microservice.components.data.mongo.mongo.domain.SuperEntity;
import com.zhongshu.card.client.type.DictionaryType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.checkerframework.common.aliasing.qual.Unique;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.CompoundIndexes;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.stereotype.Controller;

@Data
@Document
@AllArgsConstructor
@NoArgsConstructor
@CompoundIndexes(
        @CompoundIndex(name = "projectId_key", def = "{'projectId' : 1, 'key' : 1}", unique = true)
)
public class Dictionary extends SuperEntity {

    //项目id
    @Indexed
    private String projectId;

    //字典类型
    @Indexed
    private String key;

    //名称
    @Indexed
    private String name;

    //描述
    private String description;

    @Indexed
    private DictionaryType type;

    //启动/禁用
    @Indexed
    private boolean disabled;

}
