syntax = "v1"

type (
	// Dictionary request | 字典查询请求
	// swagger:parameters GetDictionaryListAdmin GetDictionaryAdmin
	DictionaryReq {
		BaseID
		*Pagination

		// 展示名称
		Title string `json:"title,optional" form:"title,optional"`

		// 搜索名称
		Name string `json:"name,optional" form:"name,optional"`

		// Status | 状态
		Status string `json:"status,optional" form:"status,optional"`

		// Keyword | 综合搜索关键字
		Keyword string `json:"keyword,optional" form:"keyword,optional"`
	}

		// Dictionary list response | 字典列表返回
	DictionaryListResp {
		// Page | 分页数据
		Page *Pagination `json:"page,optional"`

		// List | 数据列表
		List []*DictionaryInfo `json:"list"`
	}
)

@server(
	jwt: Auth
	group: dictionary_admin
	middleware: Authority
	prefix: /api/admin/dictionary
)
service api {
	// Create dictionary | 创建字典
	@handler createDictionaryAdmin
	post /create (DictionaryInfo) returns (BaseID)

	// Update dictionary info | 更新字典信息
	@handler updateDictionaryAdmin
	post /update (DictionaryInfo)

	// Get dictionary list | 获取字典列表
	@handler getDictionaryListAdmin
	get /list (DictionaryReq) returns (DictionaryListResp)

	// Get dictionary | 获取字典
	@handler getDictionaryAdmin
	get / (DictionaryReq) returns (DictionaryInfo)

	// Delete dictionary | 删除字典
	@handler deleteDictionaryAdmin
	delete / (BaseIDs)
}

///////////////////////////////// detail

type (
	// Dictionary detail request | 字典项查询请求
	// swagger:parameters GetDictionaryDetailListAdmin GetDictionaryDetailAdmin
	DictionaryDetailReq {
		BaseID
		*Pagination

		// 字典ID
		DictionaryID int64 `json:"dictionaryId,string,optional" form:"dictionaryId,optional"`

		// Status | 状态
		Status string `json:"status,optional" form:"status,optional"`

		// 展示名称
		Title string `json:"title,optional" form:"title,optional"`

		// Key
		Key string `json:"key,optional" form:"key,optional"`

		// Keyword | 综合搜索关键字
		Keyword string `json:"keyword,optional" form:"keyword,optional"`
	}

		// Dictionary Detail list response | 字典项列表返回
	DictionaryDetailListResp {
		// Page | 分页数据
		Page *Pagination `json:"page,optional"`

		// List | 数据列表
		List []*DictionaryDetailInfo `json:"list"`
	}

	// Dictionary Detail request | 字典项删除请求
	// swagger:parameters DeleteDictionaryDetailAdmin
	DeleteDictionaryDetailReq {
		BaseIDs

		// 字典ID
		DictionaryID int64 `json:"dictionaryId,string,optional" form:"dictionaryId,optional"`
	}
)

@server(
	jwt: Auth
	group: dictionary_admin/detail
	middleware: Authority
	prefix: /api/admin/dictionary/detail
)
service api {
	// Create dictionary Detail | 创建字典项
	@handler createDictionaryDetailAdmin
	post /create (DictionaryDetailInfo) returns (BaseID)

	// Update dictionary info | 更新字典项信息
	@handler updateDictionaryDetailAdmin
	post /update (DictionaryDetailInfo)

	// Get dictionary list | 获取字典项列表
	@handler getDictionaryDetailListAdmin
	get /list (DictionaryDetailReq) returns (DictionaryDetailListResp)

	// Get dictionary | 获取字典项
	@handler getDictionaryDetailAdmin
	get / (DictionaryDetailReq) returns (DictionaryDetailInfo)

	// Delete dictionary | 删除字典项（批量）
	@handler deleteDictionaryDetailAdmin
	delete / (DeleteDictionaryDetailReq)
}