File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1515
1616type tableHook func (gid int64 ) error
1717
18- type model struct {
18+ type Model struct {
1919 * gorm.DB
2020}
2121
@@ -50,7 +50,7 @@ func registerTableHook(h ...tableHook) {
5050}
5151
5252// TableFor 大写是为了防止数据操作哪里有问题留个保底可以在zbp的项目里直接改
53- func TableFor (gid int64 , prefix string ) * model {
53+ func TableFor (gid int64 , prefix string ) * Model {
5454 // 先执行钩子
5555 hooksMtx .RLock ()
5656 for _ , h := range tableHooks {
@@ -61,7 +61,7 @@ func TableFor(gid int64, prefix string) *model {
6161 hooksMtx .RUnlock ()
6262
6363 tableName := fmt .Sprintf ("group_%d_%s_info" , gid , prefix )
64- return & model {db .Table (tableName )}
64+ return & Model {db .Table (tableName )}
6565}
6666
6767func listUsers (gid int64 ) (users , error ) {
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ const (
2222)
2323
2424var (
25- db * model
25+ db * Model
2626 globalLock sync.Mutex
2727
2828 errCancelFail = errors .New ("遇到不可抗力因素,注销失败!" )
@@ -84,7 +84,7 @@ func init() {
8484 panic (err )
8585 }
8686
87- db = & model {sdb .LogMode (false )}
87+ db = & Model {sdb .LogMode (false )}
8888
8989 registerTableHook (ensureUserInfo , ensureAuctionInfo )
9090}
You can’t perform that action at this time.
0 commit comments