Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/pet #4

Merged
merged 147 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
c06d8c6
fix: pet dto
macgeargear Dec 26, 2023
2c116ad
feat: find one service
macgeargear Dec 26, 2023
61136a3
feat: find one service without image
macgeargear Dec 26, 2023
b6d3d23
feat: update pet service
macgeargear Dec 26, 2023
4042a77
feat: delete pet service
macgeargear Dec 26, 2023
37dd578
feat: find one pet handler
macgeargear Dec 26, 2023
27fcc37
fix: remove CreatePetDto use PetDto instead
macgeargear Dec 26, 2023
8d8b499
feat: delete pet handler
macgeargear Dec 26, 2023
d6e9a0e
chore
macgeargear Dec 26, 2023
3357fed
fix: typo
macgeargear Dec 26, 2023
0f29ccb
feat: find all pet service
macgeargear Dec 26, 2023
197412f
feat: all pet service test skeleton
macgeargear Dec 27, 2023
8fd9841
feat: add setup test on pet service
macgeargear Dec 27, 2023
06e8e40
feat: add FindOne pet mock
macgeargear Dec 27, 2023
f4e862b
feat: add Create pet mock
macgeargear Dec 27, 2023
7d0d96e
feat: add Update & Delete pet mock
macgeargear Dec 27, 2023
a1fc0a2
feat: add contextmock
macgeargear Dec 27, 2023
140b1d0
feat: add clientMock & serviceMock
macgeargear Dec 27, 2023
7ed9f55
chore
macgeargear Dec 27, 2023
1a68a31
feat: TestFindOneNotFound(not pass) & TestFindOneGrpcErr
macgeargear Dec 27, 2023
7f914e6
feat: TestFindOneGrpcErr(failed)
macgeargear Dec 27, 2023
02135d5
feat: add image service in findOne
macgeargear Dec 28, 2023
67c86d3
feat: add create pet dto
macgeargear Dec 28, 2023
0ad976f
chore
macgeargear Dec 28, 2023
1909fe3
feat: CreatePetSuccess CreatePetGrpcError
macgeargear Dec 28, 2023
0db71a0
feat: implement signIn service
Nitiwat-owen Dec 26, 2023
55776fd
feat: write unit test for sign in handler
Nitiwat-owen Dec 26, 2023
437d42c
feat: implement sign in handler
Nitiwat-owen Dec 26, 2023
4990ec1
fix: signIn return type
Nitiwat-owen Dec 26, 2023
4ae8234
chore: update docs
Nitiwat-owen Dec 26, 2023
c14cf59
fix: method name
Nitiwat-owen Dec 27, 2023
e62f29c
fix: auth service mock
Nitiwat-owen Dec 27, 2023
73c9c9e
fix: failed test
Nitiwat-owen Dec 27, 2023
3a43399
chore: rename sign in request dto
Nitiwat-owen Dec 27, 2023
8a77cda
feat: find one pet handler
macgeargear Dec 29, 2023
4df4865
feat: image mock
macgeargear Dec 29, 2023
664d6c2
feat: add change view request dto
macgeargear Dec 29, 2023
069424f
fix: ChangeView function signature
macgeargear Dec 30, 2023
acfa586
feat: change view service
macgeargear Dec 30, 2023
c82d266
fix: wrong return type
macgeargear Dec 30, 2023
a8007bd
fix: wrong return type
macgeargear Dec 30, 2023
4667689
fix: function name
macgeargear Dec 30, 2023
a151b8e
fix: wroung status code
macgeargear Dec 30, 2023
79b8501
feat: find all mock
macgeargear Dec 30, 2023
7722340
fix: change context timeout
macgeargear Dec 30, 2023
24a9885
fix: change PetReq type
macgeargear Dec 30, 2023
9f49e22
fix: wrong function name
macgeargear Dec 30, 2023
eee58d7
feat: pet id in setup test, image url with empty string
macgeargear Dec 30, 2023
78ba7ae
fix: FindOne handler
macgeargear Dec 30, 2023
44667b8
fix: add `id` to pet dto
macgeargear Dec 30, 2023
05f33ee
chore
macgeargear Dec 30, 2023
f64173a
chore
macgeargear Dec 30, 2023
e90b070
chore
macgeargear Dec 30, 2023
7919f46
fix: setup test
macgeargear Dec 30, 2023
2156a8f
chore
macgeargear Dec 30, 2023
7a89c49
fix: called argument
macgeargear Dec 30, 2023
5cc2b99
feat: Test
macgeargear Dec 30, 2023
873427c
feat: TestFindOneInternalErr
macgeargear Dec 30, 2023
84a4667
feat: TestFindOneGrpcErr
macgeargear Dec 30, 2023
a6627e8
fix: change FinAll function signature to `c router.IContext`
macgeargear Dec 30, 2023
9952891
feat: CreateSuccess & CreateGrpcError
macgeargear Dec 30, 2023
54c57b7
chore
macgeargear Dec 30, 2023
bc9d5bb
feat: TestUpdateSuccess
macgeargear Dec 30, 2023
e7ff366
feat: TestUpdateSuccess
macgeargear Dec 30, 2023
744cf91
chore
macgeargear Dec 30, 2023
5612af0
chore
macgeargear Dec 30, 2023
b495323
fix: add update pet dto binding
macgeargear Dec 30, 2023
37ef856
feat: TestUpdateNotFound & TEstUpdateGrpcError
macgeargear Dec 30, 2023
d28ee44
fix: change context type
macgeargear Dec 30, 2023
b996027
feat: TestDeleteSuccess
macgeargear Dec 30, 2023
a0a0f3d
feat: TestDeleteNotFound & TestDeleteInvalidID
macgeargear Dec 30, 2023
696abcc
feat: TestDeleteGrpcError
macgeargear Dec 30, 2023
9530d3d
feat: TestChangeViewSuccess
macgeargear Dec 30, 2023
ad92340
fix: call
macgeargear Dec 30, 2023
d2d3ef4
feat: TestChangeViewNotFound
macgeargear Dec 30, 2023
f537d7e
feat: TestChangeViewGrpcError
macgeargear Dec 30, 2023
726ed1d
feat: TestChangeView
macgeargear Dec 30, 2023
a21811e
fix: call
macgeargear Dec 30, 2023
8f1ad5d
chore
macgeargear Dec 30, 2023
1dc27a2
chore
macgeargear Dec 30, 2023
bb3bb31
feat: ChangeView
macgeargear Dec 30, 2023
7eaf9fe
feat: Add change view pet dto
macgeargear Dec 30, 2023
5df7e95
feat: TestChangeView
macgeargear Dec 30, 2023
e8dd735
fix: ChangeView params
macgeargear Dec 30, 2023
b478d1d
feat: FindAll Pet mock
macgeargear Dec 30, 2023
62a5eb6
feat: FindAllSuccess
macgeargear Dec 30, 2023
fd3797d
feat: TestFindAllSuccess
macgeargear Dec 30, 2023
49dfd38
fix: FindAll pet handler
macgeargear Dec 30, 2023
b01985e
fix: use go-faker instead of bxcodec
bookpanda Dec 31, 2023
0462a06
chore: mod tidy
bookpanda Dec 31, 2023
a58f485
Merge branch 'dev' into feature/pet
bookpanda Dec 31, 2023
b7096a6
feat: mock-gen for pet service
macgeargear Jan 1, 2024
96d0561
chore: remove unused code
macgeargear Jan 1, 2024
f6fd7c5
feat: add pet service interface
macgeargear Jan 1, 2024
f4ef5db
fix: re write all unit test for new pet client mock
macgeargear Jan 1, 2024
c2338d9
chore: add log in FindAll
macgeargear Jan 1, 2024
52e0a8a
chore
macgeargear Jan 1, 2024
a0c4bc4
chore
macgeargear Jan 1, 2024
917958f
fix: change view dto
macgeargear Jan 2, 2024
a909e86
fix: Handler
macgeargear Jan 2, 2024
c21b616
chore: change view
macgeargear Jan 2, 2024
e4c6222
fix: TestChangeViewSuccess
macgeargear Jan 2, 2024
492ab77
chore
macgeargear Jan 2, 2024
f22ca8d
fix: change view arguments
macgeargear Jan 2, 2024
900ac2f
feat: add mockgen for pet service
macgeargear Jan 2, 2024
2253cc7
feat: image interface for mock
macgeargear Jan 2, 2024
8752b06
feat: gen mock
macgeargear Jan 2, 2024
3e82599
chore
macgeargear Jan 2, 2024
5b46b3e
feat: add image mock
macgeargear Jan 2, 2024
3646d1b
chore
macgeargear Jan 2, 2024
47bca37
chore: typo
macgeargear Jan 2, 2024
1bcf912
chore: add function argument
macgeargear Jan 2, 2024
29c6ae5
fix: image service type
macgeargear Jan 2, 2024
bbda0aa
fix: function argument
macgeargear Jan 2, 2024
9455f73
feat: pet routes
macgeargear Jan 2, 2024
79f48f0
feat: custom unmarshalJSON for `Status` and `Gender`
macgeargear Jan 2, 2024
12f3def
chore: function argument
macgeargear Jan 2, 2024
56ff9a5
feat: pet group router
macgeargear Jan 2, 2024
28a9d17
fix: add required tag for `CreatePetDto`
macgeargear Jan 2, 2024
c2a0910
chore
macgeargear Jan 2, 2024
13b3358
chore
macgeargear Jan 2, 2024
9af0707
feat: invalid argument constant
macgeargear Jan 2, 2024
911b5bd
fix: add test coresponding to errors in pet service
macgeargear Jan 2, 2024
8585673
fix: Implement comprehensive error validation for all functions
macgeargear Jan 2, 2024
0028bc4
fix: remvoe unused code
macgeargear Jan 2, 2024
001acc6
chore
macgeargear Jan 2, 2024
c866c52
chore
macgeargear Jan 2, 2024
b16dda6
fix: log
macgeargear Jan 3, 2024
ac295aa
feat: add find all doc description
macgeargear Jan 3, 2024
e219ec2
fix: update pet missing id in request
macgeargear Jan 3, 2024
f8da32d
fix: change boolean type
macgeargear Jan 4, 2024
4d0b57f
fix: bool type
macgeargear Jan 4, 2024
3f8c546
fix: wrong handler
macgeargear Jan 4, 2024
9b20602
chore: update proto
macgeargear Jan 4, 2024
0d90a6b
chore
macgeargear Jan 4, 2024
709b93e
feat: docs
macgeargear Jan 4, 2024
29a9d9e
Merge branch 'dev' into feature/pet
macgeargear Jan 4, 2024
d3e5d4d
fest: add adopt field
macgeargear Jan 4, 2024
025e1b8
chore: update image proto
macgeargear Jan 4, 2024
a6514ef
chore: add adopt to test
macgeargear Jan 4, 2024
bf12a40
chore: add AdoptMock
macgeargear Jan 4, 2024
b910180
chore
macgeargear Jan 4, 2024
51bbb97
feat: adopt service
macgeargear Jan 4, 2024
4483249
chore: fix import
macgeargear Jan 4, 2024
42b9077
chore: update image proto
macgeargear Jan 4, 2024
649495c
chore
macgeargear Jan 4, 2024
09c4a9f
chore: fix docs
macgeargear Jan 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ server:
mock-gen:
mockgen -source ./src/pkg/service/auth/auth.service.go -destination ./src/mocks/service/auth/auth.mock.go
mockgen -source ./src/pkg/service/user/user.service.go -destination ./src/mocks/service/user/user.mock.go
mockgen -source ./src/pkg/service/pet/pet.service.go -destination ./src/mocks/service/pet/pet.mock.go
mockgen -source ./src/pkg/service/image/image.service.go -destination ./src/mocks/service/image/image.mock.go
mockgen -source ./src/app/validator/validator.go -destination ./src/mocks/validator/validator.mock.go
mockgen -source ./src/app/router/context.go -destination ./src/mocks/router/context.mock.go

