This commit is contained in:
苏尹岚
2021-03-31 16:20:11 +08:00
parent 9863f02757
commit 6bf4ce45a5
61 changed files with 214 additions and 215 deletions

View File

@@ -10,7 +10,7 @@ import (
"git.rosy.net.cn/jx-callback/business/jxstore/permission" "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" "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) sqlParams = append(sqlParams, pageSize, offset)
var waybills []*tWaybillExt var waybills []*tWaybillExt
db := dao.GetDB() db := dao.GetDB()
txDB , _ := dao.Begin(db) txDB, _ := dao.Begin(db)
defer func() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {
dao.Rollback(db, txDB) dao.Rollback(db, txDB)
@@ -703,7 +703,7 @@ func (c *OrderManager) GetOrdersFinancial(ctx *jxcontext.Context, fromDateStr, t
var orders []*model.OrderFinancialExt var orders []*model.OrderFinancialExt
db := dao.GetDB() db := dao.GetDB()
txDB , _ := dao.Begin(db) txDB, _ := dao.Begin(db)
defer func() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {
dao.Rollback(db, txDB) dao.Rollback(db, txDB)
@@ -1020,7 +1020,7 @@ func (c *OrderManager) GetAfsOrders(ctx *jxcontext.Context, keyword, afsOrderID,
var orders []*model.AfsOrder var orders []*model.AfsOrder
db := dao.GetDB() db := dao.GetDB()
txDB , _ := dao.Begin(db) txDB, _ := dao.Begin(db)
defer func() { defer func() {
if r := recover(); r != nil || err != nil { if r := recover(); r != nil || err != nil {
dao.Rollback(db, txDB) dao.Rollback(db, txDB)

View File

@@ -10,7 +10,7 @@ import (
push "git.rosy.net.cn/jx-callback/business/jxutils/unipush" 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" "git.rosy.net.cn/jx-callback/business/jxstore/cms"

View File

@@ -11,7 +11,7 @@ import (
"strings" "strings"
"time" "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/platformapi/aliupcapi"
"git.rosy.net.cn/baseapi/utils" "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 cat.Seq = maxSeq.MaxSeq + 1
} }
txDB , _ := dao.Begin(db) txDB, _ := dao.Begin(db)
defer func() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {
dao.Rollback(db, txDB) 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() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {
dao.Rollback(db, txDB) dao.Rollback(db, txDB)
@@ -326,7 +326,7 @@ func ReorderCategories(ctx *jxcontext.Context, parentID int, categoryIDs []int,
catsMap[cat.ID] = cat catsMap[cat.ID] = cat
} }
txDB , _ := dao.Begin(db) txDB, _ := dao.Begin(db)
defer func() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {
dao.Rollback(db, txDB) dao.Rollback(db, txDB)
@@ -390,7 +390,7 @@ func DeleteCategory(ctx *jxcontext.Context, categoryID int, userName string) (nu
} else if countInfos[2].Ct != 0 { } else if countInfos[2].Ct != 0 {
return 0, errors.New("还有商品类别使用此类别,不能删除") return 0, errors.New("还有商品类别使用此类别,不能删除")
} }
txDB , _ := dao.Begin(db) txDB, _ := dao.Begin(db)
defer func() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {
dao.Rollback(db, txDB) dao.Rollback(db, txDB)
@@ -636,7 +636,7 @@ func GetSkuNames(ctx *jxcontext.Context, keyword string, isBySku, isQueryMidPric
offset = jxutils.FormalizePageOffset(offset) offset = jxutils.FormalizePageOffset(offset)
sqlParams = append(sqlParams, pageSize, offset) sqlParams = append(sqlParams, pageSize, offset)
skuNamesInfo = &SkuNamesInfo{} skuNamesInfo = &SkuNamesInfo{}
txDB , _ := dao.Begin(db) // todo 这里用事务的原因是SQL_CALC_FOUND_ROWS会出错 txDB, _ := dao.Begin(db) // todo 这里用事务的原因是SQL_CALC_FOUND_ROWS会出错
defer func() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {
dao.Rollback(db, txDB) 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() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {
dao.Rollback(db, txDB) dao.Rollback(db, txDB)
@@ -978,7 +978,7 @@ func UpdateSkuName(ctx *jxcontext.Context, nameID int, payload map[string]interf
if payload["eclpID"] != nil { if payload["eclpID"] != nil {
eclpID = payload["eclpID"].(string) eclpID = payload["eclpID"].(string)
} }
txDB , _ := dao.Begin(db) txDB, _ := dao.Begin(db)
defer func() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {
dao.Rollback(db, txDB) 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) { func DeleteSkuName(ctx *jxcontext.Context, nameID int, userName string) (num int64, err error) {
db := dao.GetDB() db := dao.GetDB()
txDB , _ := dao.Begin(db) txDB, _ := dao.Begin(db)
defer func() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {
dao.Rollback(db, txDB) dao.Rollback(db, txDB)
@@ -1223,7 +1223,7 @@ func AddSku(ctx *jxcontext.Context, nameID int, sku *model.Sku, userName string)
sku.LadderBoxPrice = 10 sku.LadderBoxPrice = 10
} }
sku.LadderBoxNum = 1 sku.LadderBoxNum = 1
txDB , _ := dao.Begin(db) txDB, _ := dao.Begin(db)
defer func() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {
dao.Rollback(db, txDB) 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) valid := dao.StrictMakeMapByStructObject(payload, sku, userName)
if len(valid) > 0 { if len(valid) > 0 {
// globals.SugarLogger.Debug(utils.Format4Output(valid, false)) // globals.SugarLogger.Debug(utils.Format4Output(valid, false))
txDB , _ := dao.Begin(db) txDB, _ := dao.Begin(db)
defer func() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {
dao.Rollback(db, txDB) 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.JxPrice = jxutils.CaculatePriceByPricePack(storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage), int(storeSku.Price))
storeSku.LastOperator = ctx.GetUserName() storeSku.LastOperator = ctx.GetUserName()
storeSku.UpdatedAt = time.Now() storeSku.UpdatedAt = time.Now()
txDB , _ := dao.Begin(db) txDB, _ := dao.Begin(db)
defer func() { defer func() {
if r := recover(); r != nil || err != nil { if r := recover(); r != nil || err != nil {
dao.Rollback(db, txDB) 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) { func DeleteSku(ctx *jxcontext.Context, skuID int, userName string) (num int64, err error) {
db := dao.GetDB() db := dao.GetDB()
txDB , _ := dao.Begin(db) txDB, _ := dao.Begin(db)
defer func() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {
dao.Rollback(db, txDB) dao.Rollback(db, txDB)
@@ -1474,7 +1474,7 @@ func AddSkuNamePlace(ctx *jxcontext.Context, nameID, placeCode int, userName str
} }
dao.WrapAddIDCULEntity(placeBind, userName) dao.WrapAddIDCULEntity(placeBind, userName)
txDB , _ := dao.Begin(db) txDB, _ := dao.Begin(db)
defer func() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {
dao.Rollback(db, txDB) dao.Rollback(db, txDB)
@@ -1501,7 +1501,7 @@ func DeleteSkuNamePlace(ctx *jxcontext.Context, nameID, placeCode int, userName
placeBind.NameID = nameID placeBind.NameID = nameID
placeBind.PlaceCode = placeCode placeBind.PlaceCode = placeCode
txDB , _ := dao.Begin(db) txDB, _ := dao.Begin(db)
defer func() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {
dao.Rollback(db, txDB) 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() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {
dao.Rollback(db, txDB) dao.Rollback(db, txDB)
@@ -1718,7 +1718,7 @@ func UpdateSkuNamesExPrefix(ctx *jxcontext.Context, nameIDs []int, imgWaterMark
skuName.ID = nameID skuName.ID = nameID
skuName.LastOperator = ctx.GetLoginID() skuName.LastOperator = ctx.GetLoginID()
skuName.UpdatedAt = time.Now() skuName.UpdatedAt = time.Now()
txDB , _ := dao.Begin(db) txDB, _ := dao.Begin(db)
defer func() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {
dao.Rollback(db, txDB) 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) vendorOrgCodes, _ := dao.GetVendorOrgCode(db, vendorCategoryMap.VendorID, vendorCategoryMap.VendorOrgCode, model.VendorOrgTypePlatform)
vendorCategoryMap.VendorCategoryName = strings.Trim(vendorCategoryMap.VendorCategoryName, " ") vendorCategoryMap.VendorCategoryName = strings.Trim(vendorCategoryMap.VendorCategoryName, " ")
dao.WrapAddIDCULDEntity(vendorCategoryMap, ctx.GetUserName()) dao.WrapAddIDCULDEntity(vendorCategoryMap, ctx.GetUserName())
txDB , _ := dao.Begin(db) txDB, _ := dao.Begin(db)
defer func() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {
dao.Rollback(db, txDB) 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) vendorOrgCodes, err := dao.GetVendorOrgCode(db, vendorCategoryMap2.VendorID, vendorCategoryMap2.VendorOrgCode, model.VendorOrgTypePlatform)
txDB , _ := dao.Begin(db) txDB, _ := dao.Begin(db)
defer func() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {
dao.Rollback(db, txDB) dao.Rollback(db, txDB)
@@ -2834,7 +2834,7 @@ func ReorderVendorCategories(ctx *jxcontext.Context, parentID, vendorID int, ven
for _, cat := range vendorCatsMap { for _, cat := range vendorCatsMap {
catsMap[cat.CategoryID] = cat catsMap[cat.CategoryID] = cat
} }
txDB , _ := dao.Begin(db) txDB, _ := dao.Begin(db)
defer func() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {
dao.Rollback(db, txDB) 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 { if vendorCatMap, _ := dao.GetVendorCategoryMap(db, -1, 0, vendorID, vendorOrgCode, 0); len(vendorCatMap) > 0 {
return fmt.Errorf("该账号下已有分类,请在这里修改!") return fmt.Errorf("该账号下已有分类,请在这里修改!")
} }
txDB , _ := dao.Begin(db) txDB, _ := dao.Begin(db)
defer func() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {
dao.Rollback(db, txDB) dao.Rollback(db, txDB)

View File

@@ -17,7 +17,7 @@ import (
"git.rosy.net.cn/jx-callback/business/auth2" "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" "git.rosy.net.cn/baseapi/platformapi/jdshopapi"

View File

@@ -8,7 +8,6 @@ import (
"git.rosy.net.cn/baseapi/platformapi/dingdingapi" "git.rosy.net.cn/baseapi/platformapi/dingdingapi"
"git.rosy.net.cn/jx-callback/business/jxutils/ddmsg" "git.rosy.net.cn/jx-callback/business/jxutils/ddmsg"
beego "github.com/astaxie/beego/adapter"
"git.rosy.net.cn/jx-callback/business/model/dao" "git.rosy.net.cn/jx-callback/business/model/dao"
@@ -1072,7 +1071,7 @@ func TestDiff(ctx *jxcontext.Context, vendorIDList []int, storeIDList []int) {
go func() { go func() {
defer func() { defer func() {
if recover() != nil { if recover() != nil {
beego.Info("执行任务失败") // beego.Info("执行任务失败")
panic("API调用失败") panic("API调用失败")
} }
}() }()
@@ -1090,7 +1089,7 @@ func TestDiff(ctx *jxcontext.Context, vendorIDList []int, storeIDList []int) {
go func() { go func() {
defer func() { defer func() {
if recover() != nil { if recover() != nil {
beego.Info("比较任务失败") // beego.Info("比较任务失败")
panic("比较任务失败") panic("比较任务失败")
} }
}() }()
@@ -1102,7 +1101,7 @@ func TestDiff(ctx *jxcontext.Context, vendorIDList []int, storeIDList []int) {
go func() { go func() {
defer func() { defer func() {
if recover() != nil { if recover() != nil {
beego.Info("写入任务失败") // beego.Info("写入任务失败")
panic("写入任务失败") panic("写入任务失败")
} }
}() }()

View File

@@ -32,7 +32,7 @@ import (
"git.rosy.net.cn/jx-callback/business/netspider" "git.rosy.net.cn/jx-callback/business/netspider"
"git.rosy.net.cn/jx-callback/business/partner" "git.rosy.net.cn/jx-callback/business/partner"
"git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals"
beego "github.com/astaxie/beego/adapter" beego "github.com/astaxie/beego/server/web"
) )
const ( const (

View File

@@ -17,7 +17,7 @@ import (
"sync" "sync"
"time" "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/platformapi"
"git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/baseapi/utils"

View File

@@ -19,8 +19,8 @@ import (
"git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals"
beego "github.com/astaxie/beego/adapter"
"github.com/astaxie/beego/client/orm" "github.com/astaxie/beego/client/orm"
beego "github.com/astaxie/beego/server/web"
) )
const ( const (

View File

@@ -11,7 +11,7 @@ import (
"git.rosy.net.cn/jx-callback/business/model/dao" "git.rosy.net.cn/jx-callback/business/model/dao"
"git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals"
"git.rosy.net.cn/jx-callback/globals/api" "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) { func pushToSingle(content, title string, storeID int) {

View File

@@ -7,7 +7,7 @@ import (
"strings" "strings"
"time" "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/auth2/authprovider/weixin"
"git.rosy.net.cn/jx-callback/business/authz/autils" "git.rosy.net.cn/jx-callback/business/authz/autils"
@@ -819,7 +819,7 @@ func SendStoreMessage(ctx *jxcontext.Context, title, content string, storeIDs []
storeIDs = storeIDs2 storeIDs = storeIDs2
} }
} }
txDB , _ := dao.Begin(db) txDB, _ := dao.Begin(db)
defer func() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {
dao.Rollback(db, txDB) 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) { func SendUserMessage(ctx *jxcontext.Context, title, content string, userIDs []string, isAsync, isContinueWhenError bool) (hint string, err error) {
db := dao.GetDB() db := dao.GetDB()
txDB , _ := dao.Begin(db) txDB, _ := dao.Begin(db)
defer func() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {
dao.Rollback(db, txDB) dao.Rollback(db, txDB)

View File

@@ -14,7 +14,7 @@ import (
"git.rosy.net.cn/jx-callback/business/partner/delivery" "git.rosy.net.cn/jx-callback/business/partner/delivery"
"git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals"
"git.rosy.net.cn/jx-callback/globals/api" "git.rosy.net.cn/jx-callback/globals/api"
beego "github.com/astaxie/beego/adapter" beego "github.com/astaxie/beego/server/web"
) )
const ( const (

View File

@@ -6,8 +6,8 @@ import (
"time" "time"
"git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/baseapi/utils"
beego "github.com/astaxie/beego/adapter"
"github.com/astaxie/beego/client/orm" "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/jxutils"
"git.rosy.net.cn/jx-callback/business/partner/delivery" "git.rosy.net.cn/jx-callback/business/partner/delivery"

View File

@@ -20,8 +20,8 @@ import (
"git.rosy.net.cn/jx-callback/business/partner/delivery" "git.rosy.net.cn/jx-callback/business/partner/delivery"
"git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals"
"git.rosy.net.cn/jx-callback/globals/api" "git.rosy.net.cn/jx-callback/globals/api"
beego "github.com/astaxie/beego/adapter"
"github.com/astaxie/beego/client/orm" "github.com/astaxie/beego/client/orm"
beego "github.com/astaxie/beego/server/web"
) )
const ( const (

View File

@@ -6,7 +6,7 @@ import (
"strings" "strings"
"time" "time"
beego "github.com/astaxie/beego/adapter" beego "github.com/astaxie/beego/server/web"
"git.rosy.net.cn/jx-callback/business/jxutils/tasksch" "git.rosy.net.cn/jx-callback/business/jxutils/tasksch"

View File

@@ -14,7 +14,7 @@ import (
"git.rosy.net.cn/jx-callback/business/partner" "git.rosy.net.cn/jx-callback/business/partner"
"git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals"
"git.rosy.net.cn/jx-callback/globals/api" "git.rosy.net.cn/jx-callback/globals/api"
beego "github.com/astaxie/beego/adapter" beego "github.com/astaxie/beego/server/web"
) )
const ( const (

View File

@@ -13,7 +13,7 @@ import (
"git.rosy.net.cn/jx-callback/business/partner/delivery/dada" "git.rosy.net.cn/jx-callback/business/partner/delivery/dada"
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" "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/dadaapi"
"git.rosy.net.cn/baseapi/platformapi/dingdingapi" "git.rosy.net.cn/baseapi/platformapi/dingdingapi"

View File

@@ -7,11 +7,11 @@ import (
"git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/jxutils"
"git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/business/model/dao" "git.rosy.net.cn/jx-callback/business/model/dao"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
type ActController struct { type ActController struct {
beego.Controller web.Controller
} }
// @Title 预创建活动 // @Title 预创建活动
@@ -240,7 +240,7 @@ func (c *ActController) UpdateActStoreSkuBind() {
err = fmt.Errorf("actStoreSkuAddList与actStoreSkuDeleteList不能都为空") err = fmt.Errorf("actStoreSkuAddList与actStoreSkuDeleteList不能都为空")
} else { } else {
db := dao.GetDB() db := dao.GetDB()
txDB , _ := dao.Begin(db) txDB, _ := dao.Begin(db)
func() { func() {
defer func() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {

View File

@@ -16,10 +16,10 @@ import (
"git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/business/model/dao" "git.rosy.net.cn/jx-callback/business/model/dao"
"git.rosy.net.cn/jx-callback/globals" "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 composedCode = code
referer := c.Ctx.Request.Referer() referer := c.Ctx.Request.Referer()
globals.SugarLogger.Debugf("GetComposedCode referer:%s", referer) globals.SugarLogger.Debugf("GetComposedCode referer:%s", referer)
@@ -34,7 +34,7 @@ func GetComposedCode(c *beego.Controller, code string) (composedCode string) {
} }
type Auth2Controller struct { type Auth2Controller struct {
beego.Controller web.Controller
} }
// @Title 生成captcha // @Title 生成captcha

View File

@@ -8,7 +8,7 @@ package controllers
// // 认证相关API // // 认证相关API
// type AuthController struct { // type AuthController struct {
// beego.Controller // web.Controller
// } // }
// var ( // var (

View File

@@ -10,11 +10,11 @@ import (
"git.rosy.net.cn/jx-callback/business/msghub" "git.rosy.net.cn/jx-callback/business/msghub"
"git.rosy.net.cn/jx-callback/globals/api" "git.rosy.net.cn/jx-callback/globals/api"
"git.rosy.net.cn/jx-callback/globals/api/apimanager" "git.rosy.net.cn/jx-callback/globals/api/apimanager"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
type CmsController struct { type CmsController struct {
beego.Controller web.Controller
} }
// @Title 得到地点(省,城市,区)信息 // @Title 得到地点(省,城市,区)信息

View File

@@ -4,11 +4,11 @@ import (
"git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/jxutils"
"git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/business/userstore" "git.rosy.net.cn/jx-callback/business/userstore"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
type FoodRecipeController struct { type FoodRecipeController struct {
beego.Controller web.Controller
} }
// @Title 创建菜谱 // @Title 创建菜谱

View File

@@ -8,11 +8,11 @@ import (
"git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/jxutils"
"git.rosy.net.cn/jx-callback/business/jxutils/weixinmsg" "git.rosy.net.cn/jx-callback/business/jxutils/weixinmsg"
"git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
type MsgController struct { type MsgController struct {
beego.Controller web.Controller
} }
// @Title 发送微信消息 // @Title 发送微信消息

View File

@@ -8,11 +8,11 @@ import (
"git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/business/model/dao" "git.rosy.net.cn/jx-callback/business/model/dao"
"git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
type SkuController struct { type SkuController struct {
beego.Controller web.Controller
} }
// @Title 得到厂商商品类别 // @Title 得到厂商商品类别

View File

@@ -9,11 +9,11 @@ import (
"git.rosy.net.cn/jx-callback/business/jxutils/netprinter" "git.rosy.net.cn/jx-callback/business/jxutils/netprinter"
"git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/globals/api" "git.rosy.net.cn/jx-callback/globals/api"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
type StoreController struct { type StoreController struct {
beego.Controller web.Controller
} }
// @Title 得到京西门店信息 // @Title 得到京西门店信息

View File

@@ -11,11 +11,11 @@ import (
"git.rosy.net.cn/jx-callback/business/jxstore/cms" "git.rosy.net.cn/jx-callback/business/jxstore/cms"
"git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/jxutils"
"git.rosy.net.cn/jx-callback/business/model/dao" "git.rosy.net.cn/jx-callback/business/model/dao"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
type StoreSkuController struct { type StoreSkuController struct {
beego.Controller web.Controller
} }
// @Title 得到商家商品信息 // @Title 得到商家商品信息

View File

@@ -9,11 +9,11 @@ import (
"git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/jxutils"
"git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/business/model/dao" "git.rosy.net.cn/jx-callback/business/model/dao"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
type SyncController struct { type SyncController struct {
beego.Controller web.Controller
} }
// @Title 同步商家商品信息 // @Title 同步商家商品信息

View File

@@ -8,11 +8,11 @@ import (
"git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/jxutils"
"git.rosy.net.cn/jx-callback/business/jxutils/tasksch" "git.rosy.net.cn/jx-callback/business/jxutils/tasksch"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
type TaskController struct { type TaskController struct {
beego.Controller web.Controller
} }
// @Title 查询长时间运行任务 // @Title 查询长时间运行任务

View File

@@ -1,7 +1,7 @@
package controllers package controllers
// type UserController struct { // type UserController struct {
// beego.Controller // web.Controller
// } // }
// // @Title 得到门店用户信息 // // @Title 得到门店用户信息

View File

@@ -8,12 +8,12 @@ import (
"git.rosy.net.cn/jx-callback/business/partner/delivery/dada" "git.rosy.net.cn/jx-callback/business/partner/delivery/dada"
"git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals"
"git.rosy.net.cn/jx-callback/globals/api" "git.rosy.net.cn/jx-callback/globals/api"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
// Operations about ELMOrder // Operations about ELMOrder
type DadaDeliveryController struct { type DadaDeliveryController struct {
beego.Controller web.Controller
} }
func (c *DadaDeliveryController) Msg() { func (c *DadaDeliveryController) Msg() {

View File

@@ -8,11 +8,11 @@ import (
"git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals"
"git.rosy.net.cn/jx-callback/globals/api" "git.rosy.net.cn/jx-callback/globals/api"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
type DDAPIController struct { type DDAPIController struct {
beego.Controller web.Controller
} }
type DDAPI struct { type DDAPI struct {

View File

@@ -7,11 +7,11 @@ import (
"git.rosy.net.cn/jx-callback/business/jxstore/cms" "git.rosy.net.cn/jx-callback/business/jxstore/cms"
"git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals"
"git.rosy.net.cn/jx-callback/globals/api" "git.rosy.net.cn/jx-callback/globals/api"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
type DingDingController struct { type DingDingController struct {
beego.Controller web.Controller
} }
func init() { func init() {

View File

@@ -6,11 +6,11 @@ import (
"git.rosy.net.cn/baseapi/platformapi/ebaiapi" "git.rosy.net.cn/baseapi/platformapi/ebaiapi"
"git.rosy.net.cn/jx-callback/business/partner/purchase/ebai" "git.rosy.net.cn/jx-callback/business/partner/purchase/ebai"
"git.rosy.net.cn/jx-callback/globals/api" "git.rosy.net.cn/jx-callback/globals/api"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
type EbaiController struct { type EbaiController struct {
beego.Controller web.Controller
} }
func (c *EbaiController) Msg() { func (c *EbaiController) Msg() {

View File

@@ -4,11 +4,11 @@ import (
"fmt" "fmt"
"net/http" "net/http"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
type EclpController struct { type EclpController struct {
beego.Controller web.Controller
} }
func (c *EclpController) Msg() { func (c *EclpController) Msg() {

View File

@@ -4,12 +4,12 @@ import (
"net/http" "net/http"
"git.rosy.net.cn/baseapi/platformapi/elmapi" "git.rosy.net.cn/baseapi/platformapi/elmapi"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
// Operations about ELMOrder // Operations about ELMOrder
type ElemeController struct { type ElemeController struct {
beego.Controller web.Controller
} }
// https://open.shop.ele.me/openapi/documents/httppushmethod // https://open.shop.ele.me/openapi/documents/httppushmethod

View File

@@ -20,12 +20,12 @@ import (
"git.rosy.net.cn/jx-callback/business/jxstore/event" "git.rosy.net.cn/jx-callback/business/jxstore/event"
"git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/jxutils"
"git.rosy.net.cn/jx-callback/globals/api" "git.rosy.net.cn/jx-callback/globals/api"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
// 操作事件明细相关API // 操作事件明细相关API
type EventController struct { type EventController struct {
beego.Controller web.Controller
} }
//连接的客户端,吧每个客户端都放进来 //连接的客户端,吧每个客户端都放进来

View File

@@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"io" "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/jxcallback/orderman"
"git.rosy.net.cn/jx-callback/business/jxstore/financial" "git.rosy.net.cn/jx-callback/business/jxstore/financial"
@@ -13,7 +13,7 @@ import (
) )
type FinancialController struct { type FinancialController struct {
beego.Controller web.Controller
} }
// @Title 发送文件给门店 // @Title 发送文件给门店

View File

@@ -11,11 +11,11 @@ import (
"git.rosy.net.cn/jx-callback/globals/api" "git.rosy.net.cn/jx-callback/globals/api"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
type FnController struct { type FnController struct {
beego.Controller web.Controller
} }
func (c *FnController) Msg() { func (c *FnController) Msg() {

View File

@@ -2,11 +2,11 @@ package controllers
import ( import (
"git.rosy.net.cn/jx-callback/business/jxstore/initdata" "git.rosy.net.cn/jx-callback/business/jxstore/initdata"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
type InitDataController struct { type InitDataController struct {
beego.Controller web.Controller
} }
// @Title 初始化place信息 // @Title 初始化place信息

View File

@@ -9,12 +9,12 @@ import (
"git.rosy.net.cn/jx-callback/business/partner/purchase/jd" "git.rosy.net.cn/jx-callback/business/partner/purchase/jd"
"git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals"
"git.rosy.net.cn/jx-callback/globals/api" "git.rosy.net.cn/jx-callback/globals/api"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
// Operations about JDOrder // Operations about JDOrder
type Djsw2Controller struct { type Djsw2Controller struct {
beego.Controller web.Controller
} }
func (c *Djsw2Controller) handleMsg(handler func(*jdapi.API, interface{}) *jdapi.CallbackResponse) (callbackResponse *jdapi.CallbackResponse) { func (c *Djsw2Controller) handleMsg(handler func(*jdapi.API, interface{}) *jdapi.CallbackResponse) (callbackResponse *jdapi.CallbackResponse) {

View File

@@ -12,12 +12,12 @@ import (
"git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/partner/purchase/jd" "git.rosy.net.cn/jx-callback/business/partner/purchase/jd"
"git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
// Operations about JDOrder // Operations about JDOrder
type DjswController struct { type DjswController struct {
beego.Controller web.Controller
} }
func (c *DjswController) handleMsg(handler func(*jdapi.API, interface{}) *jdapi.CallbackResponse) (callbackResponse *jdapi.CallbackResponse) { func (c *DjswController) handleMsg(handler func(*jdapi.API, interface{}) *jdapi.CallbackResponse) (callbackResponse *jdapi.CallbackResponse) {

View File

@@ -10,11 +10,11 @@ import (
"git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals"
"git.rosy.net.cn/jx-callback/globals/api" "git.rosy.net.cn/jx-callback/globals/api"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
type JdsController struct { type JdsController struct {
beego.Controller web.Controller
} }
func (c *JdsController) Msg() { func (c *JdsController) Msg() {

View File

@@ -16,12 +16,12 @@ import (
"git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/business/model/dao" "git.rosy.net.cn/jx-callback/business/model/dao"
"git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
// 订单相关API // 订单相关API
type OrderController struct { type OrderController struct {
beego.Controller web.Controller
} }
func (c *OrderController) URLMapping() { func (c *OrderController) URLMapping() {

View File

@@ -5,11 +5,11 @@ import (
"git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/jxutils"
"git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/business/partner/purchase/jx/localjx" "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 { type JxOrderController struct {
beego.Controller web.Controller
} }
// @Title 创建京西商城订单 // @Title 创建京西商城订单

View File

@@ -4,12 +4,12 @@ import (
"git.rosy.net.cn/jx-callback/business/jxstore/cms" "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/jxstore/report"
"git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/jxutils"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
// 统计相关API // 统计相关API
type ReportController struct { type ReportController struct {
beego.Controller web.Controller
} }
// @Title 查询订单统计信息 // @Title 查询订单统计信息

View File

@@ -2,11 +2,11 @@ package controllers
import ( import (
"git.rosy.net.cn/jx-callback/business/partner/purchase/jx/phpjx" "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 { type JxShopController struct {
beego.Controller web.Controller
} }
// @Title 京西自营商城消息回调接口 // @Title 京西自营商城消息回调接口

View File

@@ -5,12 +5,12 @@ import (
"git.rosy.net.cn/jx-callback/business/partner/delivery/mtps" "git.rosy.net.cn/jx-callback/business/partner/delivery/mtps"
"git.rosy.net.cn/jx-callback/globals/api" "git.rosy.net.cn/jx-callback/globals/api"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
// Operations about ELMOrder // Operations about ELMOrder
type MtpsController struct { type MtpsController struct {
beego.Controller web.Controller
} }
func (c *MtpsController) Status() { func (c *MtpsController) Status() {

View File

@@ -4,11 +4,11 @@ import (
"git.rosy.net.cn/baseapi/platformapi/mtwmapi" "git.rosy.net.cn/baseapi/platformapi/mtwmapi"
"git.rosy.net.cn/jx-callback/business/partner/purchase/mtwm" "git.rosy.net.cn/jx-callback/business/partner/purchase/mtwm"
"git.rosy.net.cn/jx-callback/globals/api" "git.rosy.net.cn/jx-callback/globals/api"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
type MtwmController struct { type MtwmController struct {
beego.Controller web.Controller
} }
func (c *MtwmController) onCallbackMsg(msgType string) { func (c *MtwmController) onCallbackMsg(msgType string) {

View File

@@ -9,11 +9,11 @@ import (
"git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/business/model/dao" "git.rosy.net.cn/jx-callback/business/model/dao"
"git.rosy.net.cn/jx-callback/business/netspider" "git.rosy.net.cn/jx-callback/business/netspider"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
type NetSpiderController struct { type NetSpiderController struct {
beego.Controller web.Controller
} }
// @Title 从网页拉取平台门店信息 // @Title 从网页拉取平台门店信息

View File

@@ -5,11 +5,11 @@ import (
"git.rosy.net.cn/jx-callback/business/jxstore/permission" "git.rosy.net.cn/jx-callback/business/jxstore/permission"
"git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/jxutils"
"git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
type PowerController struct { type PowerController struct {
beego.Controller web.Controller
} }
// @Title 添加功能(菜单) // @Title 添加功能(菜单)

View File

@@ -16,11 +16,11 @@ import (
"git.rosy.net.cn/jx-callback/business/jxutils/eventhub/syseventhub" "git.rosy.net.cn/jx-callback/business/jxutils/eventhub/syseventhub"
"git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
type SysController struct { type SysController struct {
beego.Controller web.Controller
} }
// @Title 得到微信token // @Title 得到微信token

View File

@@ -5,11 +5,11 @@ import (
"git.rosy.net.cn/jx-callback/business/jxstore/misc" "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/jxstore/tempop"
"git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/jxutils"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
type TempOpController struct { type TempOpController struct {
beego.Controller web.Controller
} }
// @Title 将为份的商品在京东转成SPU // @Title 将为份的商品在京东转成SPU

View File

@@ -11,12 +11,12 @@ import (
"git.rosy.net.cn/jx-callback/business/partner/purchase/jx/localjx" "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"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
"github.com/astaxie/beego/server/web/context" "github.com/astaxie/beego/server/web/context"
) )
type TongLianController struct { type TongLianController struct {
beego.Controller web.Controller
} }
func (c *TongLianController) Msg() { func (c *TongLianController) Msg() {

View File

@@ -6,11 +6,11 @@ import (
"git.rosy.net.cn/jx-callback/business/jxutils/tasks" "git.rosy.net.cn/jx-callback/business/jxutils/tasks"
"git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals"
"git.rosy.net.cn/jx-callback/globals/api" "git.rosy.net.cn/jx-callback/globals/api"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
type WeimobController struct { type WeimobController struct {
beego.Controller web.Controller
} }
func (c *WeimobController) onCallbackMsg() { func (c *WeimobController) onCallbackMsg() {

View File

@@ -5,11 +5,11 @@ import (
"git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals"
"git.rosy.net.cn/jx-callback/globals/api" "git.rosy.net.cn/jx-callback/globals/api"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
type WeixinController struct { type WeixinController struct {
beego.Controller web.Controller
} }
func (c *WeixinController) Msg() { func (c *WeixinController) Msg() {

View File

@@ -9,11 +9,11 @@ import (
"git.rosy.net.cn/jx-callback/business/partner/purchase/jx/localjx" "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"
"git.rosy.net.cn/jx-callback/globals/api" "git.rosy.net.cn/jx-callback/globals/api"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
type WXPayController struct { type WXPayController struct {
beego.Controller web.Controller
} }
func (c *WXPayController) Msg() { func (c *WXPayController) Msg() {

View File

@@ -5,12 +5,12 @@ import (
"git.rosy.net.cn/jx-callback/business/jxstore/yonghui" "git.rosy.net.cn/jx-callback/business/jxstore/yonghui"
"git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/jxutils"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
//读取永辉excelAPI //读取永辉excelAPI
type YongHuiController struct { type YongHuiController struct {
beego.Controller web.Controller
} }
// @Title 读取永辉excel文件 // @Title 读取永辉excel文件

View File

@@ -41,7 +41,7 @@ import (
"git.rosy.net.cn/jx-callback/business/jxutils/cache/redis" "git.rosy.net.cn/jx-callback/business/jxutils/cache/redis"
"git.rosy.net.cn/jx-callback/globals" "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" "github.com/qiniu/api.v7/auth/qbox"
) )
@@ -113,7 +113,7 @@ func init() {
func Init() { func Init() {
if !beego.AppConfig.DefaultBool("disableJd", false) { if !beego.AppConfig.DefaultBool("disableJd", false) {
//初始化京东api //初始化京东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("", "", "") JdAPI = jdapi.New("", "", "")
conf := platformapi.NewDefAPIConfig() conf := platformapi.NewDefAPIConfig()
@@ -121,54 +121,54 @@ func Init() {
JdPageAPI = jdapi.NewPageOnly("", conf) JdPageAPI = jdapi.NewPageOnly("", conf)
if globals.Jd2OrgCode != "" { 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("", "", "") Jd2API = jdapi.New("", "", "")
} }
if globals.Jd3OrgCode != "" { 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("", "", "") Jd3API = jdapi.New("", "", "")
} }
if globals.JdcsOrgCode != "" { 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("", "", "") JdAPI = jdapi.New("", "", "")
} }
if globals.JdydOrgCode != "" { 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("", "", "") JdAPI = jdapi.New("", "", "")
} }
fakeJdToken := beego.AppConfig.DefaultString("fakeJdToken", "") fakeJdToken := beego.AppConfig.DefaultString("fakeJdToken", "")
if fakeJdToken != "" { if fakeJdToken != "" {
FakeJdAPI = jdapi.NewFakeJD(fakeJdToken, beego.AppConfig.String("fakeJdBaseURL")) FakeJdAPI = jdapi.NewFakeJD(fakeJdToken, beego.AppConfig.DefaultString("fakeJdBaseURL", ""))
} }
} else { } else {
JdAPI = nil JdAPI = nil
} }
if !beego.AppConfig.DefaultBool("disableJdEclp", false) { 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 { } else {
JdEclpAPI = nil JdEclpAPI = nil
} }
if !beego.AppConfig.DefaultBool("disableJdShop", false) { if !beego.AppConfig.DefaultBool("disableJdShop", false) {
JdShopAPI = jdshopapi.New(beego.AppConfig.String("jdShopAccessToken"), beego.AppConfig.String("jdShopAppKey"), beego.AppConfig.String("jdShopAppSecret")) JdShopAPI = jdshopapi.New(beego.AppConfig.DefaultString("jdShopAccessToken", ""), beego.AppConfig.DefaultString("jdShopAppKey", ""), beego.AppConfig.DefaultString("jdShopAppSecret", ""))
JdShop2API = jdshopapi.New(beego.AppConfig.String("jdShopAccessToken2"), beego.AppConfig.String("jdShopAppKey2"), beego.AppConfig.String("jdShopAppSecret2")) JdShop2API = jdshopapi.New(beego.AppConfig.DefaultString("jdShopAccessToken2", ""), beego.AppConfig.DefaultString("jdShopAppKey2", ""), beego.AppConfig.DefaultString("jdShopAppSecret2", ""))
} else { } else {
JdShopAPI = nil JdShopAPI = nil
} }
if !beego.AppConfig.DefaultBool("disableElm", false) { 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 { } else {
ElmAPI = nil ElmAPI = nil
} }
if !beego.AppConfig.DefaultBool("disableMtwm", false) { 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 != "" { // if mtwmCookieStr := beego.AppConfig.DefaultString("mtwmCookieStr", ""); mtwmCookieStr != "" {
// MtwmAPI.SetCookieWithStr(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 { } else {
MtwmAPI = nil MtwmAPI = nil
} }
@@ -181,7 +181,7 @@ func Init() {
WeimobAPI = nil WeimobAPI = nil
} }
if !beego.AppConfig.DefaultBool("disableEbai", false) { 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", "") // ebaiStorePageCookieWMUSS := beego.AppConfig.DefaultString("ebaiStorePageCookieWMUSS", "")
// ebaiStorePageCookieWMSTOKEN := beego.AppConfig.DefaultString("ebaiStorePageCookieWMSTOKEN", "") // ebaiStorePageCookieWMSTOKEN := beego.AppConfig.DefaultString("ebaiStorePageCookieWMSTOKEN", "")
// ebaiStorePageCookieExdTOKEN := beego.AppConfig.DefaultString("ebaiStorePageCookieExdTOKEN", "") // ebaiStorePageCookieExdTOKEN := beego.AppConfig.DefaultString("ebaiStorePageCookieExdTOKEN", "")
@@ -190,7 +190,7 @@ func Init() {
// EbaiAPI.SetCookie("WMSTOKEN", ebaiStorePageCookieWMSTOKEN) // EbaiAPI.SetCookie("WMSTOKEN", ebaiStorePageCookieWMSTOKEN)
// EbaiAPI.SetCookie("PASSPORT_DELIMONT_TOKEN", ebaiStorePageCookieExdTOKEN) // 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", "") // ebaiStorePageCookieWMUSS2 := beego.AppConfig.DefaultString("ebaiStorePageCookieWMUSS2", "")
// ebaiStorePageCookieWMSTOKEN2 := beego.AppConfig.DefaultString("ebaiStorePageCookieWMSTOKEN2", "") // ebaiStorePageCookieWMSTOKEN2 := beego.AppConfig.DefaultString("ebaiStorePageCookieWMSTOKEN2", "")
// if ebaiStorePageCookieWMUSS2 != "" && ebaiStorePageCookieWMSTOKEN2 != "" && ebaiStorePageCookieExdTOKEN != "" { // if ebaiStorePageCookieWMUSS2 != "" && ebaiStorePageCookieWMSTOKEN2 != "" && ebaiStorePageCookieExdTOKEN != "" {
@@ -204,13 +204,13 @@ func Init() {
} }
if !beego.AppConfig.DefaultBool("disableYb", false) { 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 { } else {
YinBaoAPI = nil YinBaoAPI = nil
} }
if !beego.AppConfig.DefaultBool("disableMtps", false) { 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 != "" { // if mtpsStoreToken := beego.AppConfig.DefaultString("mtpsStoreToken", ""); mtpsStoreToken != "" {
// MtpsAPI.SetCookie("token", mtpsStoreToken) // MtpsAPI.SetCookie("token", mtpsStoreToken)
// } // }
@@ -218,13 +218,13 @@ func Init() {
MtpsAPI = nil MtpsAPI = nil
} }
if !beego.AppConfig.DefaultBool("disableDada", false) { 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 { } else {
DadaAPI = nil DadaAPI = nil
} }
if !beego.AppConfig.DefaultBool("disableWeixin", false) { 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 != "" { if weixinToken := beego.AppConfig.DefaultString("weixinToken", ""); weixinToken != "" {
WeixinAPI.CBSetToken(weixinToken) WeixinAPI.CBSetToken(weixinToken)
@@ -235,38 +235,38 @@ func Init() {
} else { } else {
WeimobAPI = nil WeimobAPI = nil
} }
WeixinMiniAPI = weixinapi.New(beego.AppConfig.String("weixinMiniAppID"), beego.AppConfig.String("weixinMiniSecret")) WeixinMiniAPI = weixinapi.New(beego.AppConfig.DefaultString("weixinMiniAppID", ""), beego.AppConfig.DefaultString("weixinMiniSecret", ""))
if WeixinMiniAppID2 = beego.AppConfig.String("weixinMiniAppID2"); WeixinMiniAppID2 != "" { if WeixinMiniAppID2 = beego.AppConfig.DefaultString("weixinMiniAppID2", ""); WeixinMiniAppID2 != "" {
WeixinMiniAPI2 = weixinapi.New(WeixinMiniAppID2, beego.AppConfig.String("weixinMiniSecret2")) WeixinMiniAPI2 = weixinapi.New(WeixinMiniAppID2, beego.AppConfig.DefaultString("weixinMiniSecret2", ""))
} }
WeixinPageAPI = weixinapi.New(beego.AppConfig.String("weixinPageAppID"), beego.AppConfig.String("weixinPageSecret")) WeixinPageAPI = weixinapi.New(beego.AppConfig.DefaultString("weixinPageAppID", ""), beego.AppConfig.DefaultString("weixinPageSecret", ""))
if WeixinMiniAppID3 = beego.AppConfig.String("weixinMiniAppID3"); WeixinMiniAppID3 != "" { if WeixinMiniAppID3 = beego.AppConfig.DefaultString("weixinMiniAppID3", ""); WeixinMiniAppID3 != "" {
WeixinApp = weixinapi.New(WeixinMiniAppID3, beego.AppConfig.String("weixinMiniSecret3")) WeixinApp = weixinapi.New(WeixinMiniAppID3, beego.AppConfig.DefaultString("weixinMiniSecret3", ""))
} }
if WeixinMiniAppIDsc = beego.AppConfig.String("weixinMiniAppIDsc"); WeixinMiniAppIDsc != "" { if WeixinMiniAppIDsc = beego.AppConfig.DefaultString("weixinMiniAppIDsc", ""); WeixinMiniAppIDsc != "" {
WeixinMiniAPIsc = weixinapi.New(WeixinMiniAppIDsc, beego.AppConfig.String("weixinMiniSecretsc")) WeixinMiniAPIsc = weixinapi.New(WeixinMiniAppIDsc, beego.AppConfig.DefaultString("weixinMiniSecretsc", ""))
} }
if globals.WxpayNotifyURL != "" { if globals.WxpayNotifyURL != "" {
// WxpayAPI = wxpayapi.New(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.String("wxpayAppID"), beego.AppConfig.String("wxpayAppKey"), beego.AppConfig.String("wxpayAppMchID"), WxpayAPI = wxpayapi.NewWithCertificate(beego.AppConfig.DefaultString("wxpayAppID", ""), beego.AppConfig.DefaultString("wxpayAppKey", ""), beego.AppConfig.DefaultString("wxpayAppMchID", ""),
"conf/apiclient_cert.pem", "conf/apiclient_key.pem") "conf/apiclient_cert.pem", "conf/apiclient_key.pem")
} }
if globals.TLPayNotifyURL != "" { 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")) AutonaviAPI = autonavi.New(beego.AppConfig.DefaultString("autonaviKey", ""))
BaiDuNaviAPI = baidunavi.New(beego.AppConfig.String("baidunaviAK"), beego.AppConfig.String("baidunaviSK")) BaiDuNaviAPI = baidunavi.New(beego.AppConfig.DefaultString("baidunaviAK", ""), beego.AppConfig.DefaultString("baidunaviSK", ""))
QiniuAPI = qbox.NewMac(beego.AppConfig.String("qiniuAK"), beego.AppConfig.String("qiniuSK")) QiniuAPI = qbox.NewMac(beego.AppConfig.DefaultString("qiniuAK", ""), beego.AppConfig.DefaultString("qiniuSK", ""))
ShowAPI = showapi.New(beego.AppConfig.DefaultInt("showAppID", 0), beego.AppConfig.DefaultString("showAppSecret", "")) 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", "")) 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", "")) 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", "")) DingDingQRCodeAPI = dingdingapi.New(beego.AppConfig.DefaultString("dingdingCorpID", ""), beego.AppConfig.DefaultString("dingdingQRCodeAppKey", ""), beego.AppConfig.DefaultString("dingdingQRCodeSecret", ""))
if alipayAppID := beego.AppConfig.DefaultString("alipayAppID", ""); alipayAppID != "" { 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", "")) FnAPI = fnpsapi.New(beego.AppConfig.DefaultString("fnAppID", ""), beego.AppConfig.DefaultString("fnAppSecret", ""))

View File

@@ -2,8 +2,8 @@ package globals
import ( import (
"git.rosy.net.cn/baseapi" "git.rosy.net.cn/baseapi"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/core/logs"
"github.com/astaxie/beego/adapter/logs" "github.com/astaxie/beego/server/web"
_ "github.com/go-sql-driver/mysql" // import your used driver _ "github.com/go-sql-driver/mysql" // import your used driver
"go.uber.org/zap" "go.uber.org/zap"
) )
@@ -78,7 +78,7 @@ var (
func init() { func init() {
logs.SetLogFuncCallDepth(3) logs.SetLogFuncCallDepth(3)
beego.BConfig.Log.AccessLogs = true web.BConfig.Log.AccessLogs = true
logger, _ := zap.NewDevelopment() logger, _ := zap.NewDevelopment()
SugarLogger = logger.Sugar() SugarLogger = logger.Sugar()
@@ -91,77 +91,77 @@ func Init() {
OutputDebugMsgLevel = 1 OutputDebugMsgLevel = 1
} }
SugarLogger.Infof("globals RunMode=%s", beego.BConfig.RunMode) SugarLogger.Infof("globals RunMode=%s", web.BConfig.RunMode)
ReallyCallPlatformAPI = (beego.BConfig.RunMode != "dev" && beego.BConfig.RunMode != "test") ReallyCallPlatformAPI = (web.BConfig.RunMode != "dev" && web.BConfig.RunMode != "test")
ReallySendWeixinMsg = ReallyCallPlatformAPI && IsProductEnv() ReallySendWeixinMsg = ReallyCallPlatformAPI && IsProductEnv()
AliKey = beego.AppConfig.DefaultString("aliKey", "") AliKey = web.AppConfig.DefaultString("aliKey", "")
AliSecret = beego.AppConfig.DefaultString("aliSecret", "") AliSecret = web.AppConfig.DefaultString("aliSecret", "")
EnableStoreWrite = beego.AppConfig.DefaultBool("enableStoreWrite", false) EnableStoreWrite = web.AppConfig.DefaultBool("enableStoreWrite", false)
EnableJdStoreWrite = EnableStoreWrite && beego.AppConfig.DefaultBool("enableJdStoreWrite", false) EnableJdStoreWrite = EnableStoreWrite && web.AppConfig.DefaultBool("enableJdStoreWrite", false)
EnableEbaiStoreWrite = EnableStoreWrite && beego.AppConfig.DefaultBool("enableEbaiStoreWrite", false) EnableEbaiStoreWrite = EnableStoreWrite && web.AppConfig.DefaultBool("enableEbaiStoreWrite", false)
EnableElmStoreWrite = EnableStoreWrite && beego.AppConfig.DefaultBool("enableElmStoreWrite", false) EnableElmStoreWrite = EnableStoreWrite && web.AppConfig.DefaultBool("enableElmStoreWrite", false)
EnableMtwmStoreWrite = EnableStoreWrite && beego.AppConfig.DefaultBool("enableMtwmStoreWrite", false) EnableMtwmStoreWrite = EnableStoreWrite && web.AppConfig.DefaultBool("enableMtwmStoreWrite", false)
EnableWscStoreWrite = EnableStoreWrite && beego.AppConfig.DefaultBool("enableWscStoreWrite", false) EnableWscStoreWrite = EnableStoreWrite && web.AppConfig.DefaultBool("enableWscStoreWrite", false)
// EnablePendingChange = beego.AppConfig.DefaultBool("enablePendingChange", false) // EnablePendingChange = web.AppConfig.DefaultBool("enablePendingChange", false)
EnableYbStoreWrite = EnableStoreWrite && beego.AppConfig.DefaultBool("enableYbStoreWrite", false) EnableYbStoreWrite = EnableStoreWrite && web.AppConfig.DefaultBool("enableYbStoreWrite", false)
EnableJdShopWrite = EnableStoreWrite && beego.AppConfig.DefaultBool("enableJdShopWrite", false) EnableJdShopWrite = EnableStoreWrite && web.AppConfig.DefaultBool("enableJdShopWrite", false)
QiniuBucket = beego.AppConfig.String("qiniuBucket") QiniuBucket = web.AppConfig.DefaultString("qiniuBucket", "")
WeimobCallbackURL = beego.AppConfig.DefaultString("weimobCallbackURL", "") WeimobCallbackURL = web.AppConfig.DefaultString("weimobCallbackURL", "")
WeimobStateSecret = beego.AppConfig.DefaultString("weimobStateSecret", "") WeimobStateSecret = web.AppConfig.DefaultString("weimobStateSecret", "")
BackstageHost = beego.AppConfig.DefaultString("backstageHost", "") BackstageHost = web.AppConfig.DefaultString("backstageHost", "")
WxBackstageHost = beego.AppConfig.DefaultString("wxBackstageHost", "") WxBackstageHost = web.AppConfig.DefaultString("wxBackstageHost", "")
GetWeixinTokenURL = beego.AppConfig.DefaultString("getWeixinTokenURL", "") GetWeixinTokenURL = web.AppConfig.DefaultString("getWeixinTokenURL", "")
GetWeixin2TokenURL = beego.AppConfig.DefaultString("getWeixin2TokenURL", "") GetWeixin2TokenURL = web.AppConfig.DefaultString("getWeixin2TokenURL", "")
GetYLYTokenURL = beego.AppConfig.DefaultString("getYLYTokenURL", "") GetYLYTokenURL = web.AppConfig.DefaultString("getYLYTokenURL", "")
GetWeimobTokenURL = beego.AppConfig.DefaultString("getWeimobTokenURL", "") GetWeimobTokenURL = web.AppConfig.DefaultString("getWeimobTokenURL", "")
GetWeixinTokenKey = beego.AppConfig.DefaultString("getWeixinTokenKey", "") GetWeixinTokenKey = web.AppConfig.DefaultString("getWeixinTokenKey", "")
GetPushTokenURL = beego.AppConfig.DefaultString("getPushTokenURL", "") GetPushTokenURL = web.AppConfig.DefaultString("getPushTokenURL", "")
StoreName = beego.AppConfig.String("storeName") StoreName = web.AppConfig.DefaultString("storeName", "")
StoreNameMtwm = beego.AppConfig.String("storeNameMtwm") StoreNameMtwm = web.AppConfig.DefaultString("storeNameMtwm", "")
StoreNameEbai = beego.AppConfig.String("storeNameEbai") StoreNameEbai = web.AppConfig.DefaultString("storeNameEbai", "")
StoreNameEbai2 = beego.AppConfig.String("storeNameEbai2") StoreNameEbai2 = web.AppConfig.DefaultString("storeNameEbai2", "")
SMSSignName = beego.AppConfig.String("smsSignName") SMSSignName = web.AppConfig.DefaultString("smsSignName", "")
SMSMobileVerifyTemplate = beego.AppConfig.String("smsMobileVerifyTemplate") SMSMobileVerifyTemplate = web.AppConfig.DefaultString("smsMobileVerifyTemplate", "")
SMSNewOrderTemplate = beego.AppConfig.String("smsNewOrderTemplate") SMSNewOrderTemplate = web.AppConfig.DefaultString("smsNewOrderTemplate", "")
SMSNewOrderTemplateQ = beego.AppConfig.String("smsNewOrderTemplateQ") SMSNewOrderTemplateQ = web.AppConfig.DefaultString("smsNewOrderTemplateQ", "")
SMSOrderCanceledTemplate = beego.AppConfig.String("smsOrderCanceledTemplate") SMSOrderCanceledTemplate = web.AppConfig.DefaultString("smsOrderCanceledTemplate", "")
SMSNewUserOrderTemplate = beego.AppConfig.String("smsNewUserOrderTemplate") SMSNewUserOrderTemplate = web.AppConfig.DefaultString("smsNewUserOrderTemplate", "")
EnableWXAuth2 = true // beego.BConfig.RunMode == "beta" EnableWXAuth2 = true // web.BConfig.RunMode == "beta"
DisableWXAuth1 = true DisableWXAuth1 = true
WxpayNotifyURL = beego.AppConfig.DefaultString("wxpayNotifyURL", "") WxpayNotifyURL = web.AppConfig.DefaultString("wxpayNotifyURL", "")
TLPayNotifyURL = beego.AppConfig.DefaultString("tonglianPayNotifyURL", "") TLPayNotifyURL = web.AppConfig.DefaultString("tonglianPayNotifyURL", "")
FnNotifyURL = beego.AppConfig.DefaultString("fnCallbackURL", "") FnNotifyURL = web.AppConfig.DefaultString("fnCallbackURL", "")
JdOrgCode = beego.AppConfig.DefaultString("jdOrgCode", "") JdOrgCode = web.AppConfig.DefaultString("jdOrgCode", "")
Jd2OrgCode = beego.AppConfig.DefaultString("jd2OrgCode", "") Jd2OrgCode = web.AppConfig.DefaultString("jd2OrgCode", "")
Jd3OrgCode = beego.AppConfig.DefaultString("jd3OrgCode", "") Jd3OrgCode = web.AppConfig.DefaultString("jd3OrgCode", "")
JdcsOrgCode = beego.AppConfig.DefaultString("jdcsOrgCode", "") JdcsOrgCode = web.AppConfig.DefaultString("jdcsOrgCode", "")
JdydOrgCode = beego.AppConfig.DefaultString("jdydOrgCode", "") JdydOrgCode = web.AppConfig.DefaultString("jdydOrgCode", "")
JdLoginName = beego.AppConfig.DefaultString("jdLoginName", "") JdLoginName = web.AppConfig.DefaultString("jdLoginName", "")
IsAddEvent = beego.AppConfig.DefaultBool("addEvent", false) IsAddEvent = web.AppConfig.DefaultBool("addEvent", false)
IsStoreSkuAct = !IsProductEnv() IsStoreSkuAct = !IsProductEnv()
MtwmCode = beego.AppConfig.DefaultString("mtwmAppID", "") MtwmCode = web.AppConfig.DefaultString("mtwmAppID", "")
Mtwm2Code = beego.AppConfig.DefaultString("mtwmAppID2", "") Mtwm2Code = web.AppConfig.DefaultString("mtwmAppID2", "")
} }
func IsCallbackAlwaysReturnSuccess() bool { func IsCallbackAlwaysReturnSuccess() bool {
return beego.BConfig.RunMode == "beta" return web.BConfig.RunMode == "beta"
} }
func IsMainProductEnv() bool { func IsMainProductEnv() bool {
return beego.BConfig.RunMode == "prod" return web.BConfig.RunMode == "prod"
} }
func IsProductEnv() bool { func IsProductEnv() bool {
return IsMainProductEnv() || beego.BConfig.RunMode == "jxgy" return IsMainProductEnv() || web.BConfig.RunMode == "jxgy"
} }

View File

@@ -6,7 +6,7 @@ import (
"git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals"
"git.rosy.net.cn/jx-callback/globals/beegodb" "git.rosy.net.cn/jx-callback/globals/beegodb"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
) )
func Init() { func Init() {

View File

@@ -12,7 +12,7 @@ import (
"git.rosy.net.cn/jx-callback/business/partner/purchase/yb" "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/platformapi/dingdingapi"
"git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/baseapi/utils"

View File

@@ -9,7 +9,7 @@ import (
_ "git.rosy.net.cn/jx-callback/routers" _ "git.rosy.net.cn/jx-callback/routers"
beego "github.com/astaxie/beego/adapter" "github.com/astaxie/beego/server/web"
. "github.com/smartystreets/goconvey/convey" . "github.com/smartystreets/goconvey/convey"
) )