package system

// DictionaryInfo 字典信息
type DictionaryInfo struct {
	ID      uint                   `json:"ID"`
	Name    string                 `json:"name"`
	Type    string                 `json:"type"`
	Status  *bool                  `json:"status"`
	Desc    string                 `json:"desc"`
	Details []DictionaryDetailInfo `json:"sysDictionaryDetails,omitempty"`
}

// DictionaryDetailInfo 字典详情信息
type DictionaryDetailInfo struct {
	ID              uint                   `json:"ID"`
	Label           string                 `json:"label"`
	Value           string                 `json:"value"`
	Extend          string                 `json:"extend"`
	Status          *bool                  `json:"status"`
	Sort            int                    `json:"sort"`
	SysDictionaryID int                    `json:"sysDictionaryID"`
	ParentID        *uint                  `json:"parentID,omitempty"`
	Children        []DictionaryDetailInfo `json:"children,omitempty"`
}

// CreateDictionaryRequest 创建字典请求
type CreateDictionaryRequest struct {
	Name   string `json:"name" binding:"required"`
	Type   string `json:"type" binding:"required"`
	Status *bool  `json:"status"`
	Desc   string `json:"desc"`
}

// UpdateDictionaryRequest 更新字典请求
type UpdateDictionaryRequest struct {
	ID     uint   `json:"ID" binding:"required"`
	Name   string `json:"name"`
	Type   string `json:"type"`
	Status *bool  `json:"status"`
	Desc   string `json:"desc"`
}

// GetDictionaryListRequest 获取字典列表请求
type GetDictionaryListRequest struct {
	Page     int    `json:"page" form:"page"`
	PageSize int    `json:"pageSize" form:"pageSize"`
	Name     string `json:"name" form:"name"`
}

// GetDictionaryListReply 获取字典列表响应
type GetDictionaryListReply struct {
	List     []DictionaryInfo `json:"list"`
	Total    int64            `json:"total"`
	Page     int              `json:"page"`
	PageSize int              `json:"pageSize"`
}

// FindDictionaryRequest 查找字典请求
type FindDictionaryRequest struct {
	ID   uint   `json:"ID" form:"ID"`
	Type string `json:"type" form:"type"`
}

// ImportDictionaryRequest 导入字典请求
type ImportDictionaryRequest struct {
	Json string `json:"json" binding:"required"`
}

// CreateDictionaryDetailRequest 创建字典详情请求
type CreateDictionaryDetailRequest struct {
	Label           string `json:"label" binding:"required"`
	Value           string `json:"value" binding:"required"`
	Extend          string `json:"extend"`
	Status          *bool  `json:"status"`
	Sort            int    `json:"sort"`
	SysDictionaryID int    `json:"sysDictionaryID" binding:"required"`
	ParentID        *uint  `json:"parentID"`
}

// UpdateDictionaryDetailRequest 更新字典详情请求
type UpdateDictionaryDetailRequest struct {
	ID              uint   `json:"ID" binding:"required"`
	Label           string `json:"label" binding:"required"`
	Value           string `json:"value" binding:"required"`
	Extend          string `json:"extend"`
	Status          *bool  `json:"status"`
	Sort            int    `json:"sort"`
	SysDictionaryID int    `json:"sysDictionaryID" binding:"required"`
	ParentID        *uint  `json:"parentID"`
}

// GetDictionaryDetailListRequest 获取字典详情列表请求
type GetDictionaryDetailListRequest struct {
	Page            int   `json:"page" form:"page"`
	PageSize        int   `json:"pageSize" form:"pageSize"`
	SysDictionaryID int   `json:"sysDictionaryID" form:"sysDictionaryID"`
	ParentID        *uint `json:"parentID" form:"parentID"`
	Level           *int  `json:"level" form:"level"`
}

// GetDictionaryDetailListReply 获取字典详情列表响应
type GetDictionaryDetailListReply struct {
	List     []DictionaryDetailInfo `json:"list"`
	Total    int64                  `json:"total"`
	Page     int                    `json:"page"`
	PageSize int                    `json:"pageSize"`
}

// GetDictionaryDetailsByParentRequest 根据父级ID获取字典详情请求
type GetDictionaryDetailsByParentRequest struct {
	SysDictionaryID int   `json:"sysDictionaryID" form:"sysDictionaryID" binding:"required"`
	ParentID        *uint `json:"parentID" form:"parentID"`
	IncludeChildren bool  `json:"includeChildren" form:"includeChildren"`
}
