From ade717fae72a71d880d5d5e15c9ba0c6966cd363 Mon Sep 17 00:00:00 2001 From: Gear <84141000+macgeargear@users.noreply.github.com> Date: Thu, 11 Jan 2024 14:00:35 +0700 Subject: [PATCH] chore --- src/app/dto/image.dto.go | 4 ++-- src/app/router/image.router.go | 7 ------- src/main.go | 2 +- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/app/dto/image.dto.go b/src/app/dto/image.dto.go index a04a4fb..98414f1 100644 --- a/src/app/dto/image.dto.go +++ b/src/app/dto/image.dto.go @@ -17,8 +17,8 @@ type DeleteImageResponse struct { } type AssignPetRequest struct { - Ids []string `json:"ids"` - PetId string `json:"pet_id"` + Ids []string `json:"ids" validate:"required"` + PetId string `json:"pet_id" validate:"required"` } type AssignPetResponse struct { diff --git a/src/app/router/image.router.go b/src/app/router/image.router.go index d348d21..bebbc0c 100644 --- a/src/app/router/image.router.go +++ b/src/app/router/image.router.go @@ -22,10 +22,3 @@ func (r *FiberRouter) GetImage(path string, h func(ctx *FiberCtx)) { return nil }) } - -func (r *FiberRouter) AssignPet(path string, h func(ctx *FiberCtx)) { - r.image.Post(path, func(c *fiber.Ctx) error { - h(NewFiberCtx(c)) - return nil - }) -} diff --git a/src/main.go b/src/main.go index 63ff2da..8e785da 100644 --- a/src/main.go +++ b/src/main.go @@ -146,7 +146,7 @@ func main() { r.PostImage("/", imageHandler.Upload) r.DeleteImage("/:id", imageHandler.Delete) - r.AssignPet("/assign", imageHandler.AssignPet) + r.PostImage("/assign", imageHandler.AssignPet) v1 := router.NewAPIv1(r, conf.App)