mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-22 22:35:43 +00:00
feat(BE): add function read and download in document
This commit is contained in:
@@ -45,6 +45,7 @@ type UniformityInfoDTO struct {
|
||||
ProjectFlock string `json:"project_flock"`
|
||||
Kandang string `json:"kandang"`
|
||||
FileName string `json:"file_name"`
|
||||
FileURL string `json:"file_url"`
|
||||
}
|
||||
|
||||
type UniformityDetailDTO struct {
|
||||
@@ -97,6 +98,7 @@ func ToUniformityDetailDTO(
|
||||
entityData entity.ProjectFlockKandangUniformity,
|
||||
calc service.UniformityCalculation,
|
||||
document *entity.Document,
|
||||
documentURL string,
|
||||
standard *UniformityStandardDTO,
|
||||
) UniformityDetailDTO {
|
||||
info := UniformityInfoDTO{
|
||||
@@ -105,10 +107,14 @@ func ToUniformityDetailDTO(
|
||||
ProjectFlock: resolveProjectFlockName(entityData.ProjectFlockKandang),
|
||||
Kandang: resolveKandangName(entityData.ProjectFlockKandang),
|
||||
FileName: "",
|
||||
FileURL: "",
|
||||
}
|
||||
if document != nil {
|
||||
info.FileName = document.Name
|
||||
}
|
||||
if documentURL != "" {
|
||||
info.FileURL = documentURL
|
||||
}
|
||||
|
||||
return UniformityDetailDTO{
|
||||
Id: entityData.Id,
|
||||
|
||||
Reference in New Issue
Block a user