configuration.api 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. import "../base.api"
  2. type (
  3. // The response data of configuration information | 参数配置信息
  4. ConfigurationInfo {
  5. BaseIDInfo
  6. // Sort Number | 排序编号
  7. Sort *uint32 `json:"sort,optional"`
  8. // State true: normal false: ban | 状态 true 正常 false 禁用
  9. State *bool `json:"state,optional"`
  10. // Configurarion name | 配置名称
  11. Name *string `json:"name,optional"`
  12. // Configuration key | 配置的键名
  13. Key *string `json:"key,optional"`
  14. // Configuraion value | 配置的值
  15. Value *string `json:"value,optional"`
  16. // Configuration category | 配置的分类
  17. Category *string `json:"category,optional"`
  18. // Remark | 备注
  19. Remark *string `json:"remark,optional"`
  20. }
  21. // The response data of configuration list | 参数配置列表数据
  22. ConfigurationListResp {
  23. BaseDataInfo
  24. // Configuration list data | 参数配置列表数据
  25. Data ConfigurationListInfo `json:"data"`
  26. }
  27. // Configuration list data | 参数配置列表数据
  28. ConfigurationListInfo {
  29. BaseListInfo
  30. // The API list data | Configuration列表数据
  31. Data []ConfigurationInfo `json:"data"`
  32. }
  33. // Get configuration list request params | 参数配置列表请求参数
  34. ConfigurationListReq {
  35. PageInfo
  36. // Name
  37. Name *string `json:"name,optional"`
  38. // Key
  39. Key *string `json:"key,optional"`
  40. // Category
  41. Category *string `json:"category,optional"`
  42. }
  43. // Configuration information response | 参数配置信息返回体
  44. ConfigurationInfoResp {
  45. BaseDataInfo
  46. // Configuration information | 参数配置数据
  47. Data ConfigurationInfo `json:"data"`
  48. }
  49. )
  50. @server(
  51. jwt: Auth
  52. group: configuration
  53. middleware: Authority
  54. )
  55. service Core {
  56. // Create configuration information | 创建参数配置
  57. @handler createConfiguration
  58. post /configuration/create (ConfigurationInfo) returns (BaseMsgResp)
  59. // Update configuration information | 更新参数配置
  60. @handler updateConfiguration
  61. post /configuration/update (ConfigurationInfo) returns (BaseMsgResp)
  62. // Delete configuration information | 删除参数配置信息
  63. @handler deleteConfiguration
  64. post /configuration/delete (IDsReq) returns (BaseMsgResp)
  65. // Get configuration list | 获取参数配置列表
  66. @handler getConfigurationList
  67. post /configuration/list (ConfigurationListReq) returns (ConfigurationListResp)
  68. // Get configuration by ID | 通过ID获取参数配置
  69. @handler getConfigurationById
  70. post /configuration (IDReq) returns (ConfigurationInfoResp)
  71. }
  72. @server(
  73. group: publicapi
  74. )
  75. service Core {
  76. // Get public system configuration list | 获取公开系统参数列表
  77. @handler getPublicSystemConfigurationList
  78. get /configuration/system/list returns (ConfigurationListResp)
  79. }