This commit is contained in:
苏尹岚
2019-10-31 13:55:29 +08:00
42 changed files with 647 additions and 454 deletions

View File

@@ -115,7 +115,7 @@ func (c *SyncController) FullSyncStoresSkus() {
if err = jxutils.Strings2Objs(params.StoreIDs, &storeIDs, params.VendorIDs, &vendorIDs); err != nil {
return retVal, "", err
}
retVal, err = cms.CurVendorSync.FullSyncStoresSkus(params.Ctx, db, vendorIDs, storeIDs, params.IsAsync, params.IsContinueWhenError)
retVal, err = cms.CurVendorSync.FullSyncStoresSkus(params.Ctx, db, vendorIDs, storeIDs, true, params.IsAsync, params.IsContinueWhenError)
return retVal, "", err
})
}

View File

@@ -255,19 +255,19 @@ func (c *User2Controller) TransferLegacyWeixins() {
// @Param token header string true "认证token"
// @Param consigneeName formData string true "收货人"
// @Param consigneeMobile formData string true "收货人手机"
// @Param address formData string true "详细地址"
// @Param address formData string false "地址(区县以下,门牌号以上的地址信息)"
// @Param detailAddress formData string false "门牌号"
// @Param lng formData float64 true "经度"
// @Param lat formData float64 true "纬度"
// @Param tag formData string false "标签"
// @Param remark formData string false "备注"
// @Param isDefault formData bool false "是否是默认"
// @Param isDefault formData int false "是否是默认"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /AddMyDeliveryAddress [post]
func (c *User2Controller) AddMyDeliveryAddress() {
c.callAddMyDeliveryAddress(func(params *tUser2AddMyDeliveryAddressParams) (retVal interface{}, errCode string, err error) {
var address *model.UserDeliveryAddress
params.MapData["isDefault"] = utils.Bool2Int(params.IsDefault)
if err = utils.Map2StructByJson(params.MapData, &address, true); err == nil {
retVal, err = cms.AddMyDeliveryAddress(params.Ctx, address)
}
@@ -278,13 +278,13 @@ func (c *User2Controller) AddMyDeliveryAddress() {
// @Title 用户自己删除配送地址
// @Description 用户自己删除送地址
// @Param token header string true "认证token"
// @Param addressID query int true "地址ID"
// @Param id query int true "地址ID"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /DeleteMyDeliveryAddress [delete]
func (c *User2Controller) DeleteMyDeliveryAddress() {
c.callDeleteMyDeliveryAddress(func(params *tUser2DeleteMyDeliveryAddressParams) (retVal interface{}, errCode string, err error) {
err = cms.DeleteMyDeliveryAddress(params.Ctx, params.AddressID)
err = cms.DeleteMyDeliveryAddress(params.Ctx, params.Id)
return retVal, "", err
})
}
@@ -292,10 +292,11 @@ func (c *User2Controller) DeleteMyDeliveryAddress() {
// @Title 用户自己修改配送地址
// @Description 用户自己修改配送地址
// @Param token header string true "认证token"
// @Param addressID formData int true "地址ID"
// @Param id formData int true "地址ID"
// @Param consigneeName formData string false "收货人"
// @Param consigneeMobile formData string false "收货人手机"
// @Param address formData string false "详细地址"
// @Param address formData string false "地址(区县以下,门牌号以上的地址信息)"
// @Param detailAddress formData string false "门牌号"
// @Param lng formData float64 false "经度"
// @Param lat formData float64 false "纬度"
// @Param tag formData string false "标签"
@@ -306,7 +307,7 @@ func (c *User2Controller) DeleteMyDeliveryAddress() {
// @router /UpdateMyDeliveryAddress [put]
func (c *User2Controller) UpdateMyDeliveryAddress() {
c.callUpdateMyDeliveryAddress(func(params *tUser2UpdateMyDeliveryAddressParams) (retVal interface{}, errCode string, err error) {
err = cms.UpdateMyDeliveryAddress(params.Ctx, params.AddressID, params.MapData)
err = cms.UpdateMyDeliveryAddress(params.Ctx, params.Id, params.MapData)
return retVal, "", err
})
}
@@ -327,14 +328,17 @@ func (c *User2Controller) QueryMyDeliveryAddress() {
// @Title 得到用户指定门店的购物车信息
// @Description 得到用户指定门店的购物车信息
// @Param token header string true "认证token"
// @Param storeID query int true "门店ID"
// @Param storeIDs query string true "门店ID"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /LoadMyCart [get]
func (c *User2Controller) LoadMyCart() {
c.callLoadMyCart(func(params *tUser2LoadMyCartParams) (retVal interface{}, errCode string, err error) {
_, userID := params.Ctx.GetMobileAndUserID()
retVal, err = cms.LoadUserCart(params.Ctx, userID, params.StoreID)
var storeIDs []int
if err = jxutils.Strings2Objs(params.StoreIDs, &storeIDs); err == nil {
retVal, err = cms.LoadUserCart(params.Ctx, userID, storeIDs)
}
return retVal, "", err
})
}
@@ -343,7 +347,7 @@ func (c *User2Controller) LoadMyCart() {
// @Description 存储用户指定门店的购物车信息
// @Param token header string true "认证token"
// @Param storeID formData int true "门店ID"
// @Param payload formData string true "完整的购物车商品列表"
// @Param payload formData string false "完整的购物车商品列表"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /SaveMyCart [post]

View File

@@ -42,12 +42,13 @@ func (c *InitDataController) InitSkuName() {
// @Description 初始化vendor category当前只有美团外卖的通过这个设置
// @Param token header string true "认证token"
// @Param vendorID formData int true "厂商ID"
// @Param isAsync formData bool false "是否异步操作"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /InitVendorCategory [post]
func (c *InitDataController) InitVendorCategory() {
c.callInitVendorCategory(func(params *tInitdataInitVendorCategoryParams) (retVal interface{}, errCode string, err error) {
retVal, err = initdata.InitVendorCategory(params.Ctx, params.VendorID)
retVal, err = initdata.InitVendorCategory(params.Ctx, params.VendorID, params.IsAsync)
return retVal, "", err
})
}

View File

@@ -283,7 +283,7 @@ func (c *OrderController) ExportMTWaybills() {
// @Param pageSize query int false "结果页大小缺省为50-1表示全部"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetOrders [get]
// @router /GetOrders [get,post]
func (c *OrderController) GetOrders() {
c.callGetOrders(func(params *tOrderGetOrdersParams) (retVal interface{}, errCode string, err error) {
var skuIDs []int
@@ -335,7 +335,7 @@ func (c *OrderController) ExportOrders() {
// @Param pageSize query int false "结果页大小缺省为50-1表示全部"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetAfsOrders [get]
// @router /GetAfsOrders [get,post]
func (c *OrderController) GetAfsOrders() {
c.callGetAfsOrders(func(params *tOrderGetAfsOrdersParams) (retVal interface{}, errCode string, err error) {
timeList, err := jxutils.BatchStr2Time(params.FromTime, params.ToTime)

View File

@@ -20,8 +20,8 @@ type SysController struct {
beego.Controller
}
// @Title 得到京西门店信息
// @Description 得到京西门店信息,如下条件之间是与的关系
// @Title 得到微信token
// @Description 得到微信token
// @Param accessKey query string true "假token"
// @Param oldToken query string false "之前的token"
// @Param waitSecond query int false "等待秒数"
@@ -37,6 +37,40 @@ func (c *SysController) GetWXToken() {
})
}
// @Title 得到易联云token
// @Description 得到易联云token
// @Param accessKey query string true "假token"
// @Param oldToken query string false "之前的token"
// @Param waitSecond query int false "等待秒数"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetYLYToken [get]
func (c *SysController) GetYLYToken() {
c.callGetYLYToken(func(params *tSysGetYLYTokenParams) (retVal interface{}, errCode string, err error) {
if params.AccessKey == globals.GetWeixinTokenKey {
retVal = syseventhub.SysEventHub.GetYLYToken(params.OldToken, time.Duration(params.WaitSecond)*time.Second)
}
return retVal, "", err
})
}
// @Title 得到微盟token
// @Description 得到微盟token
// @Param accessKey query string true "假token"
// @Param oldToken query string false "之前的token"
// @Param waitSecond query int false "等待秒数"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetWeimobToken [get]
func (c *SysController) GetWeimobToken() {
c.callGetWeimobToken(func(params *tSysGetWeimobTokenParams) (retVal interface{}, errCode string, err error) {
if params.AccessKey == globals.GetWeixinTokenKey {
retVal = syseventhub.SysEventHub.GetWeimobToken(params.OldToken, time.Duration(params.WaitSecond)*time.Second)
}
return retVal, "", err
})
}
// @Title 得到饿百RTF转换内容
// @Description 得到饿百RTF转换内容
// @Param imgListStr query string true "逗号分隔的图片列表可以是转义后的"

View File

@@ -3,6 +3,7 @@ package controllers
import (
"git.rosy.net.cn/baseapi/platformapi/weimobapi"
"git.rosy.net.cn/jx-callback/business/jxutils/tasks"
"git.rosy.net.cn/jx-callback/business/cs"
"git.rosy.net.cn/jx-callback/globals"
"git.rosy.net.cn/jx-callback/globals/api"
"github.com/astaxie/beego"
@@ -15,10 +16,11 @@ type WeimobController struct {
func (c *WeimobController) onCallbackMsg() {
if true { //c.Ctx.Input.Method() == http.MethodPost {
callbackResponse := weimobapi.SuccessResponse
// msg, callbackResponse := api.WeimobAPI.GetCallbackMsg(c.Ctx.Input.RequestBody)
// if callbackResponse == nil {
// callbackResponse = wsc.OnCallbackMsg(msg)
// }
msg, callbackResponse := api.WeimobAPI.GetCallbackMsg(c.Ctx.Input.RequestBody)
if callbackResponse == nil {
// callbackResponse = wsc.OnCallbackMsg(msg)
callbackResponse = cs.OnCallbackMsg(msg)
}
c.Data["json"] = callbackResponse
c.ServeJSON()
} else {

View File

@@ -0,0 +1,26 @@
package controllers
import (
"net/http"
"git.rosy.net.cn/baseapi/platformapi/wxpay"
"github.com/astaxie/beego"
)
type WXPayController struct {
beego.Controller
}
func (c *WXPayController) Msg() {
if c.Ctx.Input.Method() == http.MethodPost {
var callbackResponse *wxpay.CallbackResponse
if callbackResponse == nil {
callbackResponse = wxpay.SuccessResponse
}
c.Data["xml"] = callbackResponse
c.ServeXML()
} else {
c.Abort("404")
}
}