From 73682e6e7b3deb0ca12fffa1653b22952627006d Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Sun, 21 Jul 2024 22:04:33 +0700 Subject: [PATCH] answer --- go.mod | 4 ++-- go.sum | 4 ++++ internal/dto/stamp.dto.go | 2 ++ internal/stamp/stamp.handler.go | 1 + internal/stamp/stamp.service.go | 1 + 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 5392ea6..b4cb76f 100644 --- a/go.mod +++ b/go.mod @@ -12,8 +12,8 @@ require ( github.com/go-playground/validator/v10 v10.22.0 github.com/golang/mock v1.6.0 github.com/google/uuid v1.6.0 - github.com/isd-sgcu/rpkm67-go-proto v0.5.3 - github.com/isd-sgcu/rpkm67-model v0.2.0 + github.com/isd-sgcu/rpkm67-go-proto v0.5.4 + github.com/isd-sgcu/rpkm67-model v0.2.1 github.com/joho/godotenv v1.5.1 github.com/prometheus/client_golang v1.19.1 github.com/stretchr/testify v1.9.0 diff --git a/go.sum b/go.sum index a2de470..b5d20d9 100644 --- a/go.sum +++ b/go.sum @@ -69,10 +69,14 @@ github.com/isd-sgcu/rpkm67-go-proto v0.5.2 h1:CP9oXIa4MrJZd6ynHkVt18YPGlQU0bkDM1 github.com/isd-sgcu/rpkm67-go-proto v0.5.2/go.mod h1:w+UCeQnJ3wBuJ7Tyf8LiBiPZVb1KlecjMNCB7kBeL7M= github.com/isd-sgcu/rpkm67-go-proto v0.5.3 h1:DMxo3vu5OB2RaODWQwIIFRTyPEyTNMvwmfDbVmVnmnM= github.com/isd-sgcu/rpkm67-go-proto v0.5.3/go.mod h1:w+UCeQnJ3wBuJ7Tyf8LiBiPZVb1KlecjMNCB7kBeL7M= +github.com/isd-sgcu/rpkm67-go-proto v0.5.4 h1:XcbTKhQFGHiFf10kxsoK8oyZ2v1b2uQ2gmOmzI5sEYE= +github.com/isd-sgcu/rpkm67-go-proto v0.5.4/go.mod h1:w+UCeQnJ3wBuJ7Tyf8LiBiPZVb1KlecjMNCB7kBeL7M= github.com/isd-sgcu/rpkm67-model v0.0.7 h1:3b8gf1Ocg+Ky4xocKtCqVCB3rFDg90IgEXRwNmHt0OE= github.com/isd-sgcu/rpkm67-model v0.0.7/go.mod h1:dxgLSkrFpbQOXsrzqgepZoEOyZUIG2LBGtm5gsuBbVc= github.com/isd-sgcu/rpkm67-model v0.2.0 h1:D2KytmevtV9/3FwfA7FiKo2UKa3jC8knZI97vwRuboA= github.com/isd-sgcu/rpkm67-model v0.2.0/go.mod h1:dxgLSkrFpbQOXsrzqgepZoEOyZUIG2LBGtm5gsuBbVc= +github.com/isd-sgcu/rpkm67-model v0.2.1 h1:O6mZeZqDjGbiEJa5zzbf6cVwz4uVOtQTuAxnkLj+2oQ= +github.com/isd-sgcu/rpkm67-model v0.2.1/go.mod h1:dxgLSkrFpbQOXsrzqgepZoEOyZUIG2LBGtm5gsuBbVc= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= diff --git a/internal/dto/stamp.dto.go b/internal/dto/stamp.dto.go index 9d462b2..b2e3d71 100644 --- a/internal/dto/stamp.dto.go +++ b/internal/dto/stamp.dto.go @@ -22,11 +22,13 @@ type StampByUserIdRequest struct { UserID string `json:"user_id"` ActivityId string `json:"activity_id"` PinCode string `json:"pin_code"` + Answer string `json:"answer"` } type StampByUserIdBodyRequest struct { ActivityId string `json:"activity_id"` PinCode string `json:"pin_code"` + Answer string `json:"answer"` } type StampByUserIdResponse struct { diff --git a/internal/stamp/stamp.handler.go b/internal/stamp/stamp.handler.go index be69a06..b8a1685 100644 --- a/internal/stamp/stamp.handler.go +++ b/internal/stamp/stamp.handler.go @@ -100,6 +100,7 @@ func (h *handlerImpl) StampByUserId(c context.Ctx) { UserID: userId, ActivityId: body.ActivityId, PinCode: body.PinCode, + Answer: body.Answer, } res, appErr := h.svc.StampByUserId(req) diff --git a/internal/stamp/stamp.service.go b/internal/stamp/stamp.service.go index 28f0a1b..b33b0cf 100644 --- a/internal/stamp/stamp.service.go +++ b/internal/stamp/stamp.service.go @@ -72,6 +72,7 @@ func (s *serviceImpl) StampByUserId(req *dto.StampByUserIdRequest) (*dto.StampBy res, err := s.client.StampByUserId(ctx, &stampProto.StampByUserIdRequest{ UserId: req.UserID, ActivityId: req.ActivityId, + Answer: req.Answer, }) if err != nil { s.logger.Named("StampByUserId").Error("StampByUserId: ", zap.Error(err))