From 5204ac5c831b33ae9b19a0fe0c25a1f1c4285427 Mon Sep 17 00:00:00 2001 From: Alireza Mokhtari G Date: Wed, 20 Dec 2023 12:11:50 +0330 Subject: [PATCH 1/2] fix(service) divide domain name for each service and some note added --- param/kind_box/add.go | 1 + service/kind_box/delete.go | 3 ++- service/kind_box/get_all.go | 1 + service/kind_box/get_by_id.go | 1 + service/kind_box/update.go | 1 + service/kind_box_req/add.go | 2 +- service/kind_box_req/delete.go | 3 ++- service/kind_box_req/get_all.go | 3 ++- service/kind_box_req/get_by_id.go | 3 ++- service/kind_box_req/service.go | 2 +- service/kind_box_req/update.go | 3 ++- 11 files changed, 16 insertions(+), 7 deletions(-) diff --git a/param/kind_box/add.go b/param/kind_box/add.go index 3489d45..c636d5d 100644 --- a/param/kind_box/add.go +++ b/param/kind_box/add.go @@ -7,4 +7,5 @@ type KindBoxAddRequest struct { } type KindBoxAddResponse struct { + KindBox entity.KindBox } diff --git a/service/kind_box/delete.go b/service/kind_box/delete.go index c7502d7..a81829b 100644 --- a/service/kind_box/delete.go +++ b/service/kind_box/delete.go @@ -2,6 +2,7 @@ package kindboxservice import param "git.gocasts.ir/ebhomengo/niki/param/kind_box" -func (s Service) Delete(kindBoxId param.KindBoxDeleteRequest) error { +func (s Service) Delete(param.KindBoxDeleteRequest) error { + // some code panic("not implemented") } diff --git a/service/kind_box/get_all.go b/service/kind_box/get_all.go index 77a5556..72a8cda 100644 --- a/service/kind_box/get_all.go +++ b/service/kind_box/get_all.go @@ -3,5 +3,6 @@ package kindboxservice import param "git.gocasts.ir/ebhomengo/niki/param/kind_box" func (s Service) GetAll() (param.KindBoxGetAllResponse, error) { + // some code panic("not implement") } diff --git a/service/kind_box/get_by_id.go b/service/kind_box/get_by_id.go index 002d4b9..e7c8a82 100644 --- a/service/kind_box/get_by_id.go +++ b/service/kind_box/get_by_id.go @@ -3,5 +3,6 @@ package kindboxservice import param "git.gocasts.ir/ebhomengo/niki/param/kind_box" func (s Service) GetById(request param.KindBoxGetByIdRequest) (param.KindBoxGetByIdResponse, error) { + // some code panic("not implement") } diff --git a/service/kind_box/update.go b/service/kind_box/update.go index 50a012d..89b78f5 100644 --- a/service/kind_box/update.go +++ b/service/kind_box/update.go @@ -5,5 +5,6 @@ import ( ) func (s Service) Update(updatedKindBox param.KindBoxUpdateRequest) (param.KindBoxUpdateResponse, error) { + // some code panic("not implement") } diff --git a/service/kind_box_req/add.go b/service/kind_box_req/add.go index 5bd5bc3..5f29a56 100644 --- a/service/kind_box_req/add.go +++ b/service/kind_box_req/add.go @@ -1,4 +1,4 @@ -package kindboxservice +package kindboxreqservice import ( param "git.gocasts.ir/ebhomengo/niki/param/kind_box_req" diff --git a/service/kind_box_req/delete.go b/service/kind_box_req/delete.go index bb97591..ac2aae9 100644 --- a/service/kind_box_req/delete.go +++ b/service/kind_box_req/delete.go @@ -1,7 +1,8 @@ -package kindboxservice +package kindboxreqservice import param "git.gocasts.ir/ebhomengo/niki/param/kind_box_req" func (s Service) Delete(kindBoxReqId param.KindBoxReqDeleteRequest) error { + // some code panic("not implemented") } diff --git a/service/kind_box_req/get_all.go b/service/kind_box_req/get_all.go index 1219392..adaac16 100644 --- a/service/kind_box_req/get_all.go +++ b/service/kind_box_req/get_all.go @@ -1,7 +1,8 @@ -package kindboxservice +package kindboxreqservice import param "git.gocasts.ir/ebhomengo/niki/param/kind_box_req" func (s Service) GetAll() (param.KindBoxReqGetAllResponse, error) { + // some code panic("not implement") } diff --git a/service/kind_box_req/get_by_id.go b/service/kind_box_req/get_by_id.go index f7429a1..24dd6da 100644 --- a/service/kind_box_req/get_by_id.go +++ b/service/kind_box_req/get_by_id.go @@ -1,7 +1,8 @@ -package kindboxservice +package kindboxreqservice import param "git.gocasts.ir/ebhomengo/niki/param/kind_box_req" func (s Service) GetById(request param.KindBoxReqGetByIdRequest) (param.KindBoxReqGetByIdResponse, error) { + // some code panic("not implement") } diff --git a/service/kind_box_req/service.go b/service/kind_box_req/service.go index 488f705..654f021 100644 --- a/service/kind_box_req/service.go +++ b/service/kind_box_req/service.go @@ -1,4 +1,4 @@ -package kindboxservice +package kindboxreqservice import "git.gocasts.ir/ebhomengo/niki/entity" diff --git a/service/kind_box_req/update.go b/service/kind_box_req/update.go index db462a2..b5026bd 100644 --- a/service/kind_box_req/update.go +++ b/service/kind_box_req/update.go @@ -1,9 +1,10 @@ -package kindboxservice +package kindboxreqservice import ( param "git.gocasts.ir/ebhomengo/niki/param/kind_box_req" ) func (s Service) Update(updatedKindBoxReq param.KindBoxReqUpdateRequest) (param.KindBoxReqUpdateResponse, error) { + // some code panic("not implement") } From b2337b621dd82399b2d9419309a8fa4bf915c385 Mon Sep 17 00:00:00 2001 From: imirazimi Date: Wed, 20 Dec 2023 12:17:03 +0330 Subject: [PATCH 2/2] fix(niki): update folder structure --- cmd/.gitkeep | 0 delivery/{httpserver => http_server}/server.go | 2 +- repository/mysql/{mysqlpiggybank => mysql_kind_box}/db.go | 4 ++-- repository/mysql/mysql_kind_box/kind_box.go | 1 + repository/mysql/mysqlpiggybank/piggy_bank.go | 1 - 5 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 cmd/.gitkeep rename delivery/{httpserver => http_server}/server.go (99%) rename repository/mysql/{mysqlpiggybank => mysql_kind_box}/db.go (85%) create mode 100644 repository/mysql/mysql_kind_box/kind_box.go delete mode 100644 repository/mysql/mysqlpiggybank/piggy_bank.go diff --git a/cmd/.gitkeep b/cmd/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/delivery/httpserver/server.go b/delivery/http_server/server.go similarity index 99% rename from delivery/httpserver/server.go rename to delivery/http_server/server.go index 5a120cb..60665b5 100644 --- a/delivery/httpserver/server.go +++ b/delivery/http_server/server.go @@ -14,4 +14,4 @@ func New(config config.Config) Server { func (s Server) Serve() { -} +} \ No newline at end of file diff --git a/repository/mysql/mysqlpiggybank/db.go b/repository/mysql/mysql_kind_box/db.go similarity index 85% rename from repository/mysql/mysqlpiggybank/db.go rename to repository/mysql/mysql_kind_box/db.go index 63819c1..911cc8a 100644 --- a/repository/mysql/mysqlpiggybank/db.go +++ b/repository/mysql/mysql_kind_box/db.go @@ -1,4 +1,4 @@ -package mysqlkindBoxbank +package mysqlkindbox import "git.gocasts.ir/ebhomengo/niki/repository/mysql" @@ -10,4 +10,4 @@ func New(conn *mysql.MySQLDB) *DB { return &DB{ conn: conn, } -} +} \ No newline at end of file diff --git a/repository/mysql/mysql_kind_box/kind_box.go b/repository/mysql/mysql_kind_box/kind_box.go new file mode 100644 index 0000000..1100ef3 --- /dev/null +++ b/repository/mysql/mysql_kind_box/kind_box.go @@ -0,0 +1 @@ +package mysqlkindbox \ No newline at end of file diff --git a/repository/mysql/mysqlpiggybank/piggy_bank.go b/repository/mysql/mysqlpiggybank/piggy_bank.go deleted file mode 100644 index dd76f52..0000000 --- a/repository/mysql/mysqlpiggybank/piggy_bank.go +++ /dev/null @@ -1 +0,0 @@ -package mysqlkindBoxbank