Documentation ¶
Index ¶
- Variables
- func Add_IMS_DB(IP, BrotherIP string) error
- func ConfigDB()
- func InitRedis()
- func NewRedisPool(server, password string, db int) *redis.Pool
- type CustomerService
- func (cs *CustomerService) Clear()
- func (cs *CustomerService) GetLastSellerID(appid, uid, store_id int64) int64
- func (cs *CustomerService) GetOnlineSellerID(store_id int64) int64
- func (cs *CustomerService) GetOrderSellerID(store_id int64) int64
- func (cs *CustomerService) GetSellerID(store_id int64) int64
- func (cs *CustomerService) GetStore(store_id int64) (*Store, error)
- func (cs *CustomerService) HandleMessage(v *redis.Message)
- func (cs *CustomerService) HandleUpdate(data string)
- func (cs *CustomerService) IsExist(store_id int64, seller_id int64) bool
- func (cs *CustomerService) IsOnline(store_id int64, seller_id int64) bool
- func (cs *CustomerService) LoadStore(db *sql.DB, store_id int64) (*Store, error)
- func (cs *CustomerService) SetLastSellerID(appid, uid, store_id, seller_id int64)
- type ServerItemDB
- type Store
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DB *gorm.DB
)
View Source
var Redis_pool *redis.Pool
Functions ¶
func Add_IMS_DB ¶
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) 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
Click to show internal directories.
Click to hide internal directories.