sys_config.go 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * @desc:系统参数配置
  3. * @company:云南奇讯科技有限公司
  4. * @Author: yixiaohu
  5. * @Date: 2022/4/18 21:11
  6. */
  7. package system
  8. import (
  9. "github.com/gogf/gf/v2/frame/g"
  10. commonApi "github.com/tiger1103/gfast/v3/api/v1/common"
  11. commonEntity "github.com/tiger1103/gfast/v3/internal/app/common/model/entity"
  12. )
  13. type ConfigSearchReq struct {
  14. g.Meta `path:"/config/list" tags:"系统参数管理" method:"get" summary:"系统参数列表"`
  15. ConfigName string `p:"configName"` //参数名称
  16. ConfigKey string `p:"configKey"` //参数键名
  17. ConfigType string `p:"configType"` //状态
  18. commonApi.PageReq
  19. }
  20. type ConfigSearchRes struct {
  21. g.Meta `mime:"application/json"`
  22. List []*commonEntity.SysConfig `json:"list"`
  23. commonApi.ListRes
  24. }
  25. type ConfigReq struct {
  26. ConfigName string `p:"configName" v:"required#参数名称不能为空"`
  27. ConfigKey string `p:"configKey" v:"required#参数键名不能为空"`
  28. ConfigValue string `p:"configValue" v:"required#参数键值不能为空"`
  29. ConfigType int `p:"configType" v:"required|in:0,1#系统内置不能为空|系统内置类型只能为0或1"`
  30. Remark string `p:"remark"`
  31. }
  32. type ConfigAddReq struct {
  33. g.Meta `path:"/config/add" tags:"系统参数管理" method:"post" summary:"添加系统参数"`
  34. *ConfigReq
  35. }
  36. type ConfigAddRes struct {
  37. }
  38. type ConfigGetReq struct {
  39. g.Meta `path:"/config/get" tags:"系统参数管理" method:"get" summary:"获取系统参数"`
  40. Id int `p:"id"`
  41. }
  42. type ConfigGetRes struct {
  43. g.Meta `mime:"application/json"`
  44. Data *commonEntity.SysConfig `json:"data"`
  45. }
  46. type ConfigEditReq struct {
  47. g.Meta `path:"/config/edit" tags:"系统参数管理" method:"put" summary:"修改系统参数"`
  48. ConfigId int64 `p:"configId" v:"required|min:1#主键ID不能为空|主键ID参数错误"`
  49. *ConfigReq
  50. }
  51. type ConfigEditRes struct {
  52. }
  53. type ConfigDeleteReq struct {
  54. g.Meta `path:"/config/delete" tags:"系统参数管理" method:"delete" summary:"删除系统参数"`
  55. Ids []int `p:"ids"`
  56. }
  57. type ConfigDeleteRes struct {
  58. }