update
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user