1
0
mirror of https://github.com/fumiama/paper-manager.git synced 2026-06-21 02:40:26 +08:00

add /api/getUsersCount

This commit is contained in:
源文雨
2023-03-18 15:38:28 +08:00
parent a072cfe1cf
commit a00b9e4048
14 changed files with 299 additions and 53 deletions

View File

@@ -72,3 +72,11 @@ func logout(token string) error {
usertokens.Delete(token)
return nil
}
func getUsersCount(token string) (int, error) {
user := usertokens.Get(token)
if user == nil {
return 0, errInvalidToken
}
return global.UserDB.GetUsersCount()
}