diff --git a/business/jxcallback/orderman/orderman_ext.go b/business/jxcallback/orderman/orderman_ext.go index 437e7dc39..4fa10127c 100644 --- a/business/jxcallback/orderman/orderman_ext.go +++ b/business/jxcallback/orderman/orderman_ext.go @@ -10,7 +10,7 @@ import ( "git.rosy.net.cn/jx-callback/business/jxstore/permission" - beego "github.com/astaxie/beego/adapter" + beego "github.com/astaxie/beego/server/web" "git.rosy.net.cn/jx-callback/business/jxutils/tasksch" @@ -570,7 +570,7 @@ func (c *OrderManager) GetWaybills(ctx *jxcontext.Context, fromDateStr, toDateSt sqlParams = append(sqlParams, pageSize, offset) var waybills []*tWaybillExt db := dao.GetDB() - txDB , _ := dao.Begin(db) + txDB, _ := dao.Begin(db) defer func() { if r := recover(); r != nil { dao.Rollback(db, txDB) @@ -703,7 +703,7 @@ func (c *OrderManager) GetOrdersFinancial(ctx *jxcontext.Context, fromDateStr, t var orders []*model.OrderFinancialExt db := dao.GetDB() - txDB , _ := dao.Begin(db) + txDB, _ := dao.Begin(db) defer func() { if r := recover(); r != nil { dao.Rollback(db, txDB) @@ -1020,7 +1020,7 @@ func (c *OrderManager) GetAfsOrders(ctx *jxcontext.Context, keyword, afsOrderID, var orders []*model.AfsOrder db := dao.GetDB() - txDB , _ := dao.Begin(db) + txDB, _ := dao.Begin(db) defer func() { if r := recover(); r != nil || err != nil { dao.Rollback(db, txDB) diff --git a/business/jxcallback/scheduler/defsch/defsch.go b/business/jxcallback/scheduler/defsch/defsch.go index c91f455c0..5f9621b32 100644 --- a/business/jxcallback/scheduler/defsch/defsch.go +++ b/business/jxcallback/scheduler/defsch/defsch.go @@ -10,7 +10,7 @@ import ( push "git.rosy.net.cn/jx-callback/business/jxutils/unipush" - beego "github.com/astaxie/beego/adapter" + beego "github.com/astaxie/beego/server/web" "git.rosy.net.cn/jx-callback/business/jxstore/cms" diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index 7a54afa7a..4c86a9b6a 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -11,7 +11,7 @@ import ( "strings" "time" - beego "github.com/astaxie/beego/adapter" + beego "github.com/astaxie/beego/server/web" "git.rosy.net.cn/baseapi/platformapi/aliupcapi" "git.rosy.net.cn/baseapi/utils" @@ -169,7 +169,7 @@ func AddCategory(ctx *jxcontext.Context, cat *model.SkuCategory, userName string } cat.Seq = maxSeq.MaxSeq + 1 } - txDB , _ := dao.Begin(db) + txDB, _ := dao.Begin(db) defer func() { if r := recover(); r != nil { dao.Rollback(db, txDB) @@ -230,7 +230,7 @@ func UpdateCategory(ctx *jxcontext.Context, categoryID int, payload map[string]i } } - txDB , _ := dao.Begin(db) + txDB, _ := dao.Begin(db) defer func() { if r := recover(); r != nil { dao.Rollback(db, txDB) @@ -326,7 +326,7 @@ func ReorderCategories(ctx *jxcontext.Context, parentID int, categoryIDs []int, catsMap[cat.ID] = cat } - txDB , _ := dao.Begin(db) + txDB, _ := dao.Begin(db) defer func() { if r := recover(); r != nil { dao.Rollback(db, txDB) @@ -390,7 +390,7 @@ func DeleteCategory(ctx *jxcontext.Context, categoryID int, userName string) (nu } else if countInfos[2].Ct != 0 { return 0, errors.New("还有商品类别使用此类别,不能删除") } - txDB , _ := dao.Begin(db) + txDB, _ := dao.Begin(db) defer func() { if r := recover(); r != nil { dao.Rollback(db, txDB) @@ -636,7 +636,7 @@ func GetSkuNames(ctx *jxcontext.Context, keyword string, isBySku, isQueryMidPric offset = jxutils.FormalizePageOffset(offset) sqlParams = append(sqlParams, pageSize, offset) skuNamesInfo = &SkuNamesInfo{} - txDB , _ := dao.Begin(db) // todo 这里用事务的原因是,SQL_CALC_FOUND_ROWS会出错 + txDB, _ := dao.Begin(db) // todo 这里用事务的原因是,SQL_CALC_FOUND_ROWS会出错 defer func() { if r := recover(); r != nil { dao.Rollback(db, txDB) @@ -857,7 +857,7 @@ func AddSkuName(ctx *jxcontext.Context, skuNameExt *model.SkuNameExt, userName s } } - txDB , _ := dao.Begin(db) + txDB, _ := dao.Begin(db) defer func() { if r := recover(); r != nil { dao.Rollback(db, txDB) @@ -978,7 +978,7 @@ func UpdateSkuName(ctx *jxcontext.Context, nameID int, payload map[string]interf if payload["eclpID"] != nil { eclpID = payload["eclpID"].(string) } - txDB , _ := dao.Begin(db) + txDB, _ := dao.Begin(db) defer func() { if r := recover(); r != nil { dao.Rollback(db, txDB) @@ -1144,7 +1144,7 @@ func SetStoreSkuSyncStatus2(db *dao.DaoDB, storeIDs []int, vendorIDs, skuIDs []i func DeleteSkuName(ctx *jxcontext.Context, nameID int, userName string) (num int64, err error) { db := dao.GetDB() - txDB , _ := dao.Begin(db) + txDB, _ := dao.Begin(db) defer func() { if r := recover(); r != nil { dao.Rollback(db, txDB) @@ -1223,7 +1223,7 @@ func AddSku(ctx *jxcontext.Context, nameID int, sku *model.Sku, userName string) sku.LadderBoxPrice = 10 } sku.LadderBoxNum = 1 - txDB , _ := dao.Begin(db) + txDB, _ := dao.Begin(db) defer func() { if r := recover(); r != nil { dao.Rollback(db, txDB) @@ -1292,7 +1292,7 @@ func UpdateSku(ctx *jxcontext.Context, skuID int, payload map[string]interface{} valid := dao.StrictMakeMapByStructObject(payload, sku, userName) if len(valid) > 0 { // globals.SugarLogger.Debug(utils.Format4Output(valid, false)) - txDB , _ := dao.Begin(db) + txDB, _ := dao.Begin(db) defer func() { if r := recover(); r != nil { dao.Rollback(db, txDB) @@ -1372,7 +1372,7 @@ func refreshStoreSkuPrice(ctx *jxcontext.Context, db *dao.DaoDB, skuID int) (err storeSku.JxPrice = jxutils.CaculatePriceByPricePack(storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage), int(storeSku.Price)) storeSku.LastOperator = ctx.GetUserName() storeSku.UpdatedAt = time.Now() - txDB , _ := dao.Begin(db) + txDB, _ := dao.Begin(db) defer func() { if r := recover(); r != nil || err != nil { dao.Rollback(db, txDB) @@ -1392,7 +1392,7 @@ func refreshStoreSkuPrice(ctx *jxcontext.Context, db *dao.DaoDB, skuID int) (err func DeleteSku(ctx *jxcontext.Context, skuID int, userName string) (num int64, err error) { db := dao.GetDB() - txDB , _ := dao.Begin(db) + txDB, _ := dao.Begin(db) defer func() { if r := recover(); r != nil { dao.Rollback(db, txDB) @@ -1474,7 +1474,7 @@ func AddSkuNamePlace(ctx *jxcontext.Context, nameID, placeCode int, userName str } dao.WrapAddIDCULEntity(placeBind, userName) - txDB , _ := dao.Begin(db) + txDB, _ := dao.Begin(db) defer func() { if r := recover(); r != nil { dao.Rollback(db, txDB) @@ -1501,7 +1501,7 @@ func DeleteSkuNamePlace(ctx *jxcontext.Context, nameID, placeCode int, userName placeBind.NameID = nameID placeBind.PlaceCode = placeCode - txDB , _ := dao.Begin(db) + txDB, _ := dao.Begin(db) defer func() { if r := recover(); r != nil { dao.Rollback(db, txDB) @@ -1550,7 +1550,7 @@ func SortCategorySkus(ctx *jxcontext.Context, catID int, skuIDList []int) (err e } } - txDB , _ := dao.Begin(db) + txDB, _ := dao.Begin(db) defer func() { if r := recover(); r != nil { dao.Rollback(db, txDB) @@ -1718,7 +1718,7 @@ func UpdateSkuNamesExPrefix(ctx *jxcontext.Context, nameIDs []int, imgWaterMark skuName.ID = nameID skuName.LastOperator = ctx.GetLoginID() skuName.UpdatedAt = time.Now() - txDB , _ := dao.Begin(db) + txDB, _ := dao.Begin(db) defer func() { if r := recover(); r != nil { dao.Rollback(db, txDB) @@ -2689,7 +2689,7 @@ func AddVendorCategoryMap(ctx *jxcontext.Context, vendorCategoryMap *model.Vendo vendorOrgCodes, _ := dao.GetVendorOrgCode(db, vendorCategoryMap.VendorID, vendorCategoryMap.VendorOrgCode, model.VendorOrgTypePlatform) vendorCategoryMap.VendorCategoryName = strings.Trim(vendorCategoryMap.VendorCategoryName, " ") dao.WrapAddIDCULDEntity(vendorCategoryMap, ctx.GetUserName()) - txDB , _ := dao.Begin(db) + txDB, _ := dao.Begin(db) defer func() { if r := recover(); r != nil { dao.Rollback(db, txDB) @@ -2800,7 +2800,7 @@ func UpdateVendorCategoryMap(ctx *jxcontext.Context, ID int, vendorCategoryMap * } } vendorOrgCodes, err := dao.GetVendorOrgCode(db, vendorCategoryMap2.VendorID, vendorCategoryMap2.VendorOrgCode, model.VendorOrgTypePlatform) - txDB , _ := dao.Begin(db) + txDB, _ := dao.Begin(db) defer func() { if r := recover(); r != nil { dao.Rollback(db, txDB) @@ -2834,7 +2834,7 @@ func ReorderVendorCategories(ctx *jxcontext.Context, parentID, vendorID int, ven for _, cat := range vendorCatsMap { catsMap[cat.CategoryID] = cat } - txDB , _ := dao.Begin(db) + txDB, _ := dao.Begin(db) defer func() { if r := recover(); r != nil { dao.Rollback(db, txDB) @@ -2871,7 +2871,7 @@ func LoadStoreVendorCategories(ctx *jxcontext.Context, vendorOrgCode string, ven if vendorCatMap, _ := dao.GetVendorCategoryMap(db, -1, 0, vendorID, vendorOrgCode, 0); len(vendorCatMap) > 0 { return fmt.Errorf("该账号下已有分类,请在这里修改!") } - txDB , _ := dao.Begin(db) + txDB, _ := dao.Begin(db) defer func() { if r := recover(); r != nil { dao.Rollback(db, txDB) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 92073dd06..652764e6c 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -17,7 +17,7 @@ import ( "git.rosy.net.cn/jx-callback/business/auth2" - beego "github.com/astaxie/beego/adapter" + beego "github.com/astaxie/beego/server/web" "git.rosy.net.cn/baseapi/platformapi/jdshopapi" diff --git a/business/jxstore/cms/store_sku_check.go b/business/jxstore/cms/store_sku_check.go index d10af11cd..39eca8704 100644 --- a/business/jxstore/cms/store_sku_check.go +++ b/business/jxstore/cms/store_sku_check.go @@ -8,7 +8,6 @@ import ( "git.rosy.net.cn/baseapi/platformapi/dingdingapi" "git.rosy.net.cn/jx-callback/business/jxutils/ddmsg" - beego "github.com/astaxie/beego/adapter" "git.rosy.net.cn/jx-callback/business/model/dao" @@ -1072,7 +1071,7 @@ func TestDiff(ctx *jxcontext.Context, vendorIDList []int, storeIDList []int) { go func() { defer func() { if recover() != nil { - beego.Info("执行任务失败") + // beego.Info("执行任务失败") panic("API调用失败") } }() @@ -1090,7 +1089,7 @@ func TestDiff(ctx *jxcontext.Context, vendorIDList []int, storeIDList []int) { go func() { defer func() { if recover() != nil { - beego.Info("比较任务失败") + // beego.Info("比较任务失败") panic("比较任务失败") } }() @@ -1102,7 +1101,7 @@ func TestDiff(ctx *jxcontext.Context, vendorIDList []int, storeIDList []int) { go func() { defer func() { if recover() != nil { - beego.Info("写入任务失败") + // beego.Info("写入任务失败") panic("写入任务失败") } }() diff --git a/business/jxstore/misc/misc.go b/business/jxstore/misc/misc.go index b9a1c76a3..dce5ff14e 100644 --- a/business/jxstore/misc/misc.go +++ b/business/jxstore/misc/misc.go @@ -32,7 +32,7 @@ import ( "git.rosy.net.cn/jx-callback/business/netspider" "git.rosy.net.cn/jx-callback/business/partner" "git.rosy.net.cn/jx-callback/globals" - beego "github.com/astaxie/beego/adapter" + beego "github.com/astaxie/beego/server/web" ) const ( diff --git a/business/jxutils/jxutils_cms.go b/business/jxutils/jxutils_cms.go index ae1f8136b..87605528b 100644 --- a/business/jxutils/jxutils_cms.go +++ b/business/jxutils/jxutils_cms.go @@ -17,7 +17,7 @@ import ( "sync" "time" - beego "github.com/astaxie/beego/adapter" + beego "github.com/astaxie/beego/server/web" "git.rosy.net.cn/baseapi/platformapi" "git.rosy.net.cn/baseapi/utils" diff --git a/business/jxutils/tasks/configrefresh.go b/business/jxutils/tasks/configrefresh.go index df2cdcb11..94caac742 100644 --- a/business/jxutils/tasks/configrefresh.go +++ b/business/jxutils/tasks/configrefresh.go @@ -19,8 +19,8 @@ import ( "git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/jx-callback/globals" - beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/client/orm" + beego "github.com/astaxie/beego/server/web" ) const ( diff --git a/business/jxutils/unipush/push.go b/business/jxutils/unipush/push.go index 8e2c2e0ea..ccff75e10 100644 --- a/business/jxutils/unipush/push.go +++ b/business/jxutils/unipush/push.go @@ -11,7 +11,7 @@ import ( "git.rosy.net.cn/jx-callback/business/model/dao" "git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals/api" - beego "github.com/astaxie/beego/adapter" + beego "github.com/astaxie/beego/server/web" ) func pushToSingle(content, title string, storeID int) { diff --git a/business/jxutils/weixinmsg/weixinmsg.go b/business/jxutils/weixinmsg/weixinmsg.go index 94210798e..4a39bc1a0 100644 --- a/business/jxutils/weixinmsg/weixinmsg.go +++ b/business/jxutils/weixinmsg/weixinmsg.go @@ -7,7 +7,7 @@ import ( "strings" "time" - beego "github.com/astaxie/beego/adapter" + beego "github.com/astaxie/beego/server/web" "git.rosy.net.cn/jx-callback/business/auth2/authprovider/weixin" "git.rosy.net.cn/jx-callback/business/authz/autils" @@ -819,7 +819,7 @@ func SendStoreMessage(ctx *jxcontext.Context, title, content string, storeIDs [] storeIDs = storeIDs2 } } - txDB , _ := dao.Begin(db) + txDB, _ := dao.Begin(db) defer func() { if r := recover(); r != nil { dao.Rollback(db, txDB) @@ -920,7 +920,7 @@ func NotifyAdjustOrder(order *model.GoodsOrder) (err error) { func SendUserMessage(ctx *jxcontext.Context, title, content string, userIDs []string, isAsync, isContinueWhenError bool) (hint string, err error) { db := dao.GetDB() - txDB , _ := dao.Begin(db) + txDB, _ := dao.Begin(db) defer func() { if r := recover(); r != nil { dao.Rollback(db, txDB) diff --git a/business/partner/delivery/dada/waybill.go b/business/partner/delivery/dada/waybill.go index c5ea3011c..40372672e 100644 --- a/business/partner/delivery/dada/waybill.go +++ b/business/partner/delivery/dada/waybill.go @@ -14,7 +14,7 @@ import ( "git.rosy.net.cn/jx-callback/business/partner/delivery" "git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals/api" - beego "github.com/astaxie/beego/adapter" + beego "github.com/astaxie/beego/server/web" ) const ( diff --git a/business/partner/delivery/fn/waybill.go b/business/partner/delivery/fn/waybill.go index 1af0fc91b..5fa1418d5 100644 --- a/business/partner/delivery/fn/waybill.go +++ b/business/partner/delivery/fn/waybill.go @@ -6,8 +6,8 @@ import ( "time" "git.rosy.net.cn/baseapi/utils" - beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/client/orm" + beego "github.com/astaxie/beego/server/web" "git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/partner/delivery" diff --git a/business/partner/delivery/mtps/waybill.go b/business/partner/delivery/mtps/waybill.go index d6cf5924e..b3105e0d2 100644 --- a/business/partner/delivery/mtps/waybill.go +++ b/business/partner/delivery/mtps/waybill.go @@ -20,8 +20,8 @@ import ( "git.rosy.net.cn/jx-callback/business/partner/delivery" "git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals/api" - beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/client/orm" + beego "github.com/astaxie/beego/server/web" ) const ( diff --git a/business/partner/purchase/ebai/order.go b/business/partner/purchase/ebai/order.go index e478f2e9e..a3faa82ea 100644 --- a/business/partner/purchase/ebai/order.go +++ b/business/partner/purchase/ebai/order.go @@ -6,7 +6,7 @@ import ( "strings" "time" - beego "github.com/astaxie/beego/adapter" + beego "github.com/astaxie/beego/server/web" "git.rosy.net.cn/jx-callback/business/jxutils/tasksch" diff --git a/business/partner/purchase/jd/sku2.go b/business/partner/purchase/jd/sku2.go index 9e142dc43..85ec25b6c 100644 --- a/business/partner/purchase/jd/sku2.go +++ b/business/partner/purchase/jd/sku2.go @@ -14,7 +14,7 @@ import ( "git.rosy.net.cn/jx-callback/business/partner" "git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals/api" - beego "github.com/astaxie/beego/adapter" + beego "github.com/astaxie/beego/server/web" ) const ( diff --git a/business/partner/purchase/jdshop/callback.go b/business/partner/purchase/jdshop/callback.go index e3a762075..7c753dada 100644 --- a/business/partner/purchase/jdshop/callback.go +++ b/business/partner/purchase/jdshop/callback.go @@ -13,7 +13,7 @@ import ( "git.rosy.net.cn/jx-callback/business/partner/delivery/dada" "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" - beego "github.com/astaxie/beego/adapter" + beego "github.com/astaxie/beego/server/web" "git.rosy.net.cn/baseapi/platformapi/dadaapi" "git.rosy.net.cn/baseapi/platformapi/dingdingapi" diff --git a/controllers/act.go b/controllers/act.go index d1f0fe28b..a48c447bd 100644 --- a/controllers/act.go +++ b/controllers/act.go @@ -7,11 +7,11 @@ import ( "git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model/dao" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) type ActController struct { - beego.Controller + web.Controller } // @Title 预创建活动 @@ -240,7 +240,7 @@ func (c *ActController) UpdateActStoreSkuBind() { err = fmt.Errorf("actStoreSkuAddList与actStoreSkuDeleteList不能都为空") } else { db := dao.GetDB() - txDB , _ := dao.Begin(db) + txDB, _ := dao.Begin(db) func() { defer func() { if r := recover(); r != nil { diff --git a/controllers/auth2.go b/controllers/auth2.go index 663d39df9..ebf40e638 100644 --- a/controllers/auth2.go +++ b/controllers/auth2.go @@ -16,10 +16,10 @@ import ( "git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model/dao" "git.rosy.net.cn/jx-callback/globals" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) -func GetComposedCode(c *beego.Controller, code string) (composedCode string) { +func GetComposedCode(c *web.Controller, code string) (composedCode string) { composedCode = code referer := c.Ctx.Request.Referer() globals.SugarLogger.Debugf("GetComposedCode referer:%s", referer) @@ -34,7 +34,7 @@ func GetComposedCode(c *beego.Controller, code string) (composedCode string) { } type Auth2Controller struct { - beego.Controller + web.Controller } // @Title 生成captcha diff --git a/controllers/auth_controller.go b/controllers/auth_controller.go index 6ccdf70df..4fe56f1dd 100644 --- a/controllers/auth_controller.go +++ b/controllers/auth_controller.go @@ -8,7 +8,7 @@ package controllers // // 认证相关API // type AuthController struct { -// beego.Controller +// web.Controller // } // var ( diff --git a/controllers/cms.go b/controllers/cms.go index b1cd2496e..42162f966 100644 --- a/controllers/cms.go +++ b/controllers/cms.go @@ -10,11 +10,11 @@ import ( "git.rosy.net.cn/jx-callback/business/msghub" "git.rosy.net.cn/jx-callback/globals/api" "git.rosy.net.cn/jx-callback/globals/api/apimanager" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) type CmsController struct { - beego.Controller + web.Controller } // @Title 得到地点(省,城市,区)信息 diff --git a/controllers/cms_food_recipe.go b/controllers/cms_food_recipe.go index 5a9a5adc5..5c5f58ae8 100644 --- a/controllers/cms_food_recipe.go +++ b/controllers/cms_food_recipe.go @@ -4,11 +4,11 @@ import ( "git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/userstore" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) type FoodRecipeController struct { - beego.Controller + web.Controller } // @Title 创建菜谱 diff --git a/controllers/cms_msg.go b/controllers/cms_msg.go index 46828516a..b59ee1e44 100644 --- a/controllers/cms_msg.go +++ b/controllers/cms_msg.go @@ -8,11 +8,11 @@ import ( "git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/jxutils/weixinmsg" "git.rosy.net.cn/jx-callback/business/model" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) type MsgController struct { - beego.Controller + web.Controller } // @Title 发送微信消息 diff --git a/controllers/cms_sku.go b/controllers/cms_sku.go index 56fb07651..4a497dc2a 100644 --- a/controllers/cms_sku.go +++ b/controllers/cms_sku.go @@ -8,11 +8,11 @@ import ( "git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model/dao" "git.rosy.net.cn/jx-callback/globals" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) type SkuController struct { - beego.Controller + web.Controller } // @Title 得到厂商商品类别 diff --git a/controllers/cms_store.go b/controllers/cms_store.go index f5ee63c87..6f8755872 100644 --- a/controllers/cms_store.go +++ b/controllers/cms_store.go @@ -9,11 +9,11 @@ import ( "git.rosy.net.cn/jx-callback/business/jxutils/netprinter" "git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/globals/api" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) type StoreController struct { - beego.Controller + web.Controller } // @Title 得到京西门店信息 diff --git a/controllers/cms_store_sku.go b/controllers/cms_store_sku.go index 49c571d3e..574f257f4 100644 --- a/controllers/cms_store_sku.go +++ b/controllers/cms_store_sku.go @@ -11,11 +11,11 @@ import ( "git.rosy.net.cn/jx-callback/business/jxstore/cms" "git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/model/dao" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) type StoreSkuController struct { - beego.Controller + web.Controller } // @Title 得到商家商品信息 diff --git a/controllers/cms_sync.go b/controllers/cms_sync.go index 28725f12f..4cb237e7f 100644 --- a/controllers/cms_sync.go +++ b/controllers/cms_sync.go @@ -9,11 +9,11 @@ import ( "git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model/dao" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) type SyncController struct { - beego.Controller + web.Controller } // @Title 同步商家商品信息 diff --git a/controllers/cms_task.go b/controllers/cms_task.go index 966809d17..4fddb5b74 100644 --- a/controllers/cms_task.go +++ b/controllers/cms_task.go @@ -8,11 +8,11 @@ import ( "git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/jxutils/tasksch" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) type TaskController struct { - beego.Controller + web.Controller } // @Title 查询长时间运行任务 diff --git a/controllers/cms_user.go b/controllers/cms_user.go index 695674526..3dcd63404 100644 --- a/controllers/cms_user.go +++ b/controllers/cms_user.go @@ -1,7 +1,7 @@ package controllers // type UserController struct { -// beego.Controller +// web.Controller // } // // @Title 得到门店用户信息 diff --git a/controllers/dada_order.go b/controllers/dada_order.go index 72b6c0082..85c07ff2d 100644 --- a/controllers/dada_order.go +++ b/controllers/dada_order.go @@ -8,12 +8,12 @@ import ( "git.rosy.net.cn/jx-callback/business/partner/delivery/dada" "git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals/api" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) // Operations about ELMOrder type DadaDeliveryController struct { - beego.Controller + web.Controller } func (c *DadaDeliveryController) Msg() { diff --git a/controllers/dingding_api.go b/controllers/dingding_api.go index 8e23e435e..4f9cc9a53 100644 --- a/controllers/dingding_api.go +++ b/controllers/dingding_api.go @@ -8,11 +8,11 @@ import ( "git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals/api" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) type DDAPIController struct { - beego.Controller + web.Controller } type DDAPI struct { diff --git a/controllers/dingding_callback.go b/controllers/dingding_callback.go index c13767205..b6696ff23 100644 --- a/controllers/dingding_callback.go +++ b/controllers/dingding_callback.go @@ -7,11 +7,11 @@ import ( "git.rosy.net.cn/jx-callback/business/jxstore/cms" "git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals/api" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) type DingDingController struct { - beego.Controller + web.Controller } func init() { diff --git a/controllers/ebai_callback.go b/controllers/ebai_callback.go index fe2f6adfe..6a10eeb16 100644 --- a/controllers/ebai_callback.go +++ b/controllers/ebai_callback.go @@ -6,11 +6,11 @@ import ( "git.rosy.net.cn/baseapi/platformapi/ebaiapi" "git.rosy.net.cn/jx-callback/business/partner/purchase/ebai" "git.rosy.net.cn/jx-callback/globals/api" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) type EbaiController struct { - beego.Controller + web.Controller } func (c *EbaiController) Msg() { diff --git a/controllers/eclp_callback.go b/controllers/eclp_callback.go index 543d2a87d..5f839de4a 100644 --- a/controllers/eclp_callback.go +++ b/controllers/eclp_callback.go @@ -4,11 +4,11 @@ import ( "fmt" "net/http" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) type EclpController struct { - beego.Controller + web.Controller } func (c *EclpController) Msg() { diff --git a/controllers/elm_order.go b/controllers/elm_order.go index a66f60f4a..f802bb75e 100644 --- a/controllers/elm_order.go +++ b/controllers/elm_order.go @@ -4,12 +4,12 @@ import ( "net/http" "git.rosy.net.cn/baseapi/platformapi/elmapi" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) // Operations about ELMOrder type ElemeController struct { - beego.Controller + web.Controller } // https://open.shop.ele.me/openapi/documents/httppushmethod diff --git a/controllers/event.go b/controllers/event.go index 75a33b230..18088cb04 100644 --- a/controllers/event.go +++ b/controllers/event.go @@ -20,12 +20,12 @@ import ( "git.rosy.net.cn/jx-callback/business/jxstore/event" "git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/globals/api" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) // 操作事件明细相关API type EventController struct { - beego.Controller + web.Controller } //连接的客户端,吧每个客户端都放进来 diff --git a/controllers/financial.go b/controllers/financial.go index 0d102f597..69dec4879 100644 --- a/controllers/financial.go +++ b/controllers/financial.go @@ -4,7 +4,7 @@ import ( "fmt" "io" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" "git.rosy.net.cn/jx-callback/business/jxcallback/orderman" "git.rosy.net.cn/jx-callback/business/jxstore/financial" @@ -13,7 +13,7 @@ import ( ) type FinancialController struct { - beego.Controller + web.Controller } // @Title 发送文件给门店 diff --git a/controllers/fn_callback.go b/controllers/fn_callback.go index 74ea714e2..b97d15a74 100644 --- a/controllers/fn_callback.go +++ b/controllers/fn_callback.go @@ -11,11 +11,11 @@ import ( "git.rosy.net.cn/jx-callback/globals/api" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) type FnController struct { - beego.Controller + web.Controller } func (c *FnController) Msg() { diff --git a/controllers/init_data.go b/controllers/init_data.go index 9232cf029..07a2fdecf 100644 --- a/controllers/init_data.go +++ b/controllers/init_data.go @@ -2,11 +2,11 @@ package controllers import ( "git.rosy.net.cn/jx-callback/business/jxstore/initdata" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) type InitDataController struct { - beego.Controller + web.Controller } // @Title 初始化place信息 diff --git a/controllers/jd2_callback.go b/controllers/jd2_callback.go index 186307acc..4a0ad163a 100644 --- a/controllers/jd2_callback.go +++ b/controllers/jd2_callback.go @@ -9,12 +9,12 @@ import ( "git.rosy.net.cn/jx-callback/business/partner/purchase/jd" "git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals/api" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) // Operations about JDOrder type Djsw2Controller struct { - beego.Controller + web.Controller } func (c *Djsw2Controller) handleMsg(handler func(*jdapi.API, interface{}) *jdapi.CallbackResponse) (callbackResponse *jdapi.CallbackResponse) { diff --git a/controllers/jd_callback.go b/controllers/jd_callback.go index 25a505b58..0d6385e40 100644 --- a/controllers/jd_callback.go +++ b/controllers/jd_callback.go @@ -12,12 +12,12 @@ import ( "git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/jx-callback/business/partner/purchase/jd" "git.rosy.net.cn/jx-callback/globals" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) // Operations about JDOrder type DjswController struct { - beego.Controller + web.Controller } func (c *DjswController) handleMsg(handler func(*jdapi.API, interface{}) *jdapi.CallbackResponse) (callbackResponse *jdapi.CallbackResponse) { diff --git a/controllers/jds_callback.go b/controllers/jds_callback.go index 1f0890dce..8d65e9138 100644 --- a/controllers/jds_callback.go +++ b/controllers/jds_callback.go @@ -10,11 +10,11 @@ import ( "git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals/api" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) type JdsController struct { - beego.Controller + web.Controller } func (c *JdsController) Msg() { diff --git a/controllers/jx_order.go b/controllers/jx_order.go index 1122937a7..ec9f8dd81 100644 --- a/controllers/jx_order.go +++ b/controllers/jx_order.go @@ -16,12 +16,12 @@ import ( "git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model/dao" "git.rosy.net.cn/jx-callback/globals" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) // 订单相关API type OrderController struct { - beego.Controller + web.Controller } func (c *OrderController) URLMapping() { diff --git a/controllers/jx_order2.go b/controllers/jx_order2.go index 8a5909c65..16e221e3b 100644 --- a/controllers/jx_order2.go +++ b/controllers/jx_order2.go @@ -5,11 +5,11 @@ import ( "git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/partner/purchase/jx/localjx" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) type JxOrderController struct { - beego.Controller + web.Controller } // @Title 创建京西商城订单 diff --git a/controllers/jx_report.go b/controllers/jx_report.go index 0e02119cb..582972f92 100644 --- a/controllers/jx_report.go +++ b/controllers/jx_report.go @@ -4,12 +4,12 @@ import ( "git.rosy.net.cn/jx-callback/business/jxstore/cms" "git.rosy.net.cn/jx-callback/business/jxstore/report" "git.rosy.net.cn/jx-callback/business/jxutils" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) // 统计相关API type ReportController struct { - beego.Controller + web.Controller } // @Title 查询订单统计信息 diff --git a/controllers/jxshop_callback.go b/controllers/jxshop_callback.go index 8d6a523de..91dbc8ed7 100644 --- a/controllers/jxshop_callback.go +++ b/controllers/jxshop_callback.go @@ -2,11 +2,11 @@ package controllers import ( "git.rosy.net.cn/jx-callback/business/partner/purchase/jx/phpjx" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) type JxShopController struct { - beego.Controller + web.Controller } // @Title 京西自营商城消息回调接口 diff --git a/controllers/mtps_order.go b/controllers/mtps_order.go index 6b51e6c8b..9dc7cee5d 100644 --- a/controllers/mtps_order.go +++ b/controllers/mtps_order.go @@ -5,12 +5,12 @@ import ( "git.rosy.net.cn/jx-callback/business/partner/delivery/mtps" "git.rosy.net.cn/jx-callback/globals/api" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) // Operations about ELMOrder type MtpsController struct { - beego.Controller + web.Controller } func (c *MtpsController) Status() { diff --git a/controllers/mtwm_callback.go b/controllers/mtwm_callback.go index 01e06b18e..25c8e6910 100644 --- a/controllers/mtwm_callback.go +++ b/controllers/mtwm_callback.go @@ -4,11 +4,11 @@ import ( "git.rosy.net.cn/baseapi/platformapi/mtwmapi" "git.rosy.net.cn/jx-callback/business/partner/purchase/mtwm" "git.rosy.net.cn/jx-callback/globals/api" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) type MtwmController struct { - beego.Controller + web.Controller } func (c *MtwmController) onCallbackMsg(msgType string) { diff --git a/controllers/net_spider.go b/controllers/net_spider.go index 31ca19b42..f73ce36ad 100644 --- a/controllers/net_spider.go +++ b/controllers/net_spider.go @@ -9,11 +9,11 @@ import ( "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" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) type NetSpiderController struct { - beego.Controller + web.Controller } // @Title 从网页拉取平台门店信息 diff --git a/controllers/permission.go b/controllers/permission.go index 400ddb849..3d9b3df00 100644 --- a/controllers/permission.go +++ b/controllers/permission.go @@ -5,11 +5,11 @@ import ( "git.rosy.net.cn/jx-callback/business/jxstore/permission" "git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/model" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) type PowerController struct { - beego.Controller + web.Controller } // @Title 添加功能(菜单) diff --git a/controllers/sys.go b/controllers/sys.go index b09fa4e73..a62d8e2ac 100644 --- a/controllers/sys.go +++ b/controllers/sys.go @@ -16,11 +16,11 @@ import ( "git.rosy.net.cn/jx-callback/business/jxutils/eventhub/syseventhub" "git.rosy.net.cn/jx-callback/business/model" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) type SysController struct { - beego.Controller + web.Controller } // @Title 得到微信token diff --git a/controllers/temp_op.go b/controllers/temp_op.go index 15b58cd7f..bf297df1d 100644 --- a/controllers/temp_op.go +++ b/controllers/temp_op.go @@ -5,11 +5,11 @@ import ( "git.rosy.net.cn/jx-callback/business/jxstore/misc" "git.rosy.net.cn/jx-callback/business/jxstore/tempop" "git.rosy.net.cn/jx-callback/business/jxutils" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) type TempOpController struct { - beego.Controller + web.Controller } // @Title 将为份的商品在京东转成SPU diff --git a/controllers/tonglian_callback.go b/controllers/tonglian_callback.go index 93805b0d1..e19c3ae56 100644 --- a/controllers/tonglian_callback.go +++ b/controllers/tonglian_callback.go @@ -11,12 +11,12 @@ import ( "git.rosy.net.cn/jx-callback/business/partner/purchase/jx/localjx" "git.rosy.net.cn/jx-callback/globals" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" "github.com/astaxie/beego/server/web/context" ) type TongLianController struct { - beego.Controller + web.Controller } func (c *TongLianController) Msg() { diff --git a/controllers/weimob_callback.go b/controllers/weimob_callback.go index 6d07fb2bc..4c9e3707e 100644 --- a/controllers/weimob_callback.go +++ b/controllers/weimob_callback.go @@ -6,11 +6,11 @@ import ( "git.rosy.net.cn/jx-callback/business/jxutils/tasks" "git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals/api" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) type WeimobController struct { - beego.Controller + web.Controller } func (c *WeimobController) onCallbackMsg() { diff --git a/controllers/weixin_callback.go b/controllers/weixin_callback.go index b4d543515..cb1eec3a1 100644 --- a/controllers/weixin_callback.go +++ b/controllers/weixin_callback.go @@ -5,11 +5,11 @@ import ( "git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals/api" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) type WeixinController struct { - beego.Controller + web.Controller } func (c *WeixinController) Msg() { diff --git a/controllers/wxpay_callback.go b/controllers/wxpay_callback.go index a3596eaf8..fe3c11176 100644 --- a/controllers/wxpay_callback.go +++ b/controllers/wxpay_callback.go @@ -9,11 +9,11 @@ import ( "git.rosy.net.cn/jx-callback/business/partner/purchase/jx/localjx" "git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals/api" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) type WXPayController struct { - beego.Controller + web.Controller } func (c *WXPayController) Msg() { diff --git a/controllers/yonghui.go b/controllers/yonghui.go index 711d32a7f..03bc79fa4 100644 --- a/controllers/yonghui.go +++ b/controllers/yonghui.go @@ -5,12 +5,12 @@ import ( "git.rosy.net.cn/jx-callback/business/jxstore/yonghui" "git.rosy.net.cn/jx-callback/business/jxutils" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) //读取永辉excelAPI type YongHuiController struct { - beego.Controller + web.Controller } // @Title 读取永辉excel文件 diff --git a/globals/api/api.go b/globals/api/api.go index d5876a338..028eca2f6 100644 --- a/globals/api/api.go +++ b/globals/api/api.go @@ -41,7 +41,7 @@ import ( "git.rosy.net.cn/jx-callback/business/jxutils/cache/redis" "git.rosy.net.cn/jx-callback/globals" - beego "github.com/astaxie/beego/adapter" + beego "github.com/astaxie/beego/server/web" "github.com/qiniu/api.v7/auth/qbox" ) @@ -113,7 +113,7 @@ func init() { func Init() { if !beego.AppConfig.DefaultBool("disableJd", false) { //初始化京东api - // JdAPI = jdapi.New(beego.AppConfig.String("jdToken"), beego.AppConfig.String("jdAppKey"), beego.AppConfig.String("jdSecret")) + // JdAPI = jdapi.New(beego.AppConfig.DefaultString("jdToken"), beego.AppConfig.DefaultString("jdAppKey"), beego.AppConfig.DefaultString("jdSecret")) JdAPI = jdapi.New("", "", "") conf := platformapi.NewDefAPIConfig() @@ -121,54 +121,54 @@ func Init() { JdPageAPI = jdapi.NewPageOnly("", conf) if globals.Jd2OrgCode != "" { - // Jd2API = jdapi.New(beego.AppConfig.String("jd2Token"), beego.AppConfig.String("jd2AppKey"), beego.AppConfig.String("jd2Secret")) + // Jd2API = jdapi.New(beego.AppConfig.DefaultString("jd2Token"), beego.AppConfig.DefaultString("jd2AppKey"), beego.AppConfig.DefaultString("jd2Secret")) Jd2API = jdapi.New("", "", "") } if globals.Jd3OrgCode != "" { - // Jd3API = jdapi.New(beego.AppConfig.String("jd3Token"), beego.AppConfig.String("jd3AppKey"), beego.AppConfig.String("jd3Secret")) + // Jd3API = jdapi.New(beego.AppConfig.DefaultString("jd3Token"), beego.AppConfig.DefaultString("jd3AppKey"), beego.AppConfig.DefaultString("jd3Secret")) Jd3API = jdapi.New("", "", "") } if globals.JdcsOrgCode != "" { - // JdcsAPI = jdapi.New(beego.AppConfig.String("jdcsToken"), beego.AppConfig.String("jdcsAppKey"), beego.AppConfig.String("jdcsSecret")) + // JdcsAPI = jdapi.New(beego.AppConfig.DefaultString("jdcsToken"), beego.AppConfig.DefaultString("jdcsAppKey"), beego.AppConfig.DefaultString("jdcsSecret")) JdAPI = jdapi.New("", "", "") } if globals.JdydOrgCode != "" { - // JdydAPI = jdapi.New(beego.AppConfig.String("jdydToken"), beego.AppConfig.String("jdydAppKey"), beego.AppConfig.String("jdydSecret")) + // JdydAPI = jdapi.New(beego.AppConfig.DefaultString("jdydToken"), beego.AppConfig.DefaultString("jdydAppKey"), beego.AppConfig.DefaultString("jdydSecret")) JdAPI = jdapi.New("", "", "") } fakeJdToken := beego.AppConfig.DefaultString("fakeJdToken", "") if fakeJdToken != "" { - FakeJdAPI = jdapi.NewFakeJD(fakeJdToken, beego.AppConfig.String("fakeJdBaseURL")) + FakeJdAPI = jdapi.NewFakeJD(fakeJdToken, beego.AppConfig.DefaultString("fakeJdBaseURL", "")) } } else { JdAPI = nil } if !beego.AppConfig.DefaultBool("disableJdEclp", false) { - JdEclpAPI = jdeclpapi.New(beego.AppConfig.String("jdEclpAccessToken"), beego.AppConfig.String("jdEclpAppKey"), beego.AppConfig.String("jdEclpAppSecret")) + JdEclpAPI = jdeclpapi.New(beego.AppConfig.DefaultString("jdEclpAccessToken", ""), beego.AppConfig.DefaultString("jdEclpAppKey", ""), beego.AppConfig.DefaultString("jdEclpAppSecret", "")) } else { JdEclpAPI = nil } if !beego.AppConfig.DefaultBool("disableJdShop", false) { - JdShopAPI = jdshopapi.New(beego.AppConfig.String("jdShopAccessToken"), beego.AppConfig.String("jdShopAppKey"), beego.AppConfig.String("jdShopAppSecret")) - JdShop2API = jdshopapi.New(beego.AppConfig.String("jdShopAccessToken2"), beego.AppConfig.String("jdShopAppKey2"), beego.AppConfig.String("jdShopAppSecret2")) + JdShopAPI = jdshopapi.New(beego.AppConfig.DefaultString("jdShopAccessToken", ""), beego.AppConfig.DefaultString("jdShopAppKey", ""), beego.AppConfig.DefaultString("jdShopAppSecret", "")) + JdShop2API = jdshopapi.New(beego.AppConfig.DefaultString("jdShopAccessToken2", ""), beego.AppConfig.DefaultString("jdShopAppKey2", ""), beego.AppConfig.DefaultString("jdShopAppSecret2", "")) } else { JdShopAPI = nil } if !beego.AppConfig.DefaultBool("disableElm", false) { - ElmAPI = elmapi.New(beego.AppConfig.DefaultString("elmToken", ""), beego.AppConfig.String("elmAppKey"), beego.AppConfig.String("elmSecret"), beego.AppConfig.DefaultBool("elmIsProd", false)) + ElmAPI = elmapi.New(beego.AppConfig.DefaultString("elmToken", ""), beego.AppConfig.DefaultString("elmAppKey", ""), beego.AppConfig.DefaultString("elmSecret", ""), beego.AppConfig.DefaultBool("elmIsProd", false)) } else { ElmAPI = nil } if !beego.AppConfig.DefaultBool("disableMtwm", false) { - MtwmAPI = mtwmapi.New(beego.AppConfig.String("mtwmAppID"), beego.AppConfig.String("mtwmSecret"), beego.AppConfig.String("mtwmCallbackURL"), "") + MtwmAPI = mtwmapi.New(beego.AppConfig.DefaultString("mtwmAppID", ""), beego.AppConfig.DefaultString("mtwmSecret", ""), beego.AppConfig.DefaultString("mtwmCallbackURL", ""), "") // if mtwmCookieStr := beego.AppConfig.DefaultString("mtwmCookieStr", ""); mtwmCookieStr != "" { // MtwmAPI.SetCookieWithStr(mtwmCookieStr) // } - Mtwm2API = mtwmapi.New(beego.AppConfig.String("mtwmAppID2"), beego.AppConfig.String("mtwmSecret2"), beego.AppConfig.String("mtwmCallbackURL2"), "") + Mtwm2API = mtwmapi.New(beego.AppConfig.DefaultString("mtwmAppID2", ""), beego.AppConfig.DefaultString("mtwmSecret2", ""), beego.AppConfig.DefaultString("mtwmCallbackURL2", ""), "") } else { MtwmAPI = nil } @@ -181,7 +181,7 @@ func Init() { WeimobAPI = nil } if !beego.AppConfig.DefaultBool("disableEbai", false) { - EbaiAPI = ebaiapi.New(beego.AppConfig.String("ebaiSource"), beego.AppConfig.String("ebaiSecret")) + EbaiAPI = ebaiapi.New(beego.AppConfig.DefaultString("ebaiSource", ""), beego.AppConfig.DefaultString("ebaiSecret", "")) // ebaiStorePageCookieWMUSS := beego.AppConfig.DefaultString("ebaiStorePageCookieWMUSS", "") // ebaiStorePageCookieWMSTOKEN := beego.AppConfig.DefaultString("ebaiStorePageCookieWMSTOKEN", "") // ebaiStorePageCookieExdTOKEN := beego.AppConfig.DefaultString("ebaiStorePageCookieExdTOKEN", "") @@ -190,7 +190,7 @@ func Init() { // EbaiAPI.SetCookie("WMSTOKEN", ebaiStorePageCookieWMSTOKEN) // EbaiAPI.SetCookie("PASSPORT_DELIMONT_TOKEN", ebaiStorePageCookieExdTOKEN) // } - Ebai2API = ebaiapi.New(beego.AppConfig.String("ebaiSource"), beego.AppConfig.String("ebaiSecret")) + Ebai2API = ebaiapi.New(beego.AppConfig.DefaultString("ebaiSource", ""), beego.AppConfig.DefaultString("ebaiSecret", "")) // ebaiStorePageCookieWMUSS2 := beego.AppConfig.DefaultString("ebaiStorePageCookieWMUSS2", "") // ebaiStorePageCookieWMSTOKEN2 := beego.AppConfig.DefaultString("ebaiStorePageCookieWMSTOKEN2", "") // if ebaiStorePageCookieWMUSS2 != "" && ebaiStorePageCookieWMSTOKEN2 != "" && ebaiStorePageCookieExdTOKEN != "" { @@ -204,13 +204,13 @@ func Init() { } if !beego.AppConfig.DefaultBool("disableYb", false) { - YinBaoAPI = yinbaoapi.New(beego.AppConfig.String("yinbaoAppKey"), beego.AppConfig.String("yinbaoAppID")) + YinBaoAPI = yinbaoapi.New(beego.AppConfig.DefaultString("yinbaoAppKey", ""), beego.AppConfig.DefaultString("yinbaoAppID", "")) } else { YinBaoAPI = nil } if !beego.AppConfig.DefaultBool("disableMtps", false) { - MtpsAPI = mtpsapi.New(beego.AppConfig.String("mtpsAppKey"), beego.AppConfig.String("mtpsSecret")) + MtpsAPI = mtpsapi.New(beego.AppConfig.DefaultString("mtpsAppKey", ""), beego.AppConfig.DefaultString("mtpsSecret", "")) // if mtpsStoreToken := beego.AppConfig.DefaultString("mtpsStoreToken", ""); mtpsStoreToken != "" { // MtpsAPI.SetCookie("token", mtpsStoreToken) // } @@ -218,13 +218,13 @@ func Init() { MtpsAPI = nil } if !beego.AppConfig.DefaultBool("disableDada", false) { - DadaAPI = dadaapi.New(beego.AppConfig.String("dadaAppKey"), beego.AppConfig.String("dadaAppSecret"), beego.AppConfig.String("dadaSourceID"), beego.AppConfig.String("dadaCallbackURL"), beego.AppConfig.DefaultBool("dadaIsProd", false)) + DadaAPI = dadaapi.New(beego.AppConfig.DefaultString("dadaAppKey", ""), beego.AppConfig.DefaultString("dadaAppSecret", ""), beego.AppConfig.DefaultString("dadaSourceID", ""), beego.AppConfig.DefaultString("dadaCallbackURL", ""), beego.AppConfig.DefaultBool("dadaIsProd", false)) } else { DadaAPI = nil } if !beego.AppConfig.DefaultBool("disableWeixin", false) { - WeixinAPI = weixinapi.New(beego.AppConfig.String("weixinAppID"), beego.AppConfig.String("weixinSecret")) + WeixinAPI = weixinapi.New(beego.AppConfig.DefaultString("weixinAppID", ""), beego.AppConfig.DefaultString("weixinSecret", "")) // 这个主要是用于调试阶段使用,生产环境中用的是自动刷新那套 if weixinToken := beego.AppConfig.DefaultString("weixinToken", ""); weixinToken != "" { WeixinAPI.CBSetToken(weixinToken) @@ -235,38 +235,38 @@ func Init() { } else { WeimobAPI = nil } - WeixinMiniAPI = weixinapi.New(beego.AppConfig.String("weixinMiniAppID"), beego.AppConfig.String("weixinMiniSecret")) - if WeixinMiniAppID2 = beego.AppConfig.String("weixinMiniAppID2"); WeixinMiniAppID2 != "" { - WeixinMiniAPI2 = weixinapi.New(WeixinMiniAppID2, beego.AppConfig.String("weixinMiniSecret2")) + WeixinMiniAPI = weixinapi.New(beego.AppConfig.DefaultString("weixinMiniAppID", ""), beego.AppConfig.DefaultString("weixinMiniSecret", "")) + if WeixinMiniAppID2 = beego.AppConfig.DefaultString("weixinMiniAppID2", ""); WeixinMiniAppID2 != "" { + WeixinMiniAPI2 = weixinapi.New(WeixinMiniAppID2, beego.AppConfig.DefaultString("weixinMiniSecret2", "")) } - WeixinPageAPI = weixinapi.New(beego.AppConfig.String("weixinPageAppID"), beego.AppConfig.String("weixinPageSecret")) - if WeixinMiniAppID3 = beego.AppConfig.String("weixinMiniAppID3"); WeixinMiniAppID3 != "" { - WeixinApp = weixinapi.New(WeixinMiniAppID3, beego.AppConfig.String("weixinMiniSecret3")) + WeixinPageAPI = weixinapi.New(beego.AppConfig.DefaultString("weixinPageAppID", ""), beego.AppConfig.DefaultString("weixinPageSecret", "")) + if WeixinMiniAppID3 = beego.AppConfig.DefaultString("weixinMiniAppID3", ""); WeixinMiniAppID3 != "" { + WeixinApp = weixinapi.New(WeixinMiniAppID3, beego.AppConfig.DefaultString("weixinMiniSecret3", "")) } - if WeixinMiniAppIDsc = beego.AppConfig.String("weixinMiniAppIDsc"); WeixinMiniAppIDsc != "" { - WeixinMiniAPIsc = weixinapi.New(WeixinMiniAppIDsc, beego.AppConfig.String("weixinMiniSecretsc")) + if WeixinMiniAppIDsc = beego.AppConfig.DefaultString("weixinMiniAppIDsc", ""); WeixinMiniAppIDsc != "" { + WeixinMiniAPIsc = weixinapi.New(WeixinMiniAppIDsc, beego.AppConfig.DefaultString("weixinMiniSecretsc", "")) } if globals.WxpayNotifyURL != "" { - // WxpayAPI = wxpayapi.New(beego.AppConfig.String("wxpayAppID"), beego.AppConfig.String("wxpayAppKey"), beego.AppConfig.String("wxpayAppMchID")) - WxpayAPI = wxpayapi.NewWithCertificate(beego.AppConfig.String("wxpayAppID"), beego.AppConfig.String("wxpayAppKey"), beego.AppConfig.String("wxpayAppMchID"), + // WxpayAPI = wxpayapi.New(beego.AppConfig.DefaultString("wxpayAppID"), beego.AppConfig.DefaultString("wxpayAppKey"), beego.AppConfig.DefaultString("wxpayAppMchID")) + WxpayAPI = wxpayapi.NewWithCertificate(beego.AppConfig.DefaultString("wxpayAppID", ""), beego.AppConfig.DefaultString("wxpayAppKey", ""), beego.AppConfig.DefaultString("wxpayAppMchID", ""), "conf/apiclient_cert.pem", "conf/apiclient_key.pem") } if globals.TLPayNotifyURL != "" { - TLpayAPI = tonglianpayapi.New(beego.AppConfig.String("tonglianPayAppID"), beego.AppConfig.String("tonglianPayKey"), beego.AppConfig.String("tonglianPayCusID")) + TLpayAPI = tonglianpayapi.New(beego.AppConfig.DefaultString("tonglianPayAppID", ""), beego.AppConfig.DefaultString("tonglianPayKey", ""), beego.AppConfig.DefaultString("tonglianPayCusID", "")) } - AutonaviAPI = autonavi.New(beego.AppConfig.String("autonaviKey")) - BaiDuNaviAPI = baidunavi.New(beego.AppConfig.String("baidunaviAK"), beego.AppConfig.String("baidunaviSK")) - QiniuAPI = qbox.NewMac(beego.AppConfig.String("qiniuAK"), beego.AppConfig.String("qiniuSK")) + AutonaviAPI = autonavi.New(beego.AppConfig.DefaultString("autonaviKey", "")) + BaiDuNaviAPI = baidunavi.New(beego.AppConfig.DefaultString("baidunaviAK", ""), beego.AppConfig.DefaultString("baidunaviSK", "")) + QiniuAPI = qbox.NewMac(beego.AppConfig.DefaultString("qiniuAK", ""), beego.AppConfig.DefaultString("qiniuSK", "")) ShowAPI = showapi.New(beego.AppConfig.DefaultInt("showAppID", 0), beego.AppConfig.DefaultString("showAppSecret", "")) Cacher = redis.New(beego.AppConfig.DefaultString("redisHost", "localhost"), beego.AppConfig.DefaultInt("redisPort", 0), beego.AppConfig.DefaultString("redisPassword", "")) - AliUpcAPI = aliupcapi.New(beego.AppConfig.String("aliUpcAppCode")) + AliUpcAPI = aliupcapi.New(beego.AppConfig.DefaultString("aliUpcAppCode", "")) DingDingAPI = dingdingapi.NewWithAgentID(beego.AppConfig.DefaultInt64("dingdingAgentID", 0), beego.AppConfig.DefaultString("dingdingCorpID", ""), beego.AppConfig.DefaultString("dingdingAppKey", ""), beego.AppConfig.DefaultString("dingdingSecret", "")) DingDingQRCodeAPI = dingdingapi.New(beego.AppConfig.DefaultString("dingdingCorpID", ""), beego.AppConfig.DefaultString("dingdingQRCodeAppKey", ""), beego.AppConfig.DefaultString("dingdingQRCodeSecret", "")) if alipayAppID := beego.AppConfig.DefaultString("alipayAppID", ""); alipayAppID != "" { - AliPayAPI = alipayapi.New(alipayAppID, []byte(beego.AppConfig.String("alipayPrivateKey"))) + AliPayAPI = alipayapi.New(alipayAppID, []byte(beego.AppConfig.DefaultString("alipayPrivateKey", ""))) } FnAPI = fnpsapi.New(beego.AppConfig.DefaultString("fnAppID", ""), beego.AppConfig.DefaultString("fnAppSecret", "")) diff --git a/globals/globals.go b/globals/globals.go index c689b00f9..bf8ad9f78 100644 --- a/globals/globals.go +++ b/globals/globals.go @@ -2,8 +2,8 @@ package globals import ( "git.rosy.net.cn/baseapi" - beego "github.com/astaxie/beego/adapter" - "github.com/astaxie/beego/adapter/logs" + "github.com/astaxie/beego/core/logs" + "github.com/astaxie/beego/server/web" _ "github.com/go-sql-driver/mysql" // import your used driver "go.uber.org/zap" ) @@ -78,7 +78,7 @@ var ( func init() { logs.SetLogFuncCallDepth(3) - beego.BConfig.Log.AccessLogs = true + web.BConfig.Log.AccessLogs = true logger, _ := zap.NewDevelopment() SugarLogger = logger.Sugar() @@ -91,77 +91,77 @@ func Init() { OutputDebugMsgLevel = 1 } - SugarLogger.Infof("globals RunMode=%s", beego.BConfig.RunMode) - ReallyCallPlatformAPI = (beego.BConfig.RunMode != "dev" && beego.BConfig.RunMode != "test") + SugarLogger.Infof("globals RunMode=%s", web.BConfig.RunMode) + ReallyCallPlatformAPI = (web.BConfig.RunMode != "dev" && web.BConfig.RunMode != "test") ReallySendWeixinMsg = ReallyCallPlatformAPI && IsProductEnv() - AliKey = beego.AppConfig.DefaultString("aliKey", "") - AliSecret = beego.AppConfig.DefaultString("aliSecret", "") + AliKey = web.AppConfig.DefaultString("aliKey", "") + AliSecret = web.AppConfig.DefaultString("aliSecret", "") - EnableStoreWrite = beego.AppConfig.DefaultBool("enableStoreWrite", false) - EnableJdStoreWrite = EnableStoreWrite && beego.AppConfig.DefaultBool("enableJdStoreWrite", false) - EnableEbaiStoreWrite = EnableStoreWrite && beego.AppConfig.DefaultBool("enableEbaiStoreWrite", false) - EnableElmStoreWrite = EnableStoreWrite && beego.AppConfig.DefaultBool("enableElmStoreWrite", false) - EnableMtwmStoreWrite = EnableStoreWrite && beego.AppConfig.DefaultBool("enableMtwmStoreWrite", false) - EnableWscStoreWrite = EnableStoreWrite && beego.AppConfig.DefaultBool("enableWscStoreWrite", false) - // EnablePendingChange = beego.AppConfig.DefaultBool("enablePendingChange", false) - EnableYbStoreWrite = EnableStoreWrite && beego.AppConfig.DefaultBool("enableYbStoreWrite", false) - EnableJdShopWrite = EnableStoreWrite && beego.AppConfig.DefaultBool("enableJdShopWrite", false) + EnableStoreWrite = web.AppConfig.DefaultBool("enableStoreWrite", false) + EnableJdStoreWrite = EnableStoreWrite && web.AppConfig.DefaultBool("enableJdStoreWrite", false) + EnableEbaiStoreWrite = EnableStoreWrite && web.AppConfig.DefaultBool("enableEbaiStoreWrite", false) + EnableElmStoreWrite = EnableStoreWrite && web.AppConfig.DefaultBool("enableElmStoreWrite", false) + EnableMtwmStoreWrite = EnableStoreWrite && web.AppConfig.DefaultBool("enableMtwmStoreWrite", false) + EnableWscStoreWrite = EnableStoreWrite && web.AppConfig.DefaultBool("enableWscStoreWrite", false) + // EnablePendingChange = web.AppConfig.DefaultBool("enablePendingChange", false) + EnableYbStoreWrite = EnableStoreWrite && web.AppConfig.DefaultBool("enableYbStoreWrite", false) + EnableJdShopWrite = EnableStoreWrite && web.AppConfig.DefaultBool("enableJdShopWrite", false) - QiniuBucket = beego.AppConfig.String("qiniuBucket") + QiniuBucket = web.AppConfig.DefaultString("qiniuBucket", "") - WeimobCallbackURL = beego.AppConfig.DefaultString("weimobCallbackURL", "") - WeimobStateSecret = beego.AppConfig.DefaultString("weimobStateSecret", "") + WeimobCallbackURL = web.AppConfig.DefaultString("weimobCallbackURL", "") + WeimobStateSecret = web.AppConfig.DefaultString("weimobStateSecret", "") - BackstageHost = beego.AppConfig.DefaultString("backstageHost", "") - WxBackstageHost = beego.AppConfig.DefaultString("wxBackstageHost", "") + BackstageHost = web.AppConfig.DefaultString("backstageHost", "") + WxBackstageHost = web.AppConfig.DefaultString("wxBackstageHost", "") - GetWeixinTokenURL = beego.AppConfig.DefaultString("getWeixinTokenURL", "") - GetWeixin2TokenURL = beego.AppConfig.DefaultString("getWeixin2TokenURL", "") - GetYLYTokenURL = beego.AppConfig.DefaultString("getYLYTokenURL", "") - GetWeimobTokenURL = beego.AppConfig.DefaultString("getWeimobTokenURL", "") - GetWeixinTokenKey = beego.AppConfig.DefaultString("getWeixinTokenKey", "") - GetPushTokenURL = beego.AppConfig.DefaultString("getPushTokenURL", "") + GetWeixinTokenURL = web.AppConfig.DefaultString("getWeixinTokenURL", "") + GetWeixin2TokenURL = web.AppConfig.DefaultString("getWeixin2TokenURL", "") + GetYLYTokenURL = web.AppConfig.DefaultString("getYLYTokenURL", "") + GetWeimobTokenURL = web.AppConfig.DefaultString("getWeimobTokenURL", "") + GetWeixinTokenKey = web.AppConfig.DefaultString("getWeixinTokenKey", "") + GetPushTokenURL = web.AppConfig.DefaultString("getPushTokenURL", "") - StoreName = beego.AppConfig.String("storeName") - StoreNameMtwm = beego.AppConfig.String("storeNameMtwm") - StoreNameEbai = beego.AppConfig.String("storeNameEbai") - StoreNameEbai2 = beego.AppConfig.String("storeNameEbai2") + StoreName = web.AppConfig.DefaultString("storeName", "") + StoreNameMtwm = web.AppConfig.DefaultString("storeNameMtwm", "") + StoreNameEbai = web.AppConfig.DefaultString("storeNameEbai", "") + StoreNameEbai2 = web.AppConfig.DefaultString("storeNameEbai2", "") - SMSSignName = beego.AppConfig.String("smsSignName") - SMSMobileVerifyTemplate = beego.AppConfig.String("smsMobileVerifyTemplate") - SMSNewOrderTemplate = beego.AppConfig.String("smsNewOrderTemplate") - SMSNewOrderTemplateQ = beego.AppConfig.String("smsNewOrderTemplateQ") - SMSOrderCanceledTemplate = beego.AppConfig.String("smsOrderCanceledTemplate") - SMSNewUserOrderTemplate = beego.AppConfig.String("smsNewUserOrderTemplate") + SMSSignName = web.AppConfig.DefaultString("smsSignName", "") + SMSMobileVerifyTemplate = web.AppConfig.DefaultString("smsMobileVerifyTemplate", "") + SMSNewOrderTemplate = web.AppConfig.DefaultString("smsNewOrderTemplate", "") + SMSNewOrderTemplateQ = web.AppConfig.DefaultString("smsNewOrderTemplateQ", "") + SMSOrderCanceledTemplate = web.AppConfig.DefaultString("smsOrderCanceledTemplate", "") + SMSNewUserOrderTemplate = web.AppConfig.DefaultString("smsNewUserOrderTemplate", "") - EnableWXAuth2 = true // beego.BConfig.RunMode == "beta" + EnableWXAuth2 = true // web.BConfig.RunMode == "beta" DisableWXAuth1 = true - WxpayNotifyURL = beego.AppConfig.DefaultString("wxpayNotifyURL", "") - TLPayNotifyURL = beego.AppConfig.DefaultString("tonglianPayNotifyURL", "") - FnNotifyURL = beego.AppConfig.DefaultString("fnCallbackURL", "") - JdOrgCode = beego.AppConfig.DefaultString("jdOrgCode", "") - Jd2OrgCode = beego.AppConfig.DefaultString("jd2OrgCode", "") - Jd3OrgCode = beego.AppConfig.DefaultString("jd3OrgCode", "") - JdcsOrgCode = beego.AppConfig.DefaultString("jdcsOrgCode", "") - JdydOrgCode = beego.AppConfig.DefaultString("jdydOrgCode", "") - JdLoginName = beego.AppConfig.DefaultString("jdLoginName", "") - IsAddEvent = beego.AppConfig.DefaultBool("addEvent", false) + WxpayNotifyURL = web.AppConfig.DefaultString("wxpayNotifyURL", "") + TLPayNotifyURL = web.AppConfig.DefaultString("tonglianPayNotifyURL", "") + FnNotifyURL = web.AppConfig.DefaultString("fnCallbackURL", "") + JdOrgCode = web.AppConfig.DefaultString("jdOrgCode", "") + Jd2OrgCode = web.AppConfig.DefaultString("jd2OrgCode", "") + Jd3OrgCode = web.AppConfig.DefaultString("jd3OrgCode", "") + JdcsOrgCode = web.AppConfig.DefaultString("jdcsOrgCode", "") + JdydOrgCode = web.AppConfig.DefaultString("jdydOrgCode", "") + JdLoginName = web.AppConfig.DefaultString("jdLoginName", "") + IsAddEvent = web.AppConfig.DefaultBool("addEvent", false) IsStoreSkuAct = !IsProductEnv() - MtwmCode = beego.AppConfig.DefaultString("mtwmAppID", "") - Mtwm2Code = beego.AppConfig.DefaultString("mtwmAppID2", "") + MtwmCode = web.AppConfig.DefaultString("mtwmAppID", "") + Mtwm2Code = web.AppConfig.DefaultString("mtwmAppID2", "") } func IsCallbackAlwaysReturnSuccess() bool { - return beego.BConfig.RunMode == "beta" + return web.BConfig.RunMode == "beta" } func IsMainProductEnv() bool { - return beego.BConfig.RunMode == "prod" + return web.BConfig.RunMode == "prod" } func IsProductEnv() bool { - return IsMainProductEnv() || beego.BConfig.RunMode == "jxgy" + return IsMainProductEnv() || web.BConfig.RunMode == "jxgy" } diff --git a/globals/testinit1/testinit1.go b/globals/testinit1/testinit1.go index 1da6b3f9c..957e1a4d2 100644 --- a/globals/testinit1/testinit1.go +++ b/globals/testinit1/testinit1.go @@ -6,7 +6,7 @@ import ( "git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals/beegodb" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" ) func Init() { diff --git a/main.go b/main.go index d758c9ca2..148464dc9 100644 --- a/main.go +++ b/main.go @@ -12,7 +12,7 @@ import ( "git.rosy.net.cn/jx-callback/business/partner/purchase/yb" - beego "github.com/astaxie/beego/adapter" + beego "github.com/astaxie/beego/server/web" "git.rosy.net.cn/baseapi/platformapi/dingdingapi" "git.rosy.net.cn/baseapi/utils" diff --git a/tests/default_test.go b/tests/default_test.go index cc72aa99d..d85595077 100644 --- a/tests/default_test.go +++ b/tests/default_test.go @@ -9,7 +9,7 @@ import ( _ "git.rosy.net.cn/jx-callback/routers" - beego "github.com/astaxie/beego/adapter" + "github.com/astaxie/beego/server/web" . "github.com/smartystreets/goconvey/convey" )