order

package
v0.0.25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2019 License: Apache-2.0, Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIGETOrder

func APIGETOrder(c *gin.Context)

订单查询

func APIGETOrderDetail

func APIGETOrderDetail(c *gin.Context)

APIGETOrderDetail 获取订单详情

func APIPOSTOrder

func APIPOSTOrder(c *gin.Context)

func GetOrder

func GetOrder() (*[]model.DBOrderInfo, error)

func PostOrder

func PostOrder(req *POSTOrderReq) (int64, error)

Types

type APIGETOrderDetailReq

type APIGETOrderDetailReq struct {
	OrderID uint64 `form:"OrderID"`
	OrderSN string `form:"OrderSN"`
}

APIGETOrderDetailReq 获取订单详情 id sn 不可同时为空,建议传入orderID @since 0.0.22

type OrderDetail

type OrderDetail struct {
	OrderID     uint64
	OrderSN     string
	UID         uint64
	Mobile      string
	GoodsAmount float64
	Date        time.Time
	OrderGoods  *[]OrderGoods
}

OrderDetail 订单详情完整结构体 @since 0.0.22

func GetOrderDetail

func GetOrderDetail(req *APIGETOrderDetailReq) (*OrderDetail, error)

GetOrderDetail 获取订单详情

type OrderGoods

type OrderGoods struct {
	OrderID     uint64  `db:"order_id"`
	GoodsID     uint64  `db:"goods_id"`
	GoodsNumber float64 `db:"goods_number"`
	GoodsName   string  `db:"goods_name"`
	GoodsPrice  float64 `db:"goods_price"`
}

OrderGoods 订单内的商品 @since 0.0.22

type POSTOrderReq

type POSTOrderReq struct {
	Postscript string // 订单附言,由用户提交订单前填写
	Mobile     string `binding:"required"` // 收货人的手机,用户页面填写,默认取值于表user_address
	// TODO 必须验证登录状态
	//UserID     uint64 `binding:"required"` // 用户id,同ecs_users的user_id
	Goods []struct {
		GoodsID int64 `binding:"required"`
		Num     int64 `binding:"required"`
	} `json:"Goods" binding:"required"`
	OrderID int64

	GoodsAmount float64 `binding:"required"` // 商品的总金额

}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL