diff --git a/src/app/handler/adopt/adopt.handler.go b/src/app/handler/adopt/adopt.handler.go deleted file mode 100644 index a082237..0000000 --- a/src/app/handler/adopt/adopt.handler.go +++ /dev/null @@ -1,35 +0,0 @@ -package auth - -import ( - "github.com/isd-sgcu/johnjud-gateway/src/app/dto" - "github.com/isd-sgcu/johnjud-gateway/src/app/router" - "github.com/isd-sgcu/johnjud-gateway/src/app/validator" - proto "github.com/isd-sgcu/johnjud-go-proto/johnjud/backend/adopt/v1" -) - -type Handler struct { - service Service - validate *validator.DtoValidator -} - -type Service interface { - FindAll() ([]*proto.Adopt, *dto.ResponseErr) - Create(*dto.AdoptDto) (*proto.Adopt, *dto.ResponseErr) - Delete(string) (bool, *dto.ResponseErr) -} - -func NewHandler(service Service, validate *validator.DtoValidator) *Handler { - return &Handler{service, validate} -} - -func (h *Handler) FindAll(c *router.FiberCtx) { - -} - -func (h *Handler) Create(c *router.FiberCtx) { - -} - -func (h *Handler) Delete(c *router.FiberCtx) { - -} diff --git a/src/app/router/adopt.router.go b/src/app/router/adopt.router.go deleted file mode 100644 index 9619080..0000000 --- a/src/app/router/adopt.router.go +++ /dev/null @@ -1,24 +0,0 @@ -package router - -import "github.com/gofiber/fiber/v2" - -func (r *FiberRouter) GetAdopt(path string, h func(ctx *FiberCtx)) { - r.adopt.Get(path, func(c *fiber.Ctx) error { - h(NewFiberCtx(c)) - return nil - }) -} - -func (r *FiberRouter) PostAdopt(path string, h func(ctx *FiberCtx)) { - r.adopt.Post(path, func(c *fiber.Ctx) error { - h(NewFiberCtx(c)) - return nil - }) -} - -func (r *FiberRouter) DeleteAdopt(path string, h func(ctx *FiberCtx)) { - r.adopt.Delete(path, func(c *fiber.Ctx) error { - h(NewFiberCtx(c)) - return nil - }) -} diff --git a/src/app/router/router.go b/src/app/router/router.go index e41ef3d..ea19491 100644 --- a/src/app/router/router.go +++ b/src/app/router/router.go @@ -15,7 +15,6 @@ type FiberRouter struct { pet fiber.Router image fiber.Router like fiber.Router - adopt fiber.Router } type IGuard interface { @@ -53,9 +52,8 @@ func NewFiberRouter(authGuard IGuard, conf config.App) *FiberRouter { pet := GroupWithAuthMiddleware(r, "/pet", authGuard.Use) image := GroupWithAuthMiddleware(r, "/image", authGuard.Use) like := GroupWithAuthMiddleware(r, "/like", authGuard.Use) - adopt := GroupWithAuthMiddleware(r, "/adopt", authGuard.Use) - return &FiberRouter{r, auth, user, pet, image, adopt, like} + return &FiberRouter{r, auth, user, pet, image, like} } func GroupWithAuthMiddleware(r *fiber.App, path string, middleware func(ctx IContext) error) fiber.Router { diff --git a/src/app/service/adopt/adopt.service.go b/src/app/service/adopt/adopt.service.go deleted file mode 100644 index ff4609f..0000000 --- a/src/app/service/adopt/adopt.service.go +++ /dev/null @@ -1,28 +0,0 @@ -package adopt - -import ( - "github.com/isd-sgcu/johnjud-gateway/src/app/dto" - proto "github.com/isd-sgcu/johnjud-go-proto/johnjud/backend/adopt/v1" -) - -type Service struct { - client proto.AdoptServiceClient -} - -func NewService(client proto.AdoptServiceClient) *Service { - return &Service{ - client: client, - } -} - -func (s *Service) FindAll() ([]*proto.Adopt, *dto.ResponseErr) { - return nil, nil -} - -func (s *Service) Create(in *dto.AdoptDto) (*proto.Adopt, *dto.ResponseErr) { - return nil, nil -} - -func (s *Service) Delete(id string) (bool, *dto.ResponseErr) { - return false, nil -}