Expand Down
11 changes: 4 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,33 @@ go 1.21.3

require (
github.com/arsmn/fiber-swagger/v2 v2.31.1
github.com/bxcodec/faker/v4 v4.0.0-beta.3
github.com/go-faker/faker/v4 v4.2.0
github.com/go-playground/locales v0.14.1
github.com/go-playground/universal-translator v0.18.1
github.com/go-playground/validator/v10 v10.16.0
github.com/gofiber/fiber/v2 v2.51.0
github.com/golang/mock v1.6.0
github.com/google/uuid v1.5.0
github.com/isd-sgcu/johnjud-go-proto v0.2.2
github.com/pkg/errors v0.9.1
github.com/rs/zerolog v1.31.0
github.com/spf13/viper v1.18.2
github.com/stretchr/testify v1.8.4
github.com/swaggo/swag v1.16.2
google.golang.org/grpc v1.60.1
)

require (
github.com/KyleBanks/depth v1.2.1 // indirect
github.com/PuerkitoBio/purell v1.2.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/andybalholm/brotli v1.0.5 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/go-faker/faker/v4 v4.2.0 // indirect
github.com/go-openapi/jsonpointer v0.20.2 // indirect
github.com/go-openapi/jsonreference v0.20.4 // indirect
github.com/go-openapi/spec v0.20.13 // indirect
github.com/go-openapi/swag v0.22.6 // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
Expand All @@ -54,22 +54,19 @@ require (
github.com/stretchr/objx v0.5.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/swaggo/files v0.0.0-20210815190702-a29dd2bc99b2 // indirect
github.com/swaggo/swag v1.16.2 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasthttp v1.50.0 // indirect
github.com/valyala/tcplisten v1.0.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/crypto v0.16.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.16.1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect
google.golang.org/protobuf v1.32.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
32 changes: 7 additions & 25 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc=
github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE=
github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/purell v1.2.1 h1:QsZ4TjvwiMpat6gBCBxEQI0rcS9ehtkKtSpiUnd9N28=
github.com/PuerkitoBio/purell v1.2.1/go.mod h1:ZwHcC/82TOaovDi//J/804umJFFmbOHPngi8iYYv/Eo=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/agiledragon/gomonkey/v2 v2.3.1 h1:k+UnUY0EMNYUFUAQVETGY9uUTxjMdnUkP0ARyJS1zzs=
github.com/agiledragon/gomonkey/v2 v2.3.1/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY=
github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs=
github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/arsmn/fiber-swagger/v2 v2.31.1 h1:VmX+flXiGGNqLX3loMEEzL3BMOZFSPwBEWR04GA6Mco=
github.com/arsmn/fiber-swagger/v2 v2.31.1/go.mod h1:ZHhMprtB3M6jd2mleG03lPGhHH0lk9u3PtfWS1cBhMA=
github.com/bxcodec/faker/v4 v4.0.0-beta.3 h1:gqYNBvN72QtzKkYohNDKQlm+pg+uwBDVMN28nWHS18k=
github.com/bxcodec/faker/v4 v4.0.0-beta.3/go.mod h1:m6+Ch1Lj3fqW/unZmvkXIdxWS5+XQWPWxcbbQW2X+Ho=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
Expand All @@ -31,20 +28,16 @@ github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeME
github.com/go-faker/faker/v4 v4.2.0 h1:dGebOupKwssrODV51E0zbMrv5e2gO9VWSLNC1WDCpWg=
github.com/go-faker/faker/v4 v4.2.0/go.mod h1:F/bBy8GH9NxOxMInug5Gx4WYeG6fHJZ8Ol/dhcpRub4=
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY=
github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q=
github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs=
github.com/go-openapi/jsonreference v0.19.6 h1:UBIxjkht+AWIgYzCDSv2GN+E/togfwXUJFRTWhl2Jjs=
github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns=
github.com/go-openapi/jsonreference v0.20.4 h1:bKlDxQxQJgwpUSgOENiMPzCTBVuc7vTdXSSgNeAhojU=
github.com/go-openapi/jsonreference v0.20.4/go.mod h1:5pZJyJP2MnYCpoeoMAql78cCHauHj0V9Lhc506VOpw4=
github.com/go-openapi/spec v0.20.4 h1:O8hJrt0UMnhHcluhIdUgCLRWyM2x7QkBXRvOs7m+O1M=
github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I=
github.com/go-openapi/spec v0.20.13 h1:XJDIN+dLH6vqXgafnl5SUIMnzaChQ6QTo0/UPMbkIaE=
github.com/go-openapi/spec v0.20.13/go.mod h1:8EOhTpBoFiask8rrgwbLC3zmJfz4zsCUueRuPM6GNkw=
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-openapi/swag v0.19.15 h1:D2NRCBzS9/pEY3gP9Nl8aDqGUcPFrwG2p+CNFrLyrCM=
github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
github.com/go-openapi/swag v0.22.6 h1:dnqg1XfHXL9aBxSbktBqFR5CxVyVI+7fYWhAf1JOeTw=
github.com/go-openapi/swag v0.22.6/go.mod h1:Gl91UqO+btAM0plGGxHqJcQZ1ZTy6jbmridBTsDy8A0=
Expand Down Expand Up @@ -73,8 +66,6 @@ github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/isd-sgcu/johnjud-go-proto v0.0.8 h1:nIQBZgK2OFVrLjVtpeDgwows8poA7LhsIVE4hlbBC1o=
github.com/isd-sgcu/johnjud-go-proto v0.0.8/go.mod h1:HP0w9gC30b5WNnqeFBM9JJZud+pvyikz0+pGFSI/Wjw=
github.com/isd-sgcu/johnjud-go-proto v0.2.2 h1:TOAmbwy/I+8/J5LPZH0ZN7lSLczBiZe1fs88gH8XrhY=
github.com/isd-sgcu/johnjud-go-proto v0.2.2/go.mod h1:1OK6aiCgtXQiLhxp0r6iLEejYIRpckWQZDrCZ9Trbo4=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
Expand All @@ -96,7 +87,6 @@ github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0V
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA=
github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
Expand All @@ -110,9 +100,7 @@ github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZ
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/otiai10/copy v1.7.0 h1:hVoPiN+t+7d2nzzwMiDHPSOogsWAStewq3TwU05+clE=
github.com/otiai10/copy v1.7.0/go.mod h1:rmRl6QPdJj6EiUqXQ/4Nn2lLXoNQjFCQbbNrxgc/t3U=
github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE=
github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs=
Expand All @@ -127,8 +115,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A=
github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
Expand Down Expand Up @@ -166,7 +154,6 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/swaggo/files v0.0.0-20210815190702-a29dd2bc99b2 h1:+iNTcqQJy0OZ5jk6a5NLib47eqXK8uYcPX+O4+cBpEM=
github.com/swaggo/files v0.0.0-20210815190702-a29dd2bc99b2/go.mod h1:lKJPbtWzJ9JhsTN1k1gZgleJWY/cqq0psdoMmaThG3w=
github.com/swaggo/swag v1.8.1 h1:JuARzFX1Z1njbCGz+ZytBR15TFJwF2Q7fu8puJHhQYI=
github.com/swaggo/swag v1.8.1/go.mod h1:ugemnJsPZm/kRwFUnzBlbHRd0JY9zE1M4F+uy2pAaPQ=
github.com/swaggo/swag v1.16.2 h1:28Pp+8DkQoV+HLzLx8RGJZXNGKbFqnuvSbAAtoxiY04=
github.com/swaggo/swag v1.16.2/go.mod h1:6YzXnDcpr0767iOejs318CwYkCQqyGer6BizOg03f+E=
Expand All @@ -192,8 +179,7 @@ golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g=
golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
Expand Down Expand Up @@ -236,8 +222,6 @@ golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo=
golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ=
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA=
golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand All @@ -250,19 +234,17 @@ google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU=
google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Expand Down
3 changes: 3 additions & 0 deletions src/app/constant/error.constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ const IncorrectEmailPasswordMessage = "Incorrect Email or Password"
const DuplicateEmailMessage = "Duplicate Email"
const InternalErrorMessage = "Internal Error"
const UnavailableServiceMessage = "Unavailable Service"

const PetNotFoundMessage = "Pet not found"
const InvalidArgument = "Invalid Argument"
26 changes: 22 additions & 4 deletions src/app/dto/pet.dto.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
)

type PetDto struct {
Id string `json:"id"`
Type string `json:"type" validate:"required"`
Species string `json:"species" validate:"required"`
Name string `json:"name" validate:"required"`
Expand All @@ -13,11 +14,28 @@ type PetDto struct {
Habit string `json:"habit" validate:"required"`
Caption string `json:"caption"`
Status pet.Status `json:"status" validate:"required" example:"findhome"`
IsSterile bool `json:"is_sterile" validate:"required"`
IsVaccinated bool `json:"is_vaccine" validate:"required"`
IsVisible bool `json:"is_visible" validate:"required"`
IsClubPet bool `json:"is_club_pet" validate:"required"`
IsSterile *bool `json:"is_sterile" validate:"required"`
IsVaccinated *bool `json:"is_vaccinated" validate:"required"`
IsVisible *bool `json:"is_visible" validate:"required"`
IsClubPet *bool `json:"is_club_pet" validate:"required"`
Background string `json:"background"`
Address string `json:"address"`
Contact string `json:"contact"`
AdoptBy string `json:"adopt_by"`
}

type CreatePetRequest struct {
Pet *PetDto `json:"pet" validate:"required"`
}

type ChangeViewPetRequest struct {
Visible bool `json:"visible" validate:"required"`
}

type UpdatePetRequest struct {
Pet *PetDto `json:"pet" validate:"required"`
}

type DeleteRequest struct {
Id string `json:"id" validate:"required"`
}
2 changes: 1 addition & 1 deletion src/app/handler/image/image.handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type Handler struct {
}

type Service interface {
FindByPetId() ([]*proto.Image, *dto.ResponseErr)
FindByPetId(string) ([]*proto.Image, *dto.ResponseErr)
Upload(*dto.ImageDto) (*proto.Image, *dto.ResponseErr)
Delete(string) (bool, *dto.ResponseErr)
}
Expand Down
Loading
Loading