Commit 4f93c356 authored by MaxGranzow's avatar MaxGranzow Committed by Julien Schröter

Add mock implementation of user recommendation endpoint for testing

parent 848d2ac6
...@@ -150,6 +150,16 @@ func (mockUser) SelectByUsernameLike(username string) ([]schemas.InfoUserSchema, ...@@ -150,6 +150,16 @@ func (mockUser) SelectByUsernameLike(username string) ([]schemas.InfoUserSchema,
return users, nil return users, nil
} }
func (mockUser) SelectUserRecommendations(userID uint32, count uint32) ([]schemas.InfoUserSchema, error) {
var users []schemas.InfoUserSchema
for _, u := range mockUsers {
if u.ID != userID {
users = append(users, getMockUserInfo(u))
}
}
return users, nil
}
// Users with IDs 1-3 have authentication. Everyone else will be rejected. // Users with IDs 1-3 have authentication. Everyone else will be rejected.
func (mockUser) Authenticate(name string, password string) (uint32, error) { func (mockUser) Authenticate(name string, password string) (uint32, error) {
if correctpassword, ok := mockUserPasswords[name]; ok && password == correctpassword { if correctpassword, ok := mockUserPasswords[name]; ok && password == correctpassword {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment