UPDATE: Auth module, User module
Some checks failed
Build and Release / release (push) Failing after 1m25s

This commit is contained in:
2026-03-30 00:27:57 +07:00
parent 92d44bb00c
commit f04441bf2a
59 changed files with 4246 additions and 521 deletions

View File

@@ -4,3 +4,7 @@ type AuthResponse struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
}
type VerifyTokenResponse struct {
TokenID string `json:"token_id"`
}

View File

@@ -1,7 +1,7 @@
package response
import (
"history-api/pkg/constant"
"history-api/pkg/constants"
"github.com/golang-jwt/jwt/v5"
)
@@ -13,7 +13,18 @@ type CommonResponse struct {
}
type JWTClaims struct {
UId string `json:"uid"`
Roles []constant.Role `json:"roles"`
UId string `json:"uid"`
Roles []constants.Role `json:"roles"`
TokenVersion int32 `json:"token_version"`
jwt.RegisteredClaims
}
}
type PaginatedResponse struct {
Data any `json:"data"`
Status bool `json:"status"`
Message string `json:"message"`
Pagination struct {
NextCursor string `json:"next_cursor"`
HasMore bool `json:"has_more"`
} `json:"pagination"`
}

View File

@@ -1,11 +0,0 @@
package response
import "time"
type TokenResponse struct {
ID string `json:"id"`
UserID string `json:"user_id"`
TokenType int16 `json:"token_type"`
ExpiresAt *time.Time `json:"expires_at"`
CreatedAt *time.Time `json:"created_at"`
}