Merge pull request 'Ajouter et implémenter models.NotImplementedResponse()' (#139) from refactor/not-implemented-response into main
Reviewed-on: #139
This commit is contained in:
commit
37eb18cfa5
2 changed files with 10 additions and 3 deletions
|
@ -258,6 +258,7 @@ func HandleV1DocumentCreate(c echo.Context) error {
|
|||
response.Data.Bucket = info.Bucket
|
||||
response.Data.Key = info.Key
|
||||
response.Data.Size = info.Size
|
||||
|
||||
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
|
||||
func HandleV1DocumentUpdate(c echo.Context) error {
|
||||
return c.JSON(http.StatusNotImplemented, map[string]string{
|
||||
"message": "Not Implemented",
|
||||
})
|
||||
return c.JSON(models.NotImplementedResponse())
|
||||
}
|
||||
|
||||
// HandleV1DocumentDelete permet de supprimer un object
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package models
|
||||
|
||||
import "net/http"
|
||||
|
||||
type Responder interface {
|
||||
Respond() Responder
|
||||
}
|
||||
|
@ -28,6 +30,12 @@ func NotFoundResponse() SimpleResponse {
|
|||
}
|
||||
}
|
||||
|
||||
func NotImplementedResponse() (int, SimpleResponse) {
|
||||
return http.StatusNotImplemented, SimpleResponse{
|
||||
Message: "Not Implemented",
|
||||
}
|
||||
}
|
||||
|
||||
type HandleAdminDocumentsUploadResponse struct {
|
||||
Response
|
||||
Data struct {
|
||||
|
|
Loading…
Reference in a new issue