init
Some checks failed
Build and Release / release (push) Failing after 51s

This commit is contained in:
2026-03-25 22:29:07 +07:00
parent eedd300861
commit 79199f627d
65 changed files with 3215 additions and 689 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"`
}

View File

@@ -0,0 +1,16 @@
package response
import "time"
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 *time.Time `json:"created_at"`
UpdatedAt *time.Time `json:"updated_at"`
}

View File

@@ -0,0 +1,11 @@
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"`
}

View File

@@ -0,0 +1,26 @@
package response
import "time"
type UserResponse struct {
ID string `json:"id"`
Email string `json:"email"`
Profile *UserProfileSimpleResponse `json:"profile"`
IsVerified bool `json:"is_verified"`
TokenVersion int32 `json:"token_version"`
IsDeleted bool `json:"is_deleted"`
CreatedAt *time.Time `json:"created_at"`
UpdatedAt *time.Time `json:"updated_at"`
Roles []*RoleSimpleResponse `json:"roles"`
}
type UserProfileSimpleResponse struct {
DisplayName string `json:"display_name"`
FullName string `json:"full_name"`
AvatarUrl string `json:"avatar_url"`
Bio string `json:"bio"`
Location string `json:"location"`
Website string `json:"website"`
CountryCode string `json:"country_code"`
Phone string `json:"phone"`
}