Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Db *gorm.DB
Functions ¶
func AutoMigrateDb ¶
func AutoMigrateDb(cfg *Configuration) error
func InitCurrDb ¶
func InitCurrDb(cfg *Configuration) *gorm.DB
Types ¶
type Configuration ¶
type Configuration struct { // 环境 Env string `json:"env"` // mysql host Host string `json:"host"` // mysql 密码 Password string `json:"password"` // mysql 用户名 UserName string `json:"user_name"` // mysql 数据库前缀 Prefix string `json:"prefix"` // mysql 数据库名称 Name string `json:"name"` // mysql dialect Type string `json:"type"` // 最大空闲连接数量 MaxIdleConn int `json:"max_idle_conn"` // MaxOpenConn int `json:"max_open_conn"` // port Port int `json:"port"` }
type UserInfo ¶
type UserInfo struct { gorm.Model UserName string `json:"user_name"` UserId string `json:"user_id"` }
func (*UserInfo) CreateUser ¶
func (u *UserInfo) CreateUser(req *server_model.AddUpdateUser) error
新增用户
Click to show internal directories.
Click to hide internal directories.