Merge remote-tracking branch 'origin/mark' into don

This commit is contained in:
Rosy-zhudan
2019-09-12 08:40:59 +08:00
9 changed files with 83 additions and 46 deletions

View File

@@ -204,7 +204,7 @@ func SendMsg2Somebody(ctx *jxcontext.Context, mobileNum, verifyCode, msgType, ms
return err
}
func checkConfig(configType, key, value string) (err error) {
func checkConfig(opFlag int, configType, key, value string) (err error) {
switch configType {
case model.ConfigTypePricePack:
if value != "" {
@@ -221,7 +221,9 @@ func checkConfig(configType, key, value string) (err error) {
}
case model.ConfigTypeRole:
case model.ConfigTypeSys:
err = fmt.Errorf("系统参数只支持修改,不支持自由添加")
if opFlag&(model.SyncFlagNewMask|model.SyncFlagDeletedMask) != 0 {
err = fmt.Errorf("系统参数只支持修改,不支持自由添加")
}
default:
err = fmt.Errorf("当前只支持配置:%s, 传入的配置类型:%s", utils.Format4Output(model.ConfigTypeName, true), configType)
}
@@ -229,7 +231,7 @@ func checkConfig(configType, key, value string) (err error) {
}
func AddConfig(ctx *jxcontext.Context, key, configType, value string) (err error) {
if err = checkConfig(configType, key, value); err != nil {
if err = checkConfig(model.SyncFlagNewMask, configType, key, value); err != nil {
return err
}
@@ -244,7 +246,7 @@ func AddConfig(ctx *jxcontext.Context, key, configType, value string) (err error
}
func DeleteConfig(ctx *jxcontext.Context, key, configType string) (err error) {
if err = checkConfig(configType, key, ""); err != nil {
if err = checkConfig(model.SyncFlagDeletedMask, configType, key, ""); err != nil {
return err
}
db := dao.GetDB()
@@ -299,7 +301,7 @@ func UpdateConfig(ctx *jxcontext.Context, key, configType, value string) (err er
if key == "" {
return fmt.Errorf("修改配置必须给定key")
}
if err = checkConfig(configType, key, value); err != nil {
if err = checkConfig(model.SyncFlagModifiedMask, configType, key, value); err != nil {
return err
}

View File

@@ -15,8 +15,10 @@ import (
"git.rosy.net.cn/jx-callback/business/jxutils/tasksch"
"git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/business/model/dao"
"git.rosy.net.cn/jx-callback/business/netspider"
"git.rosy.net.cn/jx-callback/business/partner"
"git.rosy.net.cn/jx-callback/globals"
"github.com/astaxie/beego"
)
const (
@@ -107,6 +109,10 @@ func Init() {
ScheduleTimerFunc("AutoSaleStoreSku", func() {
cms.AutoSaleStoreSku(jxcontext.AdminCtx, nil, false)
}, autoSaleStoreSkuTimeList)
if beego.BConfig.RunMode == "beta" {
netspider.GetAndStoreCitiesShops(jxcontext.AdminCtx, nil, nil, 0, 0, false, true)
}
}
func doDailyWork() {