mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
fix(BE): adjust dto and project flock, master data, and marketing
This commit is contained in:
@@ -11,12 +11,12 @@ import (
|
||||
// === DTO Structs ===
|
||||
|
||||
type KandangRelationDTO struct {
|
||||
Id uint `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Status string `json:"status"`
|
||||
Capacity float64 `json:"capacity"`
|
||||
Location locationDTO.LocationRelationDTO `json:"location,omitempty"`
|
||||
Pic userDTO.UserRelationDTO `json:"pic,omitempty"`
|
||||
Id uint `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Status string `json:"status"`
|
||||
Capacity float64 `json:"capacity"`
|
||||
Location *locationDTO.LocationRelationDTO `json:"location,omitempty"`
|
||||
Pic *userDTO.UserRelationDTO `json:"pic,omitempty"`
|
||||
}
|
||||
|
||||
type KandangListDTO struct {
|
||||
@@ -38,16 +38,16 @@ type KandangDetailDTO struct {
|
||||
// === Mapper Functions ===
|
||||
|
||||
func ToKandangRelationDTO(e entity.Kandang) KandangRelationDTO {
|
||||
var location locationDTO.LocationRelationDTO
|
||||
var location *locationDTO.LocationRelationDTO
|
||||
if e.Location.Id != 0 {
|
||||
mapped := locationDTO.ToLocationRelationDTO(e.Location)
|
||||
location = mapped
|
||||
location = &mapped
|
||||
}
|
||||
|
||||
var pic userDTO.UserRelationDTO
|
||||
var pic *userDTO.UserRelationDTO
|
||||
if e.Pic.Id != 0 {
|
||||
mapped := userDTO.ToUserRelationDTO(e.Pic)
|
||||
pic = mapped
|
||||
pic = &mapped
|
||||
}
|
||||
|
||||
return KandangRelationDTO{
|
||||
|
||||
Reference in New Issue
Block a user