config.go 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. WxWebdomain string `json:"WxWebdomain"`
  16. WxTmplConfig WxTmplMsg `json:"WxTmplConfig"`
  17. PushGrpcServer string `json:"PushGrpcServer"`
  18. Mail []struct {
  19. Addr string `json:"addr"`
  20. Port int `json:"port"`
  21. Pwd string `json:"pwd"`
  22. User string `json:"user"`
  23. } `json:"mail"`
  24. TidbEng string `json:"Tidb"`
  25. Registedate int64
  26. ClassSearchList []int64 `json:"ClassSearchList"` // 需要按照messageclass 查询的groupId
  27. Clickhouse *CHouseConfig
  28. GlobMsgLoadTime string `json:"GlobMsgLoadTime"`
  29. EquityInfoMsgType int64 `json:"EquityInfoMsgType"` // 营销权益消息需要特殊处理的消息类型
  30. NewUserMsgTitle string `json:"NewUserMsgTitle"`
  31. }
  32. type CHouseConfig struct {
  33. Addr string
  34. UserName string
  35. Password string
  36. DbName string
  37. MaxIdleConns int
  38. MaxOpenConns int
  39. }
  40. type mysqlConfig struct {
  41. DbName string
  42. Address string
  43. UserName string
  44. PassWord string
  45. MaxOpenConns int
  46. MaxIdleConns int
  47. }
  48. type mgoConf struct {
  49. Address string
  50. Size int
  51. DbName string
  52. ReplSet string
  53. UserName string
  54. Password string
  55. Collection string
  56. Collection_back string
  57. }
  58. var ConfigJson Config
  59. type WxTmplMsg struct {
  60. RpcAddr string `json:"rpcAddr"`
  61. CloseNotice string `json:"closeNotice"`
  62. Limit struct {
  63. Total int64 `json:"total"`
  64. OneDayLimit int64 `json:"oneDayLimit"`
  65. DuringMine int `json:"duringMine"`
  66. Alert struct {
  67. Nums []int64 `json:"nums"`
  68. ToMail []string `json:"toMail"`
  69. CcMail []string `json:"ccMail"`
  70. } `json:"alert"`
  71. } `json:"limit"`
  72. }