ship

package
v0.0.0-...-4e81a15 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2017 License: GPL-3.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// FreeShipNone 不包邮
	FreeShipNone = "NONE"
	// FreeShipCount 购满数量包邮
	FreeShipCount = "COUNT"
	// FreeShipPrice 购满金额包邮
	FreeShipPrice = "PRICE"
)

Variables

This section is empty.

Functions

func GetFreeShipLabel

func GetFreeShipLabel(freeShipType string) string

GetFreeShipLabel 获取包邮类型名称

Types

type Ship

type Ship struct {
	ShipID        int       `json:"shipID" db:"ship_id"`                // 物流ID
	Active        bool      `json:"active" db:"active"`                 // 是否可用
	GroupLabel    string    `json:"groupLabel" db:"group_label"`        // 分组名称,例如:低邮费区域,偏远区域
	ProvinceCode  string    `json:"provinceCode" db:"province_code"`    // 省代码
	ProvinceName  string    `json:"provinceName" db:"province_name"`    // 省名称
	ShipPrice     float32   `json:"shipPrice" db:"ship_price"`          // 邮费
	FreeShipType  string    `json:"freeShipType" db:"free_ship_type"`   // 包邮方式,none不包邮,count购满数量包邮,price购满金额包邮
	FreeShipCount int       `json:"freeShipCount" db:"free_ship_count"` // 购满数量包邮
	FreeShipPrice float32   `json:"freeShipPrice" db:"free_ship_price"` // 购满金额包邮
	CreateTime    time.Time `json:"createTime" db:"create_time"`        // 创建时间
	UpdateTime    time.Time `json:"updateTime" db:"update_time"`        // 更新时间
}

Ship 物流

type ShipDB

type ShipDB struct {
	DB *sqlx.DB
}

func (*ShipDB) Delete

func (db *ShipDB) Delete(shipID int) error

Delete 删除物流信息

func (*ShipDB) GetByID

func (db *ShipDB) GetByID(shipID int) (*Ship, error)

GetByID 通过shipID获取物流信息

func (*ShipDB) GetByProvinceCode

func (db *ShipDB) GetByProvinceCode(provinceCode string) (*Ship, error)

GetByProvinceCode 通过省代码获取物流信息

func (*ShipDB) Insert

func (db *ShipDB) Insert(ship *Ship) error

Insert 添加物流信息

func (*ShipDB) List

func (db *ShipDB) List() ([]Ship, error)

List 列出所有物流信息

func (*ShipDB) Update

func (db *ShipDB) Update(shipID int, shipPrice, freeShipPrice float32, freeShipType string, freeShipCount int) error

Update 修改物流信息

type ShipTx

type ShipTx struct {
	Tx *sqlx.Tx
}

Jump to

Keyboard shortcuts

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