tag

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: 3

Documentation

Index

Constants

View Source
const (
	// TagTypeGoods 商品类型标签
	TagTypeGoods = "GOODS"

	// TagStateOnline 上架状态
	TagStateOnline = "ONLINE"
	// TagStateOffline 下架状态
	TagStateOffline = "OFFLINE"

	// TagPositionIndex 位置首页
	TagPositionIndex = "INDEX"
	// TagPositionStore 位置店铺
	TagPositionStore = "STORE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Tag

type Tag struct {
	TagID      int       `json:"tagID" db:"tag_id"`           // 标签ID
	Active     bool      `json:"active" db:"active"`          // 是否有效
	TagState   string    `json:"tagState" db:"tag_state"`     // Tag状态
	TagType    string    `json:"tagType" db:"tag_type"`       // 标签类型
	Label      string    `json:"label" db:"label"`            // 标签名称
	Icon       string    `json:"icon" db:"icon"`              // 标签图标
	Position   string    `json:"position" db:"position"`      // 标签位置INDEX首页,STORE店铺
	StoreID    int       `json:"storeID" db:"store_id"`       // 店铺ID
	Weight     int       `json:"weight" db:"weight"`          // 权重
	CreateTime time.Time `json:"createTime" db:"create_time"` // 创建时间
	UpdateTime time.Time `json:"updateTime" db:"update_time"` // 更新时间
}

Tag 标签

type TagDB

type TagDB struct {
	DB *sqlx.DB
}

func (*TagDB) DeleteTag

func (db *TagDB) DeleteTag(TagID int) error

DeleteTag 删除标签

func (*TagDB) GetByID

func (db *TagDB) GetByID(tagID int) (*Tag, error)

GetByID 获取指定标签

func (*TagDB) GetIndexPosition

func (db *TagDB) GetIndexPosition() ([]Tag, error)

GetIndexPosition 获取首页标签

func (*TagDB) GetStorePosition

func (db *TagDB) GetStorePosition(storeID int) ([]Tag, error)

GetStorePosition 获取店铺标签

func (*TagDB) InsertTag

func (db *TagDB) InsertTag(c *TagParam) (int, error)

InsertTag 添加活动标签

func (*TagDB) List

func (db *TagDB) List(tagType, tagState string, storeID int) ([]Tag, error)

List 列出所有有效标签,按照权重和创建开始时间排序

func (*TagDB) ListIndex

func (db *TagDB) ListIndex() ([]Tag, error)

ListIndex 列出首页标签,按照权重和创建开始时间排序

func (*TagDB) ListOnlineStore

func (db *TagDB) ListOnlineStore(storeID int) ([]Tag, error)

ListOnlineStore 列出店铺上架标签

func (*TagDB) ListStore

func (db *TagDB) ListStore(storeID int) ([]Tag, error)

ListStore 列出店铺标签,按照权重和创建开始时间排序

func (*TagDB) UpdateOffline

func (db *TagDB) UpdateOffline(TagID int) error

UpdateOffline 下架标签

func (*TagDB) UpdateOnline

func (db *TagDB) UpdateOnline(TagID int) error

UpdateOnline 上架标签

func (*TagDB) UpdateTag

func (db *TagDB) UpdateTag(c *TagParam) error

UpdateTag 更新标签信息

type TagParam

type TagParam struct {
	TagID    int    `json:"tagID" form:"tagID"`       // 标签ID
	TagType  string `json:"tagType" form:"tagType"`   // 标签类型
	Label    string `json:"label" form:"label"`       // 标签名称
	Icon     string `json:"icon" form:"icon"`         // 标签图标
	Position string `json:"position" form:"position"` // 标签位置INDEX首页,STORE店铺
	StoreID  int    `json:"storeID" form:"store_id"`  // 店铺ID
	Weight   int    `json:"weight" form:"weight"`     // 权重
}

TagParam 标签

type TagTx

type TagTx struct {
	Tx *sqlx.Tx
}

Jump to

Keyboard shortcuts

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