config.go 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. Mysql string
  10. RedisAddr string `json:"RedisAddr"`
  11. Mongodb *mgoConf
  12. SurvivalTime int
  13. SaveConcurrency int // 消息保存并发数
  14. WxTmplConfig WxTmplMsg `json:"WxTmplConfig"`
  15. Mail []struct {
  16. Addr string `json:"addr"`
  17. Port int `json:"port"`
  18. Pwd string `json:"pwd"`
  19. User string `json:"user"`
  20. } `json:"mail"`
  21. }
  22. type mysqlConfig struct {
  23. DbName string
  24. Address string
  25. UserName string
  26. PassWord string
  27. MaxOpenConns int
  28. MaxIdleConns int
  29. }
  30. type mgoConf struct {
  31. Address string
  32. Size int
  33. DbName string
  34. ReplSet string
  35. UserName string
  36. Password string
  37. Collection string
  38. Collection_back string
  39. }
  40. var ConfigJson Config
  41. type WxTmplMsg struct {
  42. RpcAddr string `json:"rpcAddr"`
  43. TmplSetting struct {
  44. JySchoolTmplId string `json:"jySchoolTmplId"`
  45. SystemTmplId string `json:"systemTmplId"`
  46. CloseNotice string `json:"closeNotice"`
  47. } `json:"tmplSetting"`
  48. Limit struct {
  49. Total int `json:"total"`
  50. OneDayLimit int `json:"oneDayLimit"`
  51. DuringMine int `json:"duringMine"`
  52. Alert struct {
  53. Nums []int64 `json:"nums"`
  54. ToMail []string `json:"toMail"`
  55. CcMail []string `json:"ccMail"`
  56. } `json:"alert"`
  57. } `json:"limit"`
  58. }