config.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. package config
  2. import (
  3. "github.com/zeromicro/go-zero/zrpc"
  4. )
  5. type Config struct {
  6. zrpc.RpcServerConf
  7. DataSource *mysqlConfig // 手动代码
  8. BaseSource *mysqlConfig // 手动代码
  9. WebRpcPort int
  10. Mysql string
  11. RedisAddr string `json:"RedisAddr"`
  12. Mongodb *mgoConf
  13. SurvivalTime int
  14. SaveConcurrency int // 消息保存并发数
  15. WxTmplConfig WxTmplMsg `json:"WxTmplConfig"`
  16. Mail []struct {
  17. Addr string `json:"addr"`
  18. Port int `json:"port"`
  19. Pwd string `json:"pwd"`
  20. User string `json:"user"`
  21. } `json:"mail"`
  22. }
  23. type mysqlConfig struct {
  24. DbName string
  25. Address string
  26. UserName string
  27. PassWord string
  28. MaxOpenConns int
  29. MaxIdleConns int
  30. }
  31. type mgoConf struct {
  32. Address string
  33. Size int
  34. DbName string
  35. ReplSet string
  36. UserName string
  37. Password string
  38. Collection string
  39. Collection_back string
  40. }
  41. var ConfigJson Config
  42. type WxTmplMsg struct {
  43. RpcAddr string `json:"rpcAddr"`
  44. TmplSetting struct {
  45. JySchoolTmplId string `json:"jySchoolTmplId"`
  46. SystemTmplId string `json:"systemTmplId"`
  47. CloseNotice string `json:"closeNotice"`
  48. } `json:"tmplSetting"`
  49. Limit struct {
  50. Total int `json:"total"`
  51. OneDayLimit int `json:"oneDayLimit"`
  52. DuringMine int `json:"duringMine"`
  53. Alert struct {
  54. Nums []int64 `json:"nums"`
  55. ToMail []string `json:"toMail"`
  56. CcMail []string `json:"ccMail"`
  57. } `json:"alert"`
  58. } `json:"limit"`
  59. }