You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.1 KiB
46 lines
1.1 KiB
package pay
|
|
|
|
import (
|
|
"yunyan/comm"
|
|
"yunyan/lego/sys/log"
|
|
"yunyan/pb"
|
|
)
|
|
|
|
// @Summary 获取商品列表
|
|
// @Description 获取商品列表
|
|
// @Tags Pay
|
|
// @Accept json
|
|
// @Produce json
|
|
// @Security BearerAuth
|
|
// @Param order body pb.PayGetOrderListReq true "获取订单列表"
|
|
// @Success 200 {object} comm.HttpResult{data=pb.PayGetOrderListResp} "订单列表"
|
|
// @Router /api/home/pay_getorderlist [post]
|
|
func (this *apiComp) GetOrderList(session comm.IUserSession, req *pb.PayGetOrderListReq) (resp *pb.PayGetOrderListResp, errdata *pb.ErrorData) {
|
|
var (
|
|
orders []*pb.DBPayOrder
|
|
total int64
|
|
err error
|
|
)
|
|
page := req.Page
|
|
if page <= 0 {
|
|
page = 1
|
|
}
|
|
size := req.Size
|
|
if size <= 0 {
|
|
size = 20
|
|
}
|
|
orders, total, err = this.module.model.getUserPayOrders(session.GetUserId(), page, size)
|
|
if err != nil {
|
|
errdata = &pb.ErrorData{
|
|
Code: pb.ErrorCode_DBError,
|
|
Message: err.Error(),
|
|
}
|
|
this.module.Error("GetOrderList 失败!", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "err", Value: err.Error()})
|
|
return
|
|
}
|
|
resp = &pb.PayGetOrderListResp{
|
|
Orderss: orders,
|
|
Total: total,
|
|
}
|
|
return
|
|
}
|
|
|