feat: use postgres to fetch and store user info

This commit is contained in:
nihonium 2025-11-27 09:42:05 +03:00
parent 3528ea7d34
commit 40e0b14f2a
Signed by: nihonium
GPG key ID: 0251623741027CFC
9 changed files with 175 additions and 42 deletions

View file

@ -116,9 +116,8 @@ type PostAuthSignInResponseObject interface {
}
type PostAuthSignIn200JSONResponse struct {
Error *string `json:"error"`
UserId *string `json:"user_id"`
UserName *string `json:"user_name"`
UserId int64 `json:"user_id"`
UserName string `json:"user_name"`
}
func (response PostAuthSignIn200JSONResponse) VisitPostAuthSignInResponse(w http.ResponseWriter) error {
@ -148,9 +147,7 @@ type PostAuthSignUpResponseObject interface {
}
type PostAuthSignUp200JSONResponse struct {
Error *string `json:"error"`
Success *bool `json:"success,omitempty"`
UserId *string `json:"user_id"`
UserId int64 `json:"user_id"`
}
func (response PostAuthSignUp200JSONResponse) VisitPostAuthSignUpResponse(w http.ResponseWriter) error {

View file

@ -30,16 +30,13 @@ paths:
content:
application/json:
schema:
required:
- user_id
type: object
properties:
success:
type: boolean
error:
type: string
nullable: true
user_id:
type: string
nullable: true
type: integer
format: int64
/auth/sign-in:
post:
@ -65,17 +62,16 @@ paths:
content:
application/json:
schema:
required:
- user_id
- user_name
type: object
properties:
error:
type: string
nullable: true
user_id:
type: string
nullable: true
type: integer
format: int64
user_name:
type: string
nullable: true
"401":
description: Access denied due to invalid credentials
content: