This commit is contained in:
张超
2025-05-27 19:01:05 +08:00
parent f02495cc7a
commit 5ffc64e1dd
16 changed files with 512 additions and 123 deletions

View File

@@ -69,3 +69,12 @@ func (a *Account) CheckDuplicateUsername() bool {
return true
}
}
// GetAccountByID 根据 ID 查询用户
func GetAccountByID(id uint) (*Account, error) {
var account Account
if err := DB.First(&account, id).Error; err != nil {
return nil, err
}
return &account, nil
}