DB

package
v0.0.0-...-6f4ec31 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DB *gorm.DB
)
View Source
var Redis_pool *redis.Pool

Functions

func Add_IMS_DB

func Add_IMS_DB(IP, BrotherIP string) error

func ConfigDB

func ConfigDB()

func InitRedis

func InitRedis()

func NewRedisPool

func NewRedisPool(server, password string, db int) *redis.Pool

Types

type CustomerService

type CustomerService struct {
	// contains filtered or unexported fields
}

func NewCustomerService

func NewCustomerService() *CustomerService

func (*CustomerService) Clear

func (cs *CustomerService) Clear()

func (*CustomerService) GetLastSellerID

func (cs *CustomerService) GetLastSellerID(appid, uid, store_id int64) int64

func (*CustomerService) GetOnlineSellerID

func (cs *CustomerService) GetOnlineSellerID(store_id int64) int64

随机获取一个在线的销售人员

func (*CustomerService) GetOrderSellerID

func (cs *CustomerService) GetOrderSellerID(store_id int64) int64

func (*CustomerService) GetSellerID

func (cs *CustomerService) GetSellerID(store_id int64) int64

随机获取一个的销售人员

func (*CustomerService) GetStore

func (cs *CustomerService) GetStore(store_id int64) (*Store, error)

func (*CustomerService) HandleMessage

func (cs *CustomerService) HandleMessage(v *redis.Message)

func (*CustomerService) HandleUpdate

func (cs *CustomerService) HandleUpdate(data string)

func (*CustomerService) IsExist

func (cs *CustomerService) IsExist(store_id int64, seller_id int64) bool

判断销售人员是否合法

func (*CustomerService) IsOnline

func (cs *CustomerService) IsOnline(store_id int64, seller_id int64) bool

func (*CustomerService) LoadStore

func (cs *CustomerService) LoadStore(db *sql.DB, store_id int64) (*Store, error)

func (*CustomerService) SetLastSellerID

func (cs *CustomerService) SetLastSellerID(appid, uid, store_id, seller_id int64)

type ServerItemDB

type ServerItemDB struct {
	ID        int64
	IP        string `gorm:"not null;unique"` //IP:PORT 定位唯一节点
	BrotherIP string //兄弟节点,根节点没有兄弟节点
}

func LoadAll_IMS_DB

func LoadAll_IMS_DB() []ServerItemDB

type Store

type Store struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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