dbcontent

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MulanPSL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB
View Source
var TestMyRoachDBUrl = func() string {

	return "postgresql://[email protected]:26257/cms?sslmode=disable"

}
View Source
var TestMysqlDBUrl = func() string {
	return fmt.Sprintf("root:[email protected]@tcp(huawei.akunlong.top:13306)/%s?charset=utf8&mb4&parseTime=True&loc=Local", "hrms")
}
View Source
var TestRoachPgDBUrl = func() string {
	return fmt.Sprintf("host=%s port=%d user=%s dbname=%s password=%s sslmode=require",
		"192.168.13.235", 26257, "code", "cms", "123456")

}

Functions

func GetDB

func GetDB() *gorm.DB

func InitDB

func InitDB() *gorm.DB

func InitDB_Config

func InitDB_Config() (*gorm.DB, *config.GeneralConfig)

func InitDB_postgres

func InitDB_postgres() *gorm.DB

* Init gorm 配置初始化 数据库连接

func InitDbMysql

func InitDbMysql(conn string) *gorm.DB

func InitDbPostgres

func InitDbPostgres(conn string) *gorm.DB

func ReleaseToken

func ReleaseToken(user model2.CmsUser) (string, error)

Types

type Claims

type Claims struct {
	UserId uint
	jwt.StandardClaims
}

func ParseToken

func ParseToken(tokenString string) (*jwt.Token, *Claims, error)

Jump to

Keyboard shortcuts

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