businessModel

package
v0.0.0-...-2ddc99a Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BusinessAdmin

type BusinessAdmin struct {
	model.Model
	Tel      string    `gorm:"not null;unique;" json:"tel"` // 手机号
	Password string    `json:"-"`                           // 密码
	IP       string    `json:"ip"`                          // 登录IP
	Token    string    `json:"token"`                       // 授权令牌
	Avatar   string    `json:"avatar"`                      // 头像
	UUID     uuid.UUID `json:"uuid"`                        // uuid
	Wechat   WeChat    `json:"wechat"`                      // 微信信息
	WechatID int64     `json:"-"`                           // 微信信息ID
}

BusinessAdmin model 商家管理员

func (*BusinessAdmin) QueryUserByID

func (a *BusinessAdmin) QueryUserByID() error

查询商家 by ID

	param id
 return BusinessAdmin,error

func (*BusinessAdmin) QueryUserByTel

func (a *BusinessAdmin) QueryUserByTel() error

查询商家 by tel

	param tel
 return BusinessAdmin,error

func (*BusinessAdmin) QueryUserByToken

func (a *BusinessAdmin) QueryUserByToken() error

查询商家 by token

	param token
 return BusinessAdmin,error

func (*BusinessAdmin) RegisterBusinessAdmin

func (a *BusinessAdmin) RegisterBusinessAdmin() error

注册商家

func (*BusinessAdmin) UpdateBusinessAdmin

func (a *BusinessAdmin) UpdateBusinessAdmin(args map[string]interface{}) error

更新商家 by id

	param tel
	param password
	param ip
	param token
	param manager
	param avatar
	param uuid
 param stores
 return BusinessAdmin,error

type CertificatePhoto

type CertificatePhoto struct {
	ID                         int64
	Url                        string `json:"Url"`                                         // 图片保存地址
	StoreOpeningPersonalInfoID int64  `gorm:"INDEX" json:"store_opening_personal_info_id"` // 开店个人信息ID
}

CertificatePhoto model 身份证照

type Goods

type Goods struct {
	model.Model
	GoodsName        string  `json:"goods_name"`            // 商品名称
	GoodsPhoto       string  `json:"goods_photo"`           // 商品图片
	GoodsDescription string  `json:"goods_description"`     // 商品描述
	GoodsListing     bool    `json:"goods_listing"`         // 是否上架
	GoodsPrice       float64 `json:"goods_price"`           // 商品价格
	GoodsUnit        string  `json:"goods_unit"`            // 商品单位 份、杯
	GoodsSort        int64   `json:"goods_sort"`            // 商品排序
	GoodsTypeID      int64   `json:"goods_type_id"`         // 商品种类ID
	GoodsTypeName    string  `json:"goods_type_name"`       // 商品种类名称
	AdminID          int64   `gorm:"INDEX" json:"admin_id"` // 商家管理员ID
}

Goods model 商品

func (*Goods) AddGoods

func (g *Goods) AddGoods() error

添加商品

func (*Goods) DeleteGoodsByIds

func (g *Goods) DeleteGoodsByIds(ids []int64) error

删除商品

	param ids
 return error

func (*Goods) QueryGoodsByAdminID

func (g *Goods) QueryGoodsByAdminID(pageSize int, page int) (goods []Goods)

批量查询商品

func (*Goods) QueryGoodsByGoodsTypeID

func (g *Goods) QueryGoodsByGoodsTypeID() (goods []Goods)

查询商品by goods_type_id

func (*Goods) QueryGoodsByID

func (g *Goods) QueryGoodsByID() error

查询商品by id

func (*Goods) QueryGoodsCountByAdminID

func (g *Goods) QueryGoodsCountByAdminID() (count int)

商品总记录数

func (*Goods) QueryGoodsExistNameByAdminId

func (g *Goods) QueryGoodsExistNameByAdminId() error

检查商家是否已创建相同的商品名称

param goods_name
param admin_id

func (*Goods) UpdateGoodsByID

func (g *Goods) UpdateGoodsByID(args map[string]interface{}) error

修改商品by id

type GoodsType

type GoodsType struct {
	model.Model
	Name         string `json:"name"`                  // 种类名称
	TypeSort     int64  `json:"type_sort"`             // 种类排序
	DisplayOrNot bool   `json:"display_or_not"`        // 是否显示
	AdminID      int64  `gorm:"INDEX" json:"admin_id"` // 商家管理员ID
}

GoodsType model 商品种类

func (*GoodsType) AddGoodsType

