Skip to content

Commit 606fb1d

Browse files
committed
为TokenStore添加TableName方法并修复代码格式
1 parent b09574b commit 606fb1d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

routes/tokens.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"fmt"
88
"log"
99
randv2 "math/rand/v2"
10+
"strings"
1011
"time"
1112

1213
"github.com/bwmarrin/snowflake"
@@ -15,7 +16,7 @@ import (
1516
"github.com/golang-module/carbon/v2"
1617
"gorm.io/gorm"
1718

18-
password_hashed "github.com/masx200/go_ws_sh/password-hashed"
19+
password_hashed "github.com/masx200/go_ws_sh/password-hashed"
1920
)
2021

2122
type TokenStore struct {
@@ -32,7 +33,9 @@ type TokenStore struct {
3233
Description string `json:"description" gorm:"index;not null"`
3334
}
3435

35-
36+
func (TokenStore) TableName() string {
37+
return strings.ToLower("TokenStore")
38+
}
3639

3740
func CreateTokenHandler(credentialdb *gorm.DB, tokendb *gorm.DB, sessiondb *gorm.DB) func(c context.Context, r *app.RequestContext, next HertzNext) {
3841
return func(c context.Context, r *app.RequestContext, next HertzNext) {

0 commit comments

Comments
 (0)