models

package
v0.0.0-...-02b4230 Latest Latest
Warning

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

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

Documentation

Overview

*

*
* @author liangjf
* @create on 2020/7/1
* @version 1.0

*

*
* @author liangjf
* @create on 2020/9/10
* @version 1.0

*

*
* @author liangjf
* @create on 2020/7/1
* @version 1.0

*

*
* @author liangjf
* @create on 2020/9/10
* @version 1.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteTBUser

func DeleteTBUser(uuid string) error

DeleteTBUser 删除记录

func GetAllGateway

func GetAllGateway() ([]string, error)

func GetDB

func GetDB() *gorm.DB

func GetRedisPool

func GetRedisPool() *db.RedisPool

func InitEtcd

func InitEtcd(etcdAddr []string) error

func InitMysqlPool

func InitMysqlPool(mysqlConf *config.Mysql)

InitMysql 初始化mysql

func InitRedisPool

func InitRedisPool(nodes []string) error

Types

type TBUser

type TBUser struct {
	gorm.Model
	Username    string `gorm:"column:username;not null;index:index_username" json:"username" description:"username"`
	Password    string `gorm:"column:password;not null;" json:"password" description:"password"`
	UUID        string `gorm:"column:uuid;not null;index:index_uuid" json:"uuid" description:"uuid"`
	UserID      string `gorm:"column:user_id;not null;" json:"user_id" description:"用户id"`
	Phone       string `gorm:"column:phone;not null;" json:"phone" description:"手机号"`
	IsAvailable int8   `gorm:"column:is_available; default:1; not null;" json:"isavailable"  description:"是否可用 1可用 0不可用"`
}

TBUser 用户表

func GetAllTBUsers

func GetAllTBUsers(query map[string]interface{}, offset int32, limit int32) ([]TBUser, error)

GetAllTBUsers 获取所有记录

func GetTBUser

func GetTBUser(query map[string]interface{}) (*TBUser, error)

GetTBUser 查找一个

func (*TBUser) AddTBUser

func (t *TBUser) AddTBUser() error

AddTBUser 插入记录

func (*TBUser) TableName

func (t *TBUser) TableName() string

TableName 表名

func (*TBUser) UpdateTBUser

func (t *TBUser) UpdateTBUser() error

UpdateTBUser 更新记录

Jump to

Keyboard shortcuts

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