- add jxcontext.Context to all public API.

This commit is contained in:
gazebo
2018-10-21 22:41:11 +08:00
parent 5d2bf9a510
commit b51ceb3d1d
22 changed files with 228 additions and 200 deletions

View File

@@ -44,7 +44,7 @@ func (c *PromotionController) CreatePromotion() {
}
if err = utils.UnmarshalUseNumber([]byte(params.StoreIDs), &promotionParams.StoreIDs); err == nil {
if err = utils.UnmarshalUseNumber([]byte(params.SkuPrices), &promotionParams.SkuPrices); err == nil {
retVal, err = promotion.CreateJdPromotion(false, params.IsAsync, promotionParams, GetUserNameFromToken(params.Token))
retVal, err = promotion.CreateJdPromotion(params.Ctx, false, params.IsAsync, promotionParams, params.Ctx.GetUserName())
}
}
return retVal, "", err
@@ -79,7 +79,7 @@ func (c *PromotionController) CreatePromotionByExcel() {
c.callCreatePromotionByExcel(func(params *tPromotionCreatePromotionByExcelParams) (retVal interface{}, errCode string, err error) {
r := c.Ctx.Request
files := r.MultipartForm.File["userfile"]
retVal, err = promotion.CreatePromotionByExcel(params.IsAsync, params.Type, files[0], "userName") //GetUserNameFromToken(params.Token))
retVal, err = promotion.CreatePromotionByExcel(params.Ctx, params.IsAsync, params.Type, files[0], "userName") //params.Ctx.GetUserName())
return retVal, "", err
})
}
@@ -96,7 +96,7 @@ func (c *PromotionController) CreatePromotionByExcel() {
// @router /SendAdvertingByGoodsOrder [post]
func (c *PromotionController) SendAdvertingByGoodsOrder() {
c.callSendAdvertingByGoodsOrder(func(params *tPromotionSendAdvertingByGoodsOrderParams) (retVal interface{}, errCode string, err error) {
retVal, err = promotion.SendAdvertingByGoodsOrder(params.Advertising, params.Days, params.IsAsync, GetUserNameFromToken(params.Token))
retVal, err = promotion.SendAdvertingByGoodsOrder(params.Ctx, params.Advertising, params.Days, params.IsAsync, params.Ctx.GetUserName())
return retVal, "", err
})
}