Skip to content

Commit 630eceb

Browse files
committed
update article service
1 parent 4f5dd4c commit 630eceb

File tree

7 files changed

+290
-78
lines changed

7 files changed

+290
-78
lines changed

app/module/article/controller/article_controller_mock.go

Lines changed: 63 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/module/article/repository/article_repository_mock.go

Lines changed: 107 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/module/article/service/article_service.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ type ArticleService struct {
1111
Repo *repository.ArticleRepository
1212
}
1313

14-
// define interface of ArticleService
14+
//go:generate mockgen -destination=article_service_mock.go -package=service . IArticleService
15+
// define interface of IArticleService
1516
type IArticleService interface {
1617
All() (articles []*response.Article, err error)
1718
Show(id uint64) (article *response.Article, err error)

app/module/article/service/article_service_mock.go

Lines changed: 108 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/example/generate.go

Lines changed: 0 additions & 3 deletions
This file was deleted.

go.mod

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ module github.com/bangadam/go-fiber-starter
33
go 1.18
44

55
require (
6-
entgo.io/ent v0.11.2
76
github.com/efectn/fx-zerolog v1.1.0
87
github.com/go-playground/locales v0.14.0
98
github.com/go-playground/universal-translator v0.18.0
@@ -13,64 +12,57 @@ require (
1312
github.com/gofiber/jwt/v2 v2.2.7
1413
github.com/gofiber/swagger v0.1.0
1514
github.com/golang/mock v1.6.0
16-
github.com/jackc/pgx/v4 v4.17.0
1715
github.com/pelletier/go-toml/v2 v2.0.2
1816
github.com/rs/zerolog v1.27.0
1917
github.com/swaggo/swag v1.8.4
2018
go.uber.org/automaxprocs v1.5.1
2119
go.uber.org/fx v1.18.1
20+
gorm.io/driver/postgres v1.3.9
21+
gorm.io/gorm v1.23.8
2222
)
2323

2424
require (
25-
ariga.io/atlas v0.5.1-0.20220717122844-8593d7eb1a8e // indirect
2625
github.com/KyleBanks/depth v1.2.1 // indirect
27-
github.com/agext/levenshtein v1.2.1 // indirect
2826
github.com/andybalholm/brotli v1.0.4 // indirect
29-
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
30-
github.com/go-openapi/inflect v0.19.0 // indirect
27+
github.com/davecgh/go-spew v1.1.1 // indirect
3128
github.com/go-openapi/jsonpointer v0.19.5 // indirect
3229
github.com/go-openapi/jsonreference v0.20.0 // indirect
3330
github.com/go-openapi/spec v0.20.7 // indirect
3431
github.com/go-openapi/swag v0.22.3 // indirect
3532
github.com/golang-jwt/jwt/v4 v4.0.0 // indirect
36-
github.com/google/go-cmp v0.5.6 // indirect
37-
github.com/google/uuid v1.3.0 // indirect
38-
github.com/hashicorp/hcl/v2 v2.10.0 // indirect
3933
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
4034
github.com/jackc/pgconn v1.13.0 // indirect
4135
github.com/jackc/pgio v1.0.0 // indirect
4236
github.com/jackc/pgpassfile v1.0.0 // indirect
4337
github.com/jackc/pgproto3/v2 v2.3.1 // indirect
4438
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
4539
github.com/jackc/pgtype v1.12.0 // indirect
40+
github.com/jackc/pgx/v4 v4.17.0 // indirect
4641
github.com/jinzhu/inflection v1.0.0 // indirect
4742
github.com/jinzhu/now v1.1.5 // indirect
4843
github.com/josharian/intern v1.0.0 // indirect
4944
github.com/klauspost/compress v1.15.9 // indirect
5045
github.com/leodido/go-urn v1.2.1 // indirect
46+
github.com/lib/pq v1.10.5 // indirect
5147
github.com/mailru/easyjson v0.7.7 // indirect
5248
github.com/mattn/go-colorable v0.1.12 // indirect
5349
github.com/mattn/go-isatty v0.0.14 // indirect
54-
github.com/mattn/go-sqlite3 v1.14.15 // indirect
55-
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 // indirect
50+
github.com/pmezard/go-difflib v1.0.0 // indirect
51+
github.com/stretchr/objx v0.4.0 // indirect
52+
github.com/stretchr/testify v1.8.0 // indirect
5653
github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a // indirect
5754
github.com/valyala/bytebufferpool v1.0.0 // indirect
5855
github.com/valyala/fasthttp v1.39.0 // indirect
5956
github.com/valyala/tcplisten v1.0.0 // indirect
60-
github.com/zclconf/go-cty v1.8.0 // indirect
6157
go.uber.org/atomic v1.6.0 // indirect
6258
go.uber.org/dig v1.15.0 // indirect
6359
go.uber.org/multierr v1.5.0 // indirect
6460
go.uber.org/zap v1.16.0 // indirect
6561
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect
66-
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
6762
golang.org/x/net v0.0.0-20220812174116-3211cb980234 // indirect
6863
golang.org/x/sys v0.0.0-20220817070843-5a390386f1f2 // indirect
6964
golang.org/x/text v0.3.7 // indirect
7065
golang.org/x/tools v0.1.13-0.20220804200503-81c7dc4e4efa // indirect
7166
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
7267
gopkg.in/yaml.v3 v3.0.1 // indirect
73-
gorm.io/driver/postgres v1.3.9 // indirect
74-
gorm.io/driver/sqlite v1.3.6 // indirect
75-
gorm.io/gorm v1.23.8 // indirect
7668
)

0 commit comments

Comments
 (0)