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.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
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue