feat sn 改成 int64

This commit is contained in:
2026-01-30 11:56:14 +08:00
parent 9781cd126f
commit e2fa47fd27
6 changed files with 11 additions and 11 deletions

View File

@@ -17,7 +17,7 @@ func Query() *query.Query {
return query.Use(mysql.GetDB(dbName))
}
func keyCacheBySn(sn string, tableName string) string {
func keyCacheBySn(sn int64, tableName string) string {
return fmt.Sprintf(cacheBySn, tableName, sn)
}

View File

@@ -44,7 +44,7 @@ func (d *UserDao) Updates(user *model.User) error {
return info.Error
}
func (d *UserDao) FindBySn(sn string) (*model.User, error) {
func (d *UserDao) FindBySn(sn int64) (*model.User, error) {
if d.cache != nil {
var user model.User
if ok := d.cache.Get(d.ctx, keyCacheBySn(sn, user.TableName()), &user); ok {