Reorg and add services

This commit is contained in:
Dustin Pianalto
2020-10-09 21:34:47 -08:00
parent 96b9c3825c
commit 134af6b013
19 changed files with 658 additions and 432 deletions
+6 -6
View File
@@ -44,7 +44,7 @@ func (s *UserService) CreateUser(u *goff.User) error {
}
func (s *UserService) DeleteUser(u *goff.User) error {
queryString := `DELETE FROM x_users_guilds WHERE user_id = $1; DELETE FROM users WHERE id = $1`
queryString := `DELETE CASCADE FROM x_users_guilds WHERE user_id = $1; DELETE FROM users WHERE id = $1`
_, err := s.DB.Exec(queryString, u.ID)
return err
}
@@ -72,11 +72,11 @@ func (s *UserService) RemoveUserFromGuild(u *goff.User, g *goff.Guild) error {
func (s *UserService) UpdateUser(u *goff.User) error {
queryString := `UPDATE users SET
banned = $1
logging = $2
steam_id = $3
is_active = $4
is_staff = $5
banned = $1,
logging = $2,
steam_id = $3,
is_active = $4,
is_staff = $5,
is_admin = $6
WHERE id = $7`
_, err := s.DB.Exec(queryString, u.Banned, u.Logging, u.SteamID, u.IsActive, u.IsStaff, u.IsAdmin)