mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
fix(BE-273): add object nonstock and supplier in response get one and fix name base to relation in dto
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
// === DTO Structs ===
|
||||
|
||||
type UserBaseDTO struct {
|
||||
type UserRelationDTO struct {
|
||||
Id uint `json:"id"`
|
||||
IdUser int64 `json:"id_user"`
|
||||
Email string `json:"email"`
|
||||
@@ -16,7 +16,7 @@ type UserBaseDTO struct {
|
||||
}
|
||||
|
||||
type UserListDTO struct {
|
||||
UserBaseDTO
|
||||
UserRelationDTO
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
@@ -27,8 +27,8 @@ type UserDetailDTO struct {
|
||||
|
||||
// === Mapper Functions ===
|
||||
|
||||
func ToUserBaseDTO(m entity.User) UserBaseDTO {
|
||||
return UserBaseDTO{
|
||||
func ToUserRelationDTO(m entity.User) UserRelationDTO {
|
||||
return UserRelationDTO{
|
||||
Id: m.Id,
|
||||
IdUser: m.IdUser,
|
||||
Email: m.Email,
|
||||
@@ -38,9 +38,9 @@ func ToUserBaseDTO(m entity.User) UserBaseDTO {
|
||||
|
||||
func ToUserListDTO(m entity.User) UserListDTO {
|
||||
return UserListDTO{
|
||||
UserBaseDTO: ToUserBaseDTO(m),
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
UserRelationDTO: ToUserRelationDTO(m),
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user