store

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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	StoreID    int       `json:"storeID" db:"store_id"`       // 店铺ID
	Active     bool      `json:"active" db:"active"`          // 是否有效
	Icon       string    `json:"icon" db:"icon"`              // 图标
	CoverImg   string    `json:"coverImg" db:"cover_img"`     // 封面图
	Label      string    `json:"label" db:"label"`            // 名称,简短的,3-5字内
	Company    string    `json:"company" db:"company"`        // 运营公司
	CreateTime time.Time `json:"createTime" db:"create_time"` // 创建时间
	UpdateTime time.Time `json:"updateTime" db:"update_time"` // 更新时间
}

Store 店铺

type StoreDB

type StoreDB struct {
	DB *sqlx.DB
}

func (*StoreDB) Delete

func (db *StoreDB) Delete(storeID int) error

Delete 删除商铺

func (*StoreDB) GetByID

func (db *StoreDB) GetByID(storeID int) (*Store, error)

GetByID 通过storeID获取指定商铺

func (*StoreDB) Insert

func (db *StoreDB) Insert(icon, coverImg, label, company string) error

Insert 添加店铺

func (*StoreDB) List

func (db *StoreDB) List() ([]Store, error)

List 列出有效的店铺

func (*StoreDB) ListByID

func (db *StoreDB) ListByID(storeIDs []int) ([]Store, error)

ListByID 列出指定有效的店铺

func (*StoreDB) Update

func (db *StoreDB) Update(storeID int, label, icon, coverImg, company string) error

Update 更新商铺信息

type StoreTx

type StoreTx struct {
	Tx *sqlx.Tx
}

Jump to

Keyboard shortcuts

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