123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- package config
- import (
- "app.yhyue.com/moapp/jybase/common"
- qrpc "app.yhyue.com/moapp/message/model"
- "github.com/gogf/gf/v2/frame/g"
- "github.com/gogf/gf/v2/os/gcfg"
- )
- type config struct {
- Nsq struct {
- Address string
- }
- Redis struct {
- Address string
- }
- Mongodb struct {
- Address string
- Size int
- DbName string
- ReplSet string
- UserName string
- Password string
- }
- Etcd struct {
- Hosts []string
- Key string
- }
- DocPoints struct {
- AppId string
- Open struct {
- Max int64
- Jyweb_article_open int64
- Jydocs_doc_open int64
- }
- Jywx_subscribe_new int64
- Jywx_subscribe_invite int64
- Jywx_subscribe_invited int64
- }
- }
- type msgConf struct {
- Title string
- Content string
- MsgType int64
- Appid string
- PcUrl string
- MobileUrl string
- }
- var (
- PushConfig *pushConfig
- )
- type LotteryReceiveReq struct {
- UserName string `json:"userName"`
- UserId string `json:"userId"`
- LotteryIdArr string `json:"lotteryIdArr"`
- }
- type pushConfig struct {
- Webdomain string `json:"webdomain"`
- Weixinrpc string `json:"weixinrpc"`
- PushPoolSize int `json:"pushPoolSize"`
- WxMsg struct {
- Id string
- First *qrpc.TmplItem
- Keyword1 *qrpc.TmplItem
- Keyword2 *qrpc.TmplItem
- Keyword3 *qrpc.TmplItem
- Keyword4 *qrpc.TmplItem
- Remark *qrpc.TmplItem
- } `json:"wxTplMsg"`
- TestId string `json:"testId"`
- DelayedTime int `json:"delayedTime"`
- Subvip string `json:"subvip"`
- Points string `json:"points"`
- FullReduce string `json:"fullReduce"`
- Messages struct {
- NewUser *msgConf
- }
- }
- type OrderMonitorConfig struct {
- DateSpecial string // 特别奖品活动日期
- OpenCron string // 每天开启订单查询的任务
- SelectCron string // 每5分钟查询一次
- WinNumberDaily int // 每天第xx个付款获得奖品
- WinNumbersSpecial int // 第xxx个付款获得特殊奖品
- Switch bool // 是否开启定时任务
- ActivityMode int // # 1. 每天第多少名 2. 活动期间内一共第多少名(双十二)
- Rules []struct { // 双十二活动规则
- WinNum []int // 获奖的下单顺序
- Mold int // 奖品 3 免单
- Products []string // # 参加活动的产品
- PriceLimit bool // 是否有实付金额限制
- PriceStart int // 实付金额最低 单位(分)
- PriceEnd int // 实付金额最高 单位(分)
- }
- }
- //var Config *config
- func init() {
- //推送配置文件
- common.ReadConfig("./etc/push.json", &PushConfig)
- //系统配置文件
- //common.ReadConfig(&Config)
- g.Cfg().GetAdapter().(*gcfg.AdapterFile).SetFileName("./etc/config.yaml")
- }
|