fix(BE): kandang capacity and fix err response

This commit is contained in:
Hafizh A. Y
2025-11-14 16:43:01 +07:00
parent 80c84210b8
commit 17d3042586
15 changed files with 129 additions and 84 deletions
+8 -6
View File
@@ -10,15 +10,16 @@ import (
// === DTO Structs ===
type {{Pascal .Entity}}BaseDTO struct {
Id uint `json:"id"`
Name string `json:"name"`
Id uint `json:"id"`
Name string `json:"name"`
}
type {{Pascal .Entity}}ListDTO struct {
{{Pascal .Entity}}BaseDTO
Id uint `json:"id"`
Name string `json:"name"`
CreatedUser *userDTO.UserBaseDTO `json:"created_user"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type {{Pascal .Entity}}DetailDTO struct {
@@ -42,7 +43,8 @@ func To{{Pascal .Entity}}ListDTO(e entity.{{Pascal .Entity}}) {{Pascal .Entity}}
}
return {{Pascal .Entity}}ListDTO{
{{Pascal .Entity}}BaseDTO: To{{Pascal .Entity}}BaseDTO(e),
Id: e.Id,
Name: e.Name,
CreatedAt: e.CreatedAt,
UpdatedAt: e.UpdatedAt,
CreatedUser: createdUser,