sys_common.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * @Author: LinkLeong link@icewhale.com
  3. * @Date: 2022-05-13 18:15:46
  4. * @LastEditors: LinkLeong
  5. * @LastEditTime: 2022-09-02 22:12:34
  6. * @FilePath: /CasaOS/model/sys_common.go
  7. * @Description:
  8. * @Website: https://www.casaos.io
  9. * Copyright (c) 2022 by icewhale, All Rights Reserved.
  10. */
  11. package model
  12. import "time"
  13. // 系统配置
  14. type SysInfoModel struct {
  15. Name string // 系统名称
  16. }
  17. // 服务配置
  18. type ServerModel struct {
  19. HttpPort string
  20. RunMode string
  21. ServerApi string
  22. LockAccount bool
  23. Token string
  24. USBAutoMount string
  25. UpdateUrl string
  26. }
  27. // 服务配置
  28. type APPModel struct {
  29. LogPath string
  30. LogSaveName string
  31. LogFileExt string
  32. DateStrFormat string
  33. DateTimeFormat string
  34. UserDataPath string
  35. TimeFormat string
  36. DateFormat string
  37. DBPath string
  38. ShellPath string
  39. }
  40. type CommonModel struct {
  41. RuntimePath string
  42. }
  43. // 公共返回模型
  44. type Result struct {
  45. Success int `json:"success" example:"200"`
  46. Message string `json:"message" example:"ok"`
  47. Data interface{} `json:"data" example:"返回结果"`
  48. }
  49. // redis配置文件
  50. type RedisModel struct {
  51. Host string
  52. Password string
  53. MaxIdle int
  54. MaxActive int
  55. IdleTimeout time.Duration
  56. }
  57. type SystemConfig struct {
  58. ConfigPath string `json:"config_path"`
  59. }
  60. type FileSetting struct {
  61. ShareDir []string `json:"share_dir" delim:"|"`
  62. DownloadDir string `json:"download_dir"`
  63. }
  64. type BaseInfo struct {
  65. Hash string `json:"i"`
  66. Version string `json:"v"`
  67. Channel string `json:"c,omitempty"`
  68. DriveModel string `json:"m,omitempty"`
  69. }