Ajouter et implémenter models.NotImplementedResponse() #139

Merged
vlbeaudoin merged 1 commit from refactor/not-implemented-response into main 2023-08-23 15:44:07 -04:00
2 changed files with 10 additions and 3 deletions

View file

@ -258,6 +258,7 @@ func HandleV1DocumentCreate(c echo.Context) error {
response.Data.Bucket = info.Bucket response.Data.Bucket = info.Bucket
response.Data.Key = info.Key response.Data.Key = info.Key
response.Data.Size = info.Size response.Data.Size = info.Size
return c.JSON(response.StatusCode, response) return c.JSON(response.StatusCode, response)
} }
@ -334,9 +335,7 @@ func HandleV1DocumentRead(c echo.Context) error {
// HandleV1DocumentUpdate permet de mettre à jour certains champs d'un object, comme le Content-Type ou le Filename // HandleV1DocumentUpdate permet de mettre à jour certains champs d'un object, comme le Content-Type ou le Filename
func HandleV1DocumentUpdate(c echo.Context) error { func HandleV1DocumentUpdate(c echo.Context) error {
return c.JSON(http.StatusNotImplemented, map[string]string{ return c.JSON(models.NotImplementedResponse())
"message": "Not Implemented",
})
} }
// HandleV1DocumentDelete permet de supprimer un object // HandleV1DocumentDelete permet de supprimer un object

View file

@ -1,5 +1,7 @@
package models package models
import "net/http"
type Responder interface { type Responder interface {
Respond() Responder Respond() Responder
} }
@ -28,6 +30,12 @@ func NotFoundResponse() SimpleResponse {
} }
} }
func NotImplementedResponse() (int, SimpleResponse) {
return http.StatusNotImplemented, SimpleResponse{
Message: "Not Implemented",
}
}
type HandleAdminDocumentsUploadResponse struct { type HandleAdminDocumentsUploadResponse struct {
Response Response
Data struct { Data struct {