fix: adjust docker and any file for starting project

This commit is contained in:
Hafizh A. Y
2025-09-30 14:45:54 +07:00
parent c136206f2d
commit 94a6d41a61
27 changed files with 599 additions and 600 deletions
+18 -4
View File
@@ -8,9 +8,15 @@ import (
// === DTO Structs ===
type UserBaseDTO struct {
Id uint `json:"id"`
IdUser int64 `json:"id_user"`
Email string `json:"email"`
Name string `json:"name"`
}
type UserListDTO struct {
Id uint `json:"id"`
Name string `json:"name"`
UserBaseDTO
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
@@ -21,13 +27,21 @@ type UserDetailDTO struct {
// === Mapper Functions ===
func ToUserListDTO(m model.User) UserListDTO {
return UserListDTO{
func ToUserBaseDTO(m model.User) UserBaseDTO {
return UserBaseDTO{
Id: m.Id,
Name: m.Name,
}
}
func ToUserListDTO(m model.User) UserListDTO {
return UserListDTO{
UserBaseDTO: ToUserBaseDTO(m),
CreatedAt: m.CreatedAt,
UpdatedAt: m.UpdatedAt,
}
}
func ToUserListDTOs(m []model.User) []UserListDTO {
result := make([]UserListDTO, len(m))
for i, r := range m {