func (g *GoodsType) AddGoodsType() error

添加商品种类

func (*GoodsType) DeleteGoodsTypeByIds

func (g *GoodsType) DeleteGoodsTypeByIds(ids []int64) error

删除商品种类

	param ids
 return error

func (*GoodsType) QueryGoodsTypeByAdminID

func (g *GoodsType) QueryGoodsTypeByAdminID(pageSize int, page int) (goodsTypes []GoodsType)

批量查询商品种类

func (*GoodsType) QueryGoodsTypeByID

func (g *GoodsType) QueryGoodsTypeByID() error

查询商品种类

func (*GoodsType) QueryGoodsTypeCountByAdminID

func (g *GoodsType) QueryGoodsTypeCountByAdminID() (count int)

商品种类总记录数

func (*GoodsType) QueryGoodsTypeExistNameByAdminID

func (g *GoodsType) QueryGoodsTypeExistNameByAdminID() error

检查商家是否已创建相同的商品种类名称

func (*GoodsType) QueryGoodsTypeIDAndNameByAdminID

func (g *GoodsType) QueryGoodsTypeIDAndNameByAdminID() (res []entity.GoodsTypeResponse)

查询商品种类ID和名称

func (*GoodsType) UpdateGoodsTypeByID

func (g *GoodsType) UpdateGoodsTypeByID(args map[string]interface{}) error

修改商品种类

type InStorePhoto

type InStorePhoto struct {
	ID      int64
	Url     string `json:"Url"`                   // 图片保存地址
	StoreID int64  `gorm:"INDEX" json:"store_id"` // 门店ID
}

店内照

type IndustryQualification

type IndustryQualification struct {
	ID               int64
	CertificateType  string `json:"certificate_type"`  // 证书类型
	CertificatePhoto string `json:"certificate_photo"` // 证书照片
}

IndustryQualification model 行业资质

type Store

type Store struct {
	model.Model
	StoreName              string         `gorm:"not null" json:"store_name"`                                          // 门店名称
	StoreAddress           string         `gorm:"not null" json:"store_address"`                                       // 门店详细地址
	StoreContactName       string         `json:"store_contact_name"`                                                  // 门店联系人姓名
	StoreContactTel        string         `json:"store_contact_tel"`                                                   // 门店联系人电话
	StoreStartBankingHours string         `gorm:"not null" json:"store_start_banking_hours"`                           // 门店开始营业时间
	StoreEndBankingHours   string         `gorm:"not null" json:"store_end_banking_hours"`                             // 门店结束营业时间
	StoreFacePhoto         string         `json:"store_face_photo"`                                                    // 门脸照
	InStorePhotos          []InStorePhoto `gorm:"foreignkey:StoreID;association_foreignkey:ID" json:"in_store_photos"` // 店内照
	AdminID                int64          `gorm:"INDEX" json:"admin_id"`                                               // 商家管理员ID
}

Store model 门店信息

func (*Store) AddStore

func (s *Store) AddStore() error

添加门店

func (*Store) QueryStoreByAdminID

func (s *Store) QueryStoreByAdminID() error

查询门店信息 by AdminID

func (*Store) QueryStoreByID

func (s *Store) QueryStoreByID() error

查询门店信息 by id

func (*Store) UpdateStore

func (s *Store) UpdateStore(args map[string]interface{}) error

修改门店信息

type StoreOpeningPersonalInfo

type StoreOpeningPersonalInfo struct {
	ID                int64
	CertificateType   string             `json:"certificate_type"`                                                // 证书类型
	CertificatePhotos []CertificatePhoto `gorm:"foreignkey:StoreOpeningPersonalInfoID;association_foreignkey:ID"` // 身份证照
}

StoreOpeningPersonalInfo model 开店个人信息

type StoreQualificationInfo

type StoreQualificationInfo struct {
	model.Model
	StoreCertificationStatus int64                 `json:"store_certification_status"` // 店铺认证状态  0:已认证 | 1:未认证
	StoreOperationIndustry   string                `json:"shop_operation_industry"`    // 店铺经营行业
	SubjectQualification     SubjectQualification  `json:"subject_qualification"`      // 主体资质
	SubjectQualificationID   int64                 `json:"-"`                          // 主体资质ID
	IndustryQualification    IndustryQualification `json:"industry_qualification"`     // 行业资质
	IndustryQualificationID  int64                 `json:"-"`                          // 行业资质ID
	AdminID                  int64                 `gorm:"INDEX" json:"admin_id"`      // 商家管理员ID
}

