1
This commit is contained in:
114
controllers/withdrawal_record.go
Normal file
114
controllers/withdrawal_record.go
Normal file
@@ -0,0 +1,114 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
withdreawal "git.rosy.net.cn/jx-callback/business/q_bida"
|
||||
"github.com/astaxie/beego/server/web"
|
||||
)
|
||||
|
||||
type WithdrawalRecordController struct {
|
||||
web.Controller
|
||||
}
|
||||
|
||||
// AddWithdrawalRecord
|
||||
// @Title 用户发起提现申请
|
||||
// @Description 提现申请
|
||||
// @Param token header string true "认证token"
|
||||
// @Param withdrawalMoney formData int true "提现金额"
|
||||
// @Param alipayAccount formData string true "支付宝绑定账号[邮箱/电话]"
|
||||
// @Param alipayName formData string true "真是姓名"
|
||||
// @Param lng formData float64 true "经度"
|
||||
// @Param lat formData float64 true "纬度"
|
||||
// @Param cityCode formData int true "城市code"
|
||||
// @Param districtCode formData int true "省code"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /AddWWithdrawalRecord [post]
|
||||
func (c *WithdrawalRecordController) AddWithdrawalRecord() {
|
||||
c.callAddWWithdrawalRecord(func(params *tWithdrawalAddWWithdrawalRecordParams) (interface{}, string, error) {
|
||||
param := &model.AddWithdrawalRecordReq{
|
||||
WithdrawalMoney: params.WithdrawalMoney,
|
||||
AlipayAccount: params.AlipayAccount,
|
||||
AlipayName: params.AlipayName,
|
||||
Lng: params.Lng,
|
||||
Lat: params.Lat,
|
||||
CityCode: params.CityCode,
|
||||
DistrictCode: params.DistrictCode,
|
||||
}
|
||||
err := withdreawal.AddUserWithdrawal(params.Ctx, param)
|
||||
return nil, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// DeleteWithdrawalRecord
|
||||
// @Title 取消或者删除提现生情
|
||||
// @Description 提现申请
|
||||
// @Param token header string true "认证token"
|
||||
// @Param id formData int64 true "数据主键Id"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /DeleteWithdrawalRecord [post]
|
||||
func (c *WithdrawalRecordController) DeleteWithdrawalRecord() {
|
||||
c.callDeleteWithdrawalRecord(func(params *tWithdrawalDeleteWithdrawalRecordParams) (interface{}, string, error) {
|
||||
err := withdreawal.DeleteOrder(params.Ctx.GetUserID(), params.Id)
|
||||
return nil, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// GetWithdrawalRecord
|
||||
// 用户查询申请列表
|
||||
// @Title 查询申请列表
|
||||
// @Description 提现申请
|
||||
// @Param token header string true "认证token"
|
||||
// @Param status formData int true "申请订单状态"
|
||||
// @Param pageSize formData int true "页数"
|
||||
// @Param pageNum formData int true "页码"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /GetWithdrawalRecord [post]
|
||||
func (c *WithdrawalRecordController) GetWithdrawalRecord() {
|
||||
c.callGetWithdrawalRecord(func(params *tWithdrawalGetWithdrawalRecordParams) (interface{}, string, error) {
|
||||
result, err := withdreawal.GetOrderListByStatus(params.Ctx.GetUserID(), params.Status, params.PageSize, params.PageNum)
|
||||
return result, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// GetWithdrawalList
|
||||
// 管理系统查询列表
|
||||
// @Title 查询申请列表
|
||||
// @Description 提现申请
|
||||
// @Param token header string true "认证token"
|
||||
// @Param pageSize formData int true "页数"
|
||||
// @Param pageNum formData int true "页码"
|
||||
// @Param userName formData string false "用户昵称"
|
||||
// @Param userId formData string false "用户id"
|
||||
// @Param orderId formData string false "订单Id"
|
||||
// @Param startTime formData string false "开始时间"
|
||||
// @Param endTime formData string false "结束时间"
|
||||
// @Param phone formData string false "电话"
|
||||
// @Param orderStatus formData int false "订单状态"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /GetWithdrawalList [post]
|
||||
func (c *WithdrawalRecordController) GetWithdrawalList() {
|
||||
c.callGetWithdrawalList(func(params *tWithdrawalGetWithdrawalListParams) (interface{}, string, error) {
|
||||
data, count, err := withdreawal.GetUserWithdrawalList(&withdreawal.OrderListParam{
|
||||
PageSize: params.PageSize,
|
||||
PageNum: params.PageNum,
|
||||
UserId: params.UserId,
|
||||
UserName: params.UserName,
|
||||
OrderId: params.OrderId,
|
||||
Phone: params.Phone,
|
||||
OrderStatus: params.OrderStatus,
|
||||
StartTime: params.StartTime,
|
||||
EndTime: params.EndTime,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, "", err
|
||||
}
|
||||
|
||||
return map[string]interface{}{"data": data, "count": count}, "", err
|
||||
})
|
||||
}
|
||||
|
||||
//
|
||||
Reference in New Issue
Block a user