This commit is contained in:
2026-03-23 18:55:27 +07:00
parent 6dc0322fe5
commit 3626c12319
47 changed files with 2741 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
package response
type AuthResponse struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
}

View File

@@ -0,0 +1,19 @@
package response
import (
"history-api/pkg/constant"
"github.com/golang-jwt/jwt/v5"
)
type CommonResponse struct {
Status bool `json:"status"`
Data any `json:"data"`
Message string `json:"message"`
}
type JWTClaims struct {
UId string `json:"uid"`
Roles []constant.Role `json:"roles"`
jwt.RegisteredClaims
}

View File

@@ -0,0 +1,9 @@
package response
type PreSignedResponse struct {
UploadUrl string `json:"uploadUrl"`
PublicUrl string `json:"publicUrl"`
FileName string `json:"fileName"`
MediaId string `json:"mediaId"`
SignedHeaders map[string]string `json:"signedHeaders"`
}

14
pkg/dtos/response/role.go Normal file
View File

@@ -0,0 +1,14 @@
package response
type RoleSimpleResponse struct {
ID string `json:"id"`
Name string `json:"name"`
}
type RoleResponse struct {
ID string `json:"id"`
Name string `json:"name"`
IsDeleted bool `json:"is_deleted"`
CreatedAt *string `json:"created_at"`
UpdatedAt *string `json:"updated_at"`
}

View File

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

15
pkg/dtos/response/user.go Normal file
View File

@@ -0,0 +1,15 @@
package response
type UserResponse struct {
ID string `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
AvatarUrl string `json:"avatar_url"`
IsActive bool `json:"is_active"`
IsVerified bool `json:"is_verified"`
TokenVersion int32 `json:"token_version"`
IsDeleted bool `json:"is_deleted"`
CreatedAt *string `json:"created_at"`
UpdatedAt *string `json:"updated_at"`
Roles []*RoleSimpleResponse `json:"roles"`
}