165 lines
7.3 KiB
Go
165 lines
7.3 KiB
Go
package controllers
|
||
|
||
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"
|
||
"git.rosy.net.cn/jx-callback/globals/api"
|
||
"github.com/astaxie/beego/server/web"
|
||
)
|
||
|
||
type UnionController struct {
|
||
web.Controller
|
||
}
|
||
|
||
// @Title 查询联盟活动
|
||
// @Description 查询联盟活动
|
||
// @Param token header string true "认证token"
|
||
// @Param vendorID query int true "平台ID"
|
||
// @Param actType query int true "活动类型ID"
|
||
// @Success 200 {object} controllers.CallResult
|
||
// @Failure 200 {object} controllers.CallResult
|
||
// @router /GetUnionActList [get]
|
||
func (c *UnionController) GetUnionActList() {
|
||
c.callGetUnionActList(func(params *tUnionGetUnionActListParams) (retVal interface{}, errCode string, err error) {
|
||
retVal, err = cms.GetUnionActList(params.Ctx, params.VendorID, params.ActType)
|
||
return retVal, "", err
|
||
})
|
||
}
|
||
|
||
// @Title 分享联盟链接
|
||
// @Description 分享联盟链接
|
||
// @Param token header string true "认证token"
|
||
// @Param jobID formData int true "任务ID"
|
||
// @Param shareType formData int true "分享类型,1为当前用户分享给别人,2为当前用户自己领取"
|
||
// @Param resourceType formData int false "资源类型"
|
||
// @Param linkType formData int true "链接类型,1 h5链接 2 deeplink(唤起)链接 3 中间页唤起链接 4 微信小程序唤起路径, 5为小程序二维码"
|
||
// @Param goodsID formData string false "分享商品时的商品ID"
|
||
// @Success 200 {object} controllers.CallResult
|
||
// @Failure 200 {object} controllers.CallResult
|
||
// @router /ShareUnionLink [post]
|
||
func (c *UnionController) ShareUnionLink() {
|
||
c.callShareUnionLink(func(params *tUnionShareUnionLinkParams) (retVal interface{}, errCode string, err error) {
|
||
retVal, err = cms.ShareUnionLink(params.Ctx, params.JobID, params.ShareType, params.LinkType, params.ResourceType, params.GoodsID)
|
||
return retVal, "", err
|
||
})
|
||
}
|
||
|
||
// @Title 查看接取的联盟任务执行情况
|
||
// @Description 查看接取的联盟任务执行情况
|
||
// @Param token header string true "认证token"
|
||
// @Param jobOrderID query int true "接取任务ID"
|
||
// @Success 200 {object} controllers.CallResult
|
||
// @Failure 200 {object} controllers.CallResult
|
||
// @router /GetUnionJobOrderInfo [get]
|
||
func (c *UnionController) GetUnionJobOrderInfo() {
|
||
c.callGetUnionJobOrderInfo(func(params *tUnionGetUnionJobOrderInfoParams) (retVal interface{}, errCode string, err error) {
|
||
retVal, err = cms.GetUnionJobOrderInfo(params.Ctx, params.JobOrderID)
|
||
return retVal, "", err
|
||
})
|
||
}
|
||
|
||
// @Title 查询平台物料分类
|
||
// @Description 查询平台物料分类
|
||
// @Param token header string false "认证token"
|
||
// @Param vendorID query int true "平台ID"
|
||
// @Success 200 {object} controllers.CallResult
|
||
// @Failure 200 {object} controllers.CallResult
|
||
// @router /GetVendorMatterCategory [get]
|
||
func (c *UnionController) GetVendorMatterCategory() {
|
||
c.callGetVendorMatterCategory(func(params *tUnionGetVendorMatterCategoryParams) (retVal interface{}, errCode string, err error) {
|
||
retVal, err = dao.GetVendorMatterCategory(dao.GetDB(), params.VendorID)
|
||
return retVal, "", err
|
||
})
|
||
}
|
||
|
||
// @Title 查询平台物料
|
||
// @Description 查询平台物料
|
||
// @Param token header string true "认证token"
|
||
// @Param vendorID query int true "平台ID"
|
||
// @Param vendorCatID query string false "平台分类ID"
|
||
// @Param keyword query string false "关键字"
|
||
// @Param offset query int false "页码"
|
||
// @Param pageSize query int false "页大小"
|
||
// @Param listID query string false "分页用"
|
||
// @Param sortType query int false "排序类型"
|
||
// @Success 200 {object} controllers.CallResult
|
||
// @Failure 200 {object} controllers.CallResult
|
||
// @router /GetVendorMatters [get]
|
||
func (c *UnionController) GetVendorMatters() {
|
||
c.callGetVendorMatters(func(params *tUnionGetVendorMattersParams) (retVal interface{}, errCode string, err error) {
|
||
retVal, err = cms.GetVendorMatters(params.Ctx, params.VendorID, params.VendorCatID, params.Keyword, params.Offset, params.PageSize, params.SortType, params.ListID)
|
||
return retVal, "", err
|
||
})
|
||
}
|
||
|
||
// @Title 查询平台物料详情
|
||
// @Description 查询平台物料详情
|
||
// @Param token header string true "认证token"
|
||
// @Param vendorID query int true "平台ID"
|
||
// @Param goodsID query string true "平台商品ID"
|
||
// @Success 200 {object} controllers.CallResult
|
||
// @Failure 200 {object} controllers.CallResult
|
||
// @router /GetVendorMatterDetail [get]
|
||
func (c *UnionController) GetVendorMatterDetail() {
|
||
c.callGetVendorMatterDetail(func(params *tUnionGetVendorMatterDetailParams) (retVal interface{}, errCode string, err error) {
|
||
retVal, err = cms.GetVendorMatterDetail(params.Ctx, params.VendorID, params.GoodsID)
|
||
return retVal, "", err
|
||
})
|
||
}
|
||
|
||
// @Title 查询平台物料推荐
|
||
// @Description 查询平台物料推荐
|
||
// @Param token header string true "认证token"
|
||
// @Param vendorID query int true "平台ID"
|
||
// @Param goodsID query string true "平台商品ID"
|
||
// @Param rcmmdType query int true "推荐类型,1为今日销量榜,3为相似商品,5为实时热销榜"
|
||
// @Param offset query int false "页码"
|
||
// @Param pageSize query int false "页大小"
|
||
// @Success 200 {object} controllers.CallResult
|
||
// @Failure 200 {object} controllers.CallResult
|
||
// @router /GetVendorMatterRcmmd [get]
|
||
func (c *UnionController) GetVendorMatterRcmmd() {
|
||
c.callGetVendorMatterRcmmd(func(params *tUnionGetVendorMatterRcmmdParams) (retVal interface{}, errCode string, err error) {
|
||
retVal, err = cms.GetVendorMatterRcmmd(params.Ctx, params.VendorID, params.GoodsID, params.RcmmdType, params.Offset, params.PageSize)
|
||
return retVal, "", err
|
||
})
|
||
}
|
||
|
||
// @Title 查询拼多多分享前,推广位有没有绑定授权
|
||
// @Description 查询拼多多分享前,推广位有没有绑定授权
|
||
// @Param token header string true "认证token"
|
||
// @Success 200 {object} controllers.CallResult
|
||
// @Failure 200 {object} controllers.CallResult
|
||
// @router /GetPddBindInfo [get]
|
||
func (c *UnionController) GetPddBindInfo() {
|
||
c.callGetPddBindInfo(func(params *tUnionGetPddBindInfoParams) (retVal interface{}, errCode string, err error) {
|
||
retVal, err = api.PddAPI.MemberAuthorityQuery(params.Ctx.GetUserID())
|
||
return retVal, "", err
|
||
})
|
||
}
|
||
|
||
// @Title 查询联盟订单
|
||
// @Description 查询联盟订单
|
||
// @Param token header string true "认证token"
|
||
// @Param vendorIDs query string false "平台IDs"
|
||
// @Param statuss query string false "订单状态s"
|
||
// @Param beginTime query string false "开始时间"
|
||
// @Param endTime query string false "结束时间"
|
||
// @Param keyword query string false "关键字"
|
||
// @Param offset query int false "页码"
|
||
// @Param pageSize query int false "页大小"
|
||
// @Success 200 {object} controllers.CallResult
|
||
// @Failure 200 {object} controllers.CallResult
|
||
// @router /GetUnionOrders [get]
|
||
func (c *UnionController) GetUnionOrders() {
|
||
c.callGetUnionOrders(func(params *tUnionGetUnionOrdersParams) (retVal interface{}, errCode string, err error) {
|
||
var vendorIDs []int
|
||
var statuss []int
|
||
if err = jxutils.Strings2Objs(params.VendorIDs, &vendorIDs, params.Statuss, &statuss); err == nil {
|
||
retVal, err = cms.GetUnionOrders(params.Ctx, vendorIDs, statuss, params.BeginTime, params.EndTime, params.Keyword, params.Offset, params.PageSize)
|
||
}
|
||
return retVal, "", err
|
||
})
|
||
}
|