goods

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: 6 Imported by: 0

Documentation

Overview

商品模块,此模块相对来说代码质量是有保证的,可以正常使用但是要排计划做测试用例

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIGETGoods

func APIGETGoods(c *gin.Context)

func APIGETGoodsByID

func APIGETGoodsByID(c *gin.Context)

func APIPOSTGoods

func APIPOSTGoods(c *gin.Context)

func APIPUTGoods

func APIPUTGoods(c *gin.Context)

func GETGoods

func GETGoods(req *GETGoodsReq) (*[]model.DBGoods, error)

func GETGoodsByID

func GETGoodsByID(req *GETGoodsByIDReq) (*model.DBGoods, error)

func POSTGoods

func POSTGoods(tx *sql.Tx, postGoodsReq *POSTGoodsReq) (sql.Result, error)

func PUTGoods

func PUTGoods(tx *sql.Tx, req *PUTGoodsReq) (sql.Result, error)

func Register

func Register()

Types

type GETGoodsByIDReq

type GETGoodsByIDReq struct {
	GoodsID uint64 `form:"goods_id" json:"goods_id" binding:"required"`
}

type GETGoodsReq

type GETGoodsReq struct {
	GoodsCategoryID uint64 `form:"goods_category_id" json:"goods_category_id" ` // 不传则查看全部
	GoodsStatus     string `form:"goods_status"`
}

type POSTGoodsReq

type POSTGoodsReq struct {
	GoodsName       string  `json:"goods_name" binding:"required"`
	GoodsPrice      float64 `json:"goods_price" binding:"required"`
	GoodsCategoryID uint64  `json:"goods_category_id" binding:"required"`
	GoodsUID        uint64
	GoodsContent    string `json:"goods_content"`
	GoodsExcerpt    string `json:"goods_excerpt"`
	GoodsStatus     string `json:"goods_status"`
	GoodsOrder      uint64 `json:"goods_order"`
}

type PUTGoodsReq

type PUTGoodsReq struct {
	GoodsID         uint64  `json:"goods_id" binding:"required"`
	GoodsName       string  `json:"goods_name" binding:"required"`
	GoodsPrice      float64 `json:"goods_price" binding:"required"`
	GoodsCategoryID uint64  `json:"goods_category_id" binding:"required"`
	GoodsUID        uint64
	GoodsContent    string `json:"goods_content"`
	GoodsExcerpt    string `json:"goods_excerpt"`
	GoodsStatus     string `json:"goods_status"`
	GoodsOrder      uint64 `json:"goods_order"`
	GoodsImg        string `json:"goods_img"`
	GoodsExt        string `json:"goods_ext"`
}

Jump to

Keyboard shortcuts

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