config.go 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. package config
  2. import (
  3. "app.yhyue.com/moapp/jybase/common"
  4. qrpc "app.yhyue.com/moapp/message/model"
  5. "github.com/gogf/gf/v2/frame/g"
  6. "github.com/gogf/gf/v2/os/gcfg"
  7. "time"
  8. )
  9. type config struct {
  10. Nsq struct {
  11. Address string
  12. }
  13. Redis struct {
  14. Address string
  15. }
  16. Mongodb struct {
  17. Address string
  18. Size int
  19. DbName string
  20. ReplSet string
  21. UserName string
  22. Password string
  23. }
  24. Etcd struct {
  25. Hosts []string
  26. Key string
  27. }
  28. DocPoints struct {
  29. AppId string
  30. Open struct {
  31. Max int64
  32. Jyweb_article_open int64
  33. Jydocs_doc_open int64
  34. }
  35. Jywx_subscribe_new int64
  36. Jywx_subscribe_invite int64
  37. Jywx_subscribe_invited int64
  38. }
  39. }
  40. var (
  41. PushConfig *pushConfig
  42. )
  43. type LotteryReceiveReq struct {
  44. UserName string `json:"userName"`
  45. UserId string `json:"userId"`
  46. LotteryIdArr string `json:"lotteryIdArr"`
  47. }
  48. type pushConfig struct {
  49. Webdomain string `json:"webdomain"`
  50. Weixinrpc string `json:"weixinrpc"`
  51. PushPoolSize int `json:"pushPoolSize"`
  52. WxMsg struct {
  53. Id string
  54. First *qrpc.TmplItem
  55. Keyword1 *qrpc.TmplItem
  56. Keyword2 *qrpc.TmplItem
  57. Keyword3 *qrpc.TmplItem
  58. Keyword4 *qrpc.TmplItem
  59. Remark *qrpc.TmplItem
  60. } `json:"wxTplMsg"`
  61. TestId string `json:"testId"`
  62. DelayedTime int `json:"delayedTime"`
  63. Subvip string `json:"subvip"`
  64. Points string `json:"points"`
  65. FullReduce string `json:"fullReduce"`
  66. }
  67. type OrderMonitorConfig struct {
  68. StartTime time.Time // 活动开始时间
  69. EndTime time.Time // 活动结束时间
  70. Date111 string // 第111名活动日期
  71. OpenCron string // 每天开启订单查询的任务
  72. SelectCron string // 每5分钟查询一次
  73. }
  74. //var Config *config
  75. func init() {
  76. //推送配置文件
  77. common.ReadConfig("./etc/push.json", &PushConfig)
  78. //系统配置文件
  79. //common.ReadConfig(&Config)
  80. g.Cfg().GetAdapter().(*gcfg.AdapterFile).SetFileName("./etc/config.yaml")
  81. }