user delivery
This commit is contained in:
@@ -83,6 +83,93 @@ func (c *User2Controller) GetUsers() {
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 用户自己增加配送地址
|
||||
// @Description 用户自己增加配送地址
|
||||
// @Param token header string true "认证token"
|
||||
// @Param consigneeName formData string true "收货人"
|
||||
// @Param consigneeMobile 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 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
|
||||
// if err = utils.Map2StructByJson(params.MapData, &address, true); err == nil {
|
||||
// retVal, err = cms.AddMyDeliveryAddress(params.Ctx, address)
|
||||
// }
|
||||
address := &model.UserDeliveryAddress{
|
||||
ConsigneeName: params.ConsigneeName,
|
||||
ConsigneeMobile: params.ConsigneeMobile,
|
||||
Address: params.Address,
|
||||
DetailAddress: params.DetailAddress,
|
||||
Lng: params.Lng,
|
||||
Lat: params.Lat,
|
||||
Tag: params.Tag,
|
||||
Remark: params.Remark,
|
||||
IsDefault: int8(params.IsDefault),
|
||||
}
|
||||
retVal, err = cms.AddMyDeliveryAddress(params.Ctx, address)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 用户自己删除配送地址
|
||||
// @Description 用户自己删除送地址
|
||||
// @Param token header string true "认证token"
|
||||
// @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.Id)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 用户自己修改配送地址
|
||||
// @Description 用户自己修改配送地址
|
||||
// @Param token header string true "认证token"
|
||||
// @Param id formData int true "地址ID"
|
||||
// @Param consigneeName formData string false "收货人"
|
||||
// @Param consigneeMobile 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 "标签"
|
||||
// @Param remark formData string false "备注"
|
||||
// @Param isDefault formData int false "是否是默认(0:否,1:是)"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /UpdateMyDeliveryAddress [put]
|
||||
func (c *User2Controller) UpdateMyDeliveryAddress() {
|
||||
c.callUpdateMyDeliveryAddress(func(params *tUser2UpdateMyDeliveryAddressParams) (retVal interface{}, errCode string, err error) {
|
||||
err = cms.UpdateMyDeliveryAddress(params.Ctx, params.Id, params.MapData)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 用户查询自己的配送地址
|
||||
// @Description 用户查询自己的配送地址
|
||||
// @Param token header string true "认证token"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /QueryMyDeliveryAddress [get]
|
||||
func (c *User2Controller) QueryMyDeliveryAddress() {
|
||||
c.callQueryMyDeliveryAddress(func(params *tUser2QueryMyDeliveryAddressParams) (retVal interface{}, errCode string, err error) {
|
||||
retVal, err = cms.QueryMyDeliveryAddress(params.Ctx)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 得到用户指定门店的购物车信息
|
||||
// @Description 得到用户指定门店的购物车信息
|
||||
// @Param token header string true "认证token"
|
||||
|
||||
Reference in New Issue
Block a user