StoreQualificationInfo model 资质信息

func (*StoreQualificationInfo) AddStoreCertification

func (s *StoreQualificationInfo) AddStoreCertification() error

提交认证

func (*StoreQualificationInfo) UpdateStoreCertification

func (s *StoreQualificationInfo) UpdateStoreCertification(args map[string]interface{}) error

修改认证信息

type SubjectQualification

type SubjectQualification struct {
	ID               int64
	CertificateType  string `json:"certificate_type"`  // 证书类型
	CertificatePhoto string `json:"certificate_photo"` // 证书照片
}

SubjectQualification model 主体资质

type Table

type Table struct {
	model.Model
	Name          string `json:"name"`                  // 餐桌名称
	Sort          int64  `json:"sort"`                  // 餐桌排序
	QRCode        string `json:"QR_code"`               // 餐桌二维码
	Opening       bool   `json:"opening"`               // 是否开台
	DisplayOrNot  bool   `json:"display_or_not"`        // 是否显示
	TableTypeID   int64  `json:"table_type_id"`         // 餐桌种类ID
	TableTypeName string `json:"table_type_name"`       // 餐桌种类名称
	AdminID       int64  `gorm:"INDEX" json:"admin_id"` // 商家管理员ID
}

Table model 餐桌

func (*Table) AddTable

func (t *Table) AddTable() error

添加餐桌

func (*Table) DeleteTable

func (t *Table) DeleteTable(ids []int64) error

删除餐桌(可批量)

	param id
 return error

func (*Table) QueryTableByID

func (t *Table) QueryTableByID() error

查询餐桌 By ID

func (*Table) QueryTableByTableTypeID

func (t *Table) QueryTableByTableTypeID() (tables []Table)

查询餐桌 By TableTypeID

func (*Table) QueryTableCountByAdminID

func (t *Table) QueryTableCountByAdminID() (count int)

餐桌总记录数

func (*Table) QueryTableExistName

func (t *Table) QueryTableExistName() error

检查商家是否已创建相同的餐桌名称

func (*Table) QueryTablesByAdminID

func (t *Table) QueryTablesByAdminID(pageSize int, page int) (Tables []Table)

批量查询餐桌

func (*Table) UpdateTable

func (t *Table) UpdateTable(args map[string]interface{}) error

修改餐桌

type TableType

type TableType struct {
	model.Model
	Name         string `json:"name"`                  // 种类名称
	SeatingMin   int64  `json:"seating_min"`           // 最少可坐人数
	SeatingMax   int64  `json:"seating_max"`           // 最多可坐人数
	DisplayOrNot bool   `json:"display_or_not"`        // 是否显示
	AdminID      int64  `gorm:"INDEX" json:"admin_id"` // 商家管理员ID
}

TableType model 餐桌种类

func (*TableType) AddTableType

func (t *TableType) AddTableType() error

添加餐桌种类

func (*TableType) DeleteTableTypeByIDs

func (t *TableType) DeleteTableTypeByIDs(ids []int64) error

删除餐桌种类(可批量)

	param id
 return error

func (*TableType) QueryTableTypeByID

func (t *TableType) QueryTableTypeByID() error

查询餐桌种类 by id

func (*TableType) QueryTableTypeCountByAdminID

func (t *TableType) QueryTableTypeCountByAdminID() (count int)

餐桌种类总记录数

func (*TableType) QueryTableTypeExistName

func (t *TableType) QueryTableTypeExistName() error

检查商家是否已创建相同的餐桌种类名称

func (*TableType) QueryTableTypeIDAndNameByAdminID

func (t *TableType) QueryTableTypeIDAndNameByAdminID() (res []entity.TableTypeResponse)

查询餐桌种类ID和名称

func (*TableType) QueryTableTypesByAdminID

func (t *TableType) QueryTableTypesByAdminID(pageSize int, page int) (TableTypes []TableType)

批量查询餐桌种类

func (*TableType) UpdateTableType

func (t *TableType) UpdateTableType(args map[string]interface{}) error

修改餐桌种类

type WeChat

type WeChat struct {
	ID        int64
	NickName  string `json:"nick_name"`  // 用户昵称
	AvatarUrl string `json:"avatar_url"` // 用户头像地址
	Gender    int64  `json:"gender"`     // 用户性别
	Province  string `json:"province"`   // 用户省市
	City      string `json:"city"`       // 用户城市
	Country   string `json:"country"`    // 用户国家
}

Jump to

Keyboard shortcuts

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