作者 tangxvhui

调整

... ... @@ -268,7 +268,7 @@ func (c *AuditController) ChanceReserveTypeList() {
}
companyId := c.GetCompanyId()
list := serveaudit.GetReserveTypeLsit(param.PageIndex, param.PageSize, companyId)
msg = protocol.NewReturnResponse(list, nil)
msg = protocol.NewPageDataResponse(list, nil)
return
}
... ... @@ -330,3 +330,37 @@ func (c *AuditController) DeleteReserveType() {
msg = protocol.NewReturnResponse(nil, err)
return
}
//ChanceStoreChange 机会数据变更存储类型
//@router /v1/chance/store/change
func (c *AuditController) ChanceStoreChange() {
var msg *protocol.ResponseMessage
defer func() {
c.ResposeJson(msg)
}()
type Parameter struct {
ChanceId string `json:"chance_id"`
StoreType int8 `json:"store_type"`
}
var param Parameter
if err := json.Unmarshal(c.Ctx.Input.RequestBody, &param); err != nil {
log.Error("json 解析失败", err)
msg = protocol.BadRequestParam("1")
return
}
// companyId := c.GetCompanyId()
var (
chanceData *models.Chance
err error
)
chanceId, _ := strconv.ParseInt(param.ChanceId, 64, 10)
chanceData, err = models.GetChanceById(chanceId)
if err != nil {
msg = protocol.BadRequestParam("1")
return
}
chanceData.StoreType = param.StoreType
err = models.UpdateChanceById(chanceData, []string{"StoreType"})
msg = protocol.NewReturnResponse(nil, nil)
return
}
... ...
... ... @@ -115,6 +115,7 @@ func init() {
beego.NSRouter("/reserve_type/list", &controllers.AuditController{}, "post:ChanceReserveTypeList"),
beego.NSRouter("/reserve_type/delete", &controllers.AuditController{}, "post:DeleteReserveType"),
beego.NSRouter("/reserve_type/edit", &controllers.AuditController{}, "post:EditReserveType"),
beego.NSRouter("/store/change", &controllers.AuditController{}, "post:ChanceStoreChange"),
),
beego.NSNamespace("/rank",
beego.NSRouter("/type/list", &controllers.RankController{}, "post:GetRankType"),
... ...