mirror of
https://github.com/yv1ing/gin-admin.git
synced 2025-10-24 10:12:05 +08:00
完成基本框架搭建及系统用户登录流程
This commit is contained in:
22
internal/repository/repository.go
Normal file
22
internal/repository/repository.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package repository
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// @Author: yv1ing
|
||||
// @Author: me@yvling.cn
|
||||
// @Date: 2025/8/28 14:34
|
||||
// @Desc: 数据操作的抽象封装
|
||||
|
||||
type repository struct {
|
||||
DB *gorm.DB
|
||||
}
|
||||
|
||||
var Repo *repository
|
||||
|
||||
func SetupRepository(db *gorm.DB) {
|
||||
Repo = &repository{
|
||||
DB: db,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user