This commit is contained in:
suyl
2021-09-06 13:35:29 +08:00
parent 6222a7bf61
commit 258aa7acb2
4 changed files with 97 additions and 6 deletions

View File

@@ -249,3 +249,7 @@ func CallbackBrandBill(res *SecretNumberMsgRes) (err error) {
err = errLists.GetErrListAsOne() err = errLists.GetErrListAsOne()
return err return err
} }
func GetBrandSecretNumbers(ctx *jxcontext.Context, brandID int) (results []*model.SecretNumber, err error) {
return dao.GetBrandSecretNumbers(dao.GetDB(), brandID)
}

View File

@@ -1433,3 +1433,15 @@ func GetBrandCategoryMap(db *DaoDB, parentID, level, brandID, categoryID int) (b
} }
return brandCatMaps, err return brandCatMaps, err
} }
func GetBrandSecretNumbers(db *DaoDB, brandID int) (results []*model.SecretNumber, err error) {
sql := `
SELECT a.*
FROM secret_number a
LEFT JOIN brand b ON a.pool_key = b.pool_key
WHERE b.deleted_at = ? AND b.id = ?
`
sqlParams := []interface{}{utils.DefaultTimeValue, brandID}
err = GetRows(db, &results, sql, sqlParams)
return results, err
}

View File

@@ -5,6 +5,7 @@ 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/common" "git.rosy.net.cn/jx-callback/business/jxstore/common"
"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/secretNumber"
"git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/jxutils"
"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"
@@ -1306,7 +1307,10 @@ func (c *StoreController) ReorderBrandCategories() {
// @Failure 200 {object} controllers.CallResult // @Failure 200 {object} controllers.CallResult
// @router /GetBrandSecretNumbers [get] // @router /GetBrandSecretNumbers [get]
func (c *StoreController) GetBrandSecretNumbers() { func (c *StoreController) GetBrandSecretNumbers() {
c.callGetBrandSecretNumbers(func(params *tStoreGetBrandSecretNumbersParams) (retVal interface{}, errCode string, err error) {
retVal, err = secretNumber.GetBrandSecretNumbers(params.Ctx, params.BrandID)
return retVal, "", err
})
} }
// @Title 查询号码绑定关系 // @Title 查询号码绑定关系
@@ -1318,7 +1322,10 @@ func (c *StoreController) GetBrandSecretNumbers() {
// @Failure 200 {object} controllers.CallResult // @Failure 200 {object} controllers.CallResult
// @router /GetSecretNumberBind [get] // @router /GetSecretNumberBind [get]
func (c *StoreController) GetSecretNumberBind() { func (c *StoreController) GetSecretNumberBind() {
c.callGetSecretNumberBind(func(params *tStoreGetSecretNumberBindParams) (retVal interface{}, errCode string, err error) {
retVal, err = secretNumber.QuerySubscriptionDetail(params.PoolKey, params.SecretNumber)
return retVal, "", err
})
} }
// @Title 购买号码 // @Title 购买号码
@@ -1329,7 +1336,10 @@ func (c *StoreController) GetSecretNumberBind() {
// @Failure 200 {object} controllers.CallResult // @Failure 200 {object} controllers.CallResult
// @router /BuySecretNo [post] // @router /BuySecretNo [post]
func (c *StoreController) BuySecretNo() { func (c *StoreController) BuySecretNo() {
c.callBuySecretNo(func(params *tStoreBuySecretNoParams) (retVal interface{}, errCode string, err error) {
err = secretNumber.BuySecretNo(params.Ctx, params.PoolKey, "成都")
return retVal, "", err
})
} }
// @Title 绑定号码 // @Title 绑定号码
@@ -1343,7 +1353,10 @@ func (c *StoreController) BuySecretNo() {
// @Failure 200 {object} controllers.CallResult // @Failure 200 {object} controllers.CallResult
// @router /BindSecretNumber [post] // @router /BindSecretNumber [post]
func (c *StoreController) BindSecretNumber() { func (c *StoreController) BindSecretNumber() {
c.callBindSecretNumber(func(params *tStoreBindSecretNumberParams) (retVal interface{}, errCode string, err error) {
err = secretNumber.BindAxb(params.Ctx, params.SecretNumber, params.NumberA, params.NumberB, params.Expiration)
return retVal, "", err
})
} }
// @Title 修改绑定 // @Title 修改绑定
@@ -1351,6 +1364,7 @@ func (c *StoreController) BindSecretNumber() {
// @Param token header string true "认证token" // @Param token header string true "认证token"
// @Param poolKey formData string true "号码池key" // @Param poolKey formData string true "号码池key"
// @Param subsID formData string true "绑定关系ID查询列表中有" // @Param subsID formData string true "绑定关系ID查询列表中有"
// @Param secretNumber formData string true "号码x"
// @Param numberA formData string true "号码1" // @Param numberA formData string true "号码1"
// @Param numberB formData string true "号码2" // @Param numberB formData string true "号码2"
// @Param expiration formData string true "绑定时间(绑定到多久" // @Param expiration formData string true "绑定时间(绑定到多久"
@@ -1358,7 +1372,10 @@ func (c *StoreController) BindSecretNumber() {
// @Failure 200 {object} controllers.CallResult // @Failure 200 {object} controllers.CallResult
// @router /UpdateSecretBind [post] // @router /UpdateSecretBind [post]
func (c *StoreController) UpdateSecretBind() { func (c *StoreController) UpdateSecretBind() {
c.callUpdateSecretBind(func(params *tStoreUpdateSecretBindParams) (retVal interface{}, errCode string, err error) {
err = secretNumber.UpdateSubscription(params.PoolKey, params.SubsID, params.SecretNumber, params.NumberA, params.NumberB, params.Expiration)
return retVal, "", err
})
} }
// @Title 解除绑定 // @Title 解除绑定
@@ -1366,9 +1383,13 @@ func (c *StoreController) UpdateSecretBind() {
// @Param token header string true "认证token" // @Param token header string true "认证token"
// @Param poolKey formData string true "号码池key" // @Param poolKey formData string true "号码池key"
// @Param subsID formData string true "绑定关系ID查询列表中有" // @Param subsID formData string true "绑定关系ID查询列表中有"
// @Param secretNumber formData string true "号码x"
// @Success 200 {object} controllers.CallResult // @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult // @Failure 200 {object} controllers.CallResult
// @router /DelSecretBind [post] // @router /DelSecretBind [post]
func (c *StoreController) DelSecretBind() { func (c *StoreController) DelSecretBind() {
c.callDelSecretBind(func(params *tStoreDelSecretBindParams) (retVal interface{}, errCode string, err error) {
err = secretNumber.UnbindSubscription(params.PoolKey, params.SubsID, params.SecretNumber)
return retVal, "", err
})
} }

View File

@@ -2475,6 +2475,60 @@ func init() {
Filters: nil, Filters: nil,
Params: nil}) Params: nil})
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"],
web.ControllerComments{
Method: "GetBrandSecretNumbers",
Router: `/GetBrandSecretNumbers`,
AllowHTTPMethods: []string{"get"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"],
web.ControllerComments{
Method: "GetSecretNumberBind",
Router: `/GetSecretNumberBind`,
AllowHTTPMethods: []string{"get"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"],
web.ControllerComments{
Method: "BuySecretNo",
Router: `/BuySecretNo`,
AllowHTTPMethods: []string{"post"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"],
web.ControllerComments{
Method: "BindSecretNumber",
Router: `/BindSecretNumber`,
AllowHTTPMethods: []string{"post"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"],
web.ControllerComments{
Method: "UpdateSecretBind",
Router: `/UpdateSecretBind`,
AllowHTTPMethods: []string{"post"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"],
web.ControllerComments{
Method: "DelSecretBind",
Router: `/DelSecretBind`,
AllowHTTPMethods: []string{"post"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"], web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"],
web.ControllerComments{ web.ControllerComments{
Method: "GetStoreCourierMaps", Method: "GetStoreCourierMaps",