mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 21:41:55 +00:00
chore: update port so it doesn't conflict with sso
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
model "gitlab.com/mbugroup/lti-api.git/internal/modules/master/uoms/models"
|
||||
)
|
||||
|
||||
// === DTO Structs ===
|
||||
|
||||
type UomBaseDTO struct {
|
||||
Id uint `json:"id"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
type UomListDTO struct {
|
||||
UomBaseDTO
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type UomDetailDTO struct {
|
||||
UomListDTO
|
||||
}
|
||||
|
||||
// === Mapper Functions ===
|
||||
|
||||
func ToUomBaseDTO(m model.Uom) UomBaseDTO {
|
||||
return UomBaseDTO{
|
||||
Id: m.Id,
|
||||
Name: m.Name,
|
||||
}
|
||||
}
|
||||
|
||||
func ToUomListDTO(m model.Uom) UomListDTO {
|
||||
return UomListDTO{
|
||||
UomBaseDTO: ToUomBaseDTO(m),
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func ToUomListDTOs(m []model.Uom) []UomListDTO {
|
||||
result := make([]UomListDTO, len(m))
|
||||
for i, r := range m {
|
||||
result[i] = ToUomListDTO(r)
|
||||
}
|
||||
return result
|
||||
}
|
||||
Reference in New Issue
Block a user