From c7debfefc6427d9fb1709c52e24651e280b66cde Mon Sep 17 00:00:00 2001 From: Alireza Mokhtari G Date: Wed, 20 Dec 2023 11:57:13 +0330 Subject: [PATCH] feat(niki): new folder( tructure for developing branch --- cmd/httpserver/main.go | 5 ----- config/README.md | 4 ++-- entity/{piggy_bank.go => kind_box.go} | 4 ++-- entity/kind_box_req.go | 14 +++++++++++++ entity/reqkindbox.go | 12 ----------- param/kind_box/add.go | 10 +++++++++ param/kind_box/delete.go | 8 +++++++ param/kind_box/get_all.go | 10 +++++++++ param/kind_box/get_by_id.go | 11 ++++++++++ param/kind_box/update.go | 11 ++++++++++ param/kind_box_req/add.go | 11 ++++++++++ param/kind_box_req/delete.go | 8 +++++++ param/kind_box_req/get_all.go | 10 +++++++++ param/kind_box_req/get_by_id.go | 11 ++++++++++ param/kind_box_req/update.go | 11 ++++++++++ param/piggy_bank_delete.go | 7 ------- param/piggy_bank_get_all.go | 7 ------- param/piggy_bank_get_by_id.go | 7 ------- param/piggy_bank_store.go | 7 ------- param/piggy_bank_update.go | 7 ------- param/reqkindbox_delete.go | 8 ------- param/reqkindbox_get_all.go | 7 ------- param/reqkindbox_get_by_id.go | 8 ------- param/reqkindbox_store.go | 10 --------- param/reqkindbox_update.go | 11 ---------- repository/mysql/mysqlpiggybank/db.go | 2 +- repository/mysql/mysqlpiggybank/piggy_bank.go | 2 +- service/kind_box/add.go | 10 +++++++++ service/kind_box/delete.go | 7 +++++++ service/kind_box/get_all.go | 7 +++++++ service/kind_box/get_by_id.go | 7 +++++++ service/kind_box/service.go | 21 +++++++++++++++++++ service/kind_box/update.go | 9 ++++++++ service/kind_box_req/add.go | 10 +++++++++ service/kind_box_req/delete.go | 7 +++++++ service/kind_box_req/get_all.go | 7 +++++++ service/kind_box_req/get_by_id.go | 7 +++++++ service/kind_box_req/service.go | 21 +++++++++++++++++++ service/kind_box_req/update.go | 9 ++++++++ service/piggybankservice/delete.go | 7 ------- service/piggybankservice/get_all.go | 7 ------- service/piggybankservice/get_by_id.go | 7 ------- service/piggybankservice/service.go | 21 ------------------- service/piggybankservice/store.go | 7 ------- service/piggybankservice/update.go | 7 ------- service/reqkindboxservice/delete.go | 7 ------- service/reqkindboxservice/get_all.go | 7 ------- service/reqkindboxservice/get_by_id.go | 7 ------- service/reqkindboxservice/service.go | 21 ------------------- service/reqkindboxservice/store.go | 7 ------- service/reqkindboxservice/update.go | 7 ------- validator/piggybankvalidator/delete.go | 7 ------- validator/piggybankvalidator/get_by_id.go | 7 ------- validator/piggybankvalidator/store.go | 7 ------- validator/piggybankvalidator/update.go | 7 ------- validator/piggybankvalidator/validator.go | 12 ----------- 56 files changed, 243 insertions(+), 254 deletions(-) delete mode 100644 cmd/httpserver/main.go rename entity/{piggy_bank.go => kind_box.go} (78%) create mode 100644 entity/kind_box_req.go delete mode 100644 entity/reqkindbox.go create mode 100644 param/kind_box/add.go create mode 100644 param/kind_box/delete.go create mode 100644 param/kind_box/get_all.go create mode 100644 param/kind_box/get_by_id.go create mode 100644 param/kind_box/update.go create mode 100644 param/kind_box_req/add.go create mode 100644 param/kind_box_req/delete.go create mode 100644 param/kind_box_req/get_all.go create mode 100644 param/kind_box_req/get_by_id.go create mode 100644 param/kind_box_req/update.go delete mode 100644 param/piggy_bank_delete.go delete mode 100644 param/piggy_bank_get_all.go delete mode 100644 param/piggy_bank_get_by_id.go delete mode 100644 param/piggy_bank_store.go delete mode 100644 param/piggy_bank_update.go delete mode 100644 param/reqkindbox_delete.go delete mode 100644 param/reqkindbox_get_all.go delete mode 100644 param/reqkindbox_get_by_id.go delete mode 100644 param/reqkindbox_store.go delete mode 100644 param/reqkindbox_update.go create mode 100644 service/kind_box/add.go create mode 100644 service/kind_box/delete.go create mode 100644 service/kind_box/get_all.go create mode 100644 service/kind_box/get_by_id.go create mode 100644 service/kind_box/service.go create mode 100644 service/kind_box/update.go create mode 100644 service/kind_box_req/add.go create mode 100644 service/kind_box_req/delete.go create mode 100644 service/kind_box_req/get_all.go create mode 100644 service/kind_box_req/get_by_id.go create mode 100644 service/kind_box_req/service.go create mode 100644 service/kind_box_req/update.go delete mode 100644 service/piggybankservice/delete.go delete mode 100644 service/piggybankservice/get_all.go delete mode 100644 service/piggybankservice/get_by_id.go delete mode 100644 service/piggybankservice/service.go delete mode 100644 service/piggybankservice/store.go delete mode 100644 service/piggybankservice/update.go delete mode 100644 service/reqkindboxservice/delete.go delete mode 100644 service/reqkindboxservice/get_all.go delete mode 100644 service/reqkindboxservice/get_by_id.go delete mode 100644 service/reqkindboxservice/service.go delete mode 100644 service/reqkindboxservice/store.go delete mode 100644 service/reqkindboxservice/update.go delete mode 100644 validator/piggybankvalidator/delete.go delete mode 100644 validator/piggybankvalidator/get_by_id.go delete mode 100644 validator/piggybankvalidator/store.go delete mode 100644 validator/piggybankvalidator/update.go delete mode 100644 validator/piggybankvalidator/validator.go diff --git a/cmd/httpserver/main.go b/cmd/httpserver/main.go deleted file mode 100644 index 7905807..0000000 --- a/cmd/httpserver/main.go +++ /dev/null @@ -1,5 +0,0 @@ -package main - -func main() { - -} diff --git a/config/README.md b/config/README.md index 4bf6c26..282de18 100644 --- a/config/README.md +++ b/config/README.md @@ -35,7 +35,7 @@ os.Setenv("EB_MULTI_WORD_VAR", "this is a multi-word var") ### 2. Initialization from `config.yml` -💡 Store variables which are `dependant to the environment` that code is running or the area, the variables that `change more frequent`. +💡 Add variables which are `dependant to the environment` that code is running or the area, the variables that `change more frequent`. The package supports loading configurations from a YAML file named `config.yml`. Ensure the YAML file is in the correct format. @@ -51,7 +51,7 @@ db: ### 3. Default Settings via `Default()` -💡 Store variables which they have `the least probability of change`. +💡 Add variables which they have `the least probability of change`. The `Default()` function in the package allows defining default configurations that act as fallbacks. This function should return a `Config` struct. Example of defining default configurations: diff --git a/entity/piggy_bank.go b/entity/kind_box.go similarity index 78% rename from entity/piggy_bank.go rename to entity/kind_box.go index 9fe182c..9e12faf 100644 --- a/entity/piggy_bank.go +++ b/entity/kind_box.go @@ -2,10 +2,10 @@ package entity import "time" -type PiggyBank struct { +type KindBox struct { ID uint TotalAmount uint - RecieverId uint + ReceiverId uint SenderId uint SerialNumber string Status uint diff --git a/entity/kind_box_req.go b/entity/kind_box_req.go new file mode 100644 index 0000000..a17ed31 --- /dev/null +++ b/entity/kind_box_req.go @@ -0,0 +1,14 @@ +package entity + +import "time" + +type KindBoxReq struct { + ID uint + TypeId uint + CountRequested uint + CountAccepted uint + BenefactorID uint + Status uint + Description string + StatusChangedAt *time.Time +} diff --git a/entity/reqkindbox.go b/entity/reqkindbox.go deleted file mode 100644 index cdce92e..0000000 --- a/entity/reqkindbox.go +++ /dev/null @@ -1,12 +0,0 @@ -package entity - -type ReqKindBox struct { - ID uint - TypeId uint - CountRequested uint - CountAccepted uint - NikokarId uint - Status uint - Description string - StatusChangedAt *time.Time -} diff --git a/param/kind_box/add.go b/param/kind_box/add.go new file mode 100644 index 0000000..3489d45 --- /dev/null +++ b/param/kind_box/add.go @@ -0,0 +1,10 @@ +package param + +import "git.gocasts.ir/ebhomengo/niki/entity" + +type KindBoxAddRequest struct { + KindBox entity.KindBox +} + +type KindBoxAddResponse struct { +} diff --git a/param/kind_box/delete.go b/param/kind_box/delete.go new file mode 100644 index 0000000..b7dda5a --- /dev/null +++ b/param/kind_box/delete.go @@ -0,0 +1,8 @@ +package param + +type KindBoxDeleteRequest struct { + kindBoxID uint +} + +type KindBoxDeleteResponse struct { +} diff --git a/param/kind_box/get_all.go b/param/kind_box/get_all.go new file mode 100644 index 0000000..3c03f4a --- /dev/null +++ b/param/kind_box/get_all.go @@ -0,0 +1,10 @@ +package param + +import "git.gocasts.ir/ebhomengo/niki/entity" + +type KindBoxGetAllRequest struct { +} + +type KindBoxGetAllResponse struct { + AllKindBox []entity.KindBox +} diff --git a/param/kind_box/get_by_id.go b/param/kind_box/get_by_id.go new file mode 100644 index 0000000..c187af1 --- /dev/null +++ b/param/kind_box/get_by_id.go @@ -0,0 +1,11 @@ +package param + +import "git.gocasts.ir/ebhomengo/niki/entity" + +type KindBoxGetByIdRequest struct { + kindBoxID uint +} + +type KindBoxGetByIdResponse struct { + entity.KindBox +} diff --git a/param/kind_box/update.go b/param/kind_box/update.go new file mode 100644 index 0000000..945adfa --- /dev/null +++ b/param/kind_box/update.go @@ -0,0 +1,11 @@ +package param + +import "git.gocasts.ir/ebhomengo/niki/entity" + +type KindBoxUpdateRequest struct { + KindBox entity.KindBox +} + +type KindBoxUpdateResponse struct { + KindBox entity.KindBox +} diff --git a/param/kind_box_req/add.go b/param/kind_box_req/add.go new file mode 100644 index 0000000..bdaeb93 --- /dev/null +++ b/param/kind_box_req/add.go @@ -0,0 +1,11 @@ +package param + +import "git.gocasts.ir/ebhomengo/niki/entity" + +type KindBoxReqAddRequest struct { + KindBoxReq entity.KindBoxReq +} + +type KindBoxReqAddResponse struct { + KindBoxReq entity.KindBoxReq +} diff --git a/param/kind_box_req/delete.go b/param/kind_box_req/delete.go new file mode 100644 index 0000000..cc03fca --- /dev/null +++ b/param/kind_box_req/delete.go @@ -0,0 +1,8 @@ +package param + +type KindBoxReqDeleteRequest struct { + kindBoxID uint +} + +type KindBoxReqDeleteResponse struct { +} diff --git a/param/kind_box_req/get_all.go b/param/kind_box_req/get_all.go new file mode 100644 index 0000000..8bf020a --- /dev/null +++ b/param/kind_box_req/get_all.go @@ -0,0 +1,10 @@ +package param + +import "git.gocasts.ir/ebhomengo/niki/entity" + +type KindBoxReqGetAllRequest struct { +} + +type KindBoxReqGetAllResponse struct { + AllKindBoxReq []entity.KindBoxReq +} diff --git a/param/kind_box_req/get_by_id.go b/param/kind_box_req/get_by_id.go new file mode 100644 index 0000000..c3617e2 --- /dev/null +++ b/param/kind_box_req/get_by_id.go @@ -0,0 +1,11 @@ +package param + +import "git.gocasts.ir/ebhomengo/niki/entity" + +type KindBoxReqGetByIdRequest struct { + KindBoxReqID uint +} + +type KindBoxReqGetByIdResponse struct { + entity.KindBoxReq +} diff --git a/param/kind_box_req/update.go b/param/kind_box_req/update.go new file mode 100644 index 0000000..124569e --- /dev/null +++ b/param/kind_box_req/update.go @@ -0,0 +1,11 @@ +package param + +import "git.gocasts.ir/ebhomengo/niki/entity" + +type KindBoxReqUpdateRequest struct { + KindBoxReq entity.KindBoxReq +} + +type KindBoxReqUpdateResponse struct { + KindBoxReq entity.KindBoxReq +} diff --git a/param/piggy_bank_delete.go b/param/piggy_bank_delete.go deleted file mode 100644 index e98f3a4..0000000 --- a/param/piggy_bank_delete.go +++ /dev/null @@ -1,7 +0,0 @@ -package param - -type PiggyBankDeleteRequest struct { -} - -type PiggyBankDeleteResponse struct { -} diff --git a/param/piggy_bank_get_all.go b/param/piggy_bank_get_all.go deleted file mode 100644 index 0316933..0000000 --- a/param/piggy_bank_get_all.go +++ /dev/null @@ -1,7 +0,0 @@ -package param - -type PiggyBankGetAllRequest struct { -} - -type PiggyBankGetAllResponse struct { -} diff --git a/param/piggy_bank_get_by_id.go b/param/piggy_bank_get_by_id.go deleted file mode 100644 index fd00b67..0000000 --- a/param/piggy_bank_get_by_id.go +++ /dev/null @@ -1,7 +0,0 @@ -package param - -type PiggyBankGetByIdRequest struct { -} - -type PiggyBankGetByIdResponse struct { -} diff --git a/param/piggy_bank_store.go b/param/piggy_bank_store.go deleted file mode 100644 index 87a1e7f..0000000 --- a/param/piggy_bank_store.go +++ /dev/null @@ -1,7 +0,0 @@ -package param - -type PiggyBankStoreRequest struct { -} - -type PiggyBankStoreResponse struct { -} diff --git a/param/piggy_bank_update.go b/param/piggy_bank_update.go deleted file mode 100644 index 226e0a8..0000000 --- a/param/piggy_bank_update.go +++ /dev/null @@ -1,7 +0,0 @@ -package param - -type PiggyBankUpdateRequest struct { -} - -type PiggyBankUpdateResponse struct { -} diff --git a/param/reqkindbox_delete.go b/param/reqkindbox_delete.go deleted file mode 100644 index 9273ee9..0000000 --- a/param/reqkindbox_delete.go +++ /dev/null @@ -1,8 +0,0 @@ -package param - -type ReqKindBoxDeleteRequest struct { - reqKindBoxID uint -} - -type ReqKindBoxDeleteResponse struct { -} diff --git a/param/reqkindbox_get_all.go b/param/reqkindbox_get_all.go deleted file mode 100644 index 9d20188..0000000 --- a/param/reqkindbox_get_all.go +++ /dev/null @@ -1,7 +0,0 @@ -package param - -type ReqKindBoxGetAllRequest struct { -} - -type ReqKindBoxGetAllResponse struct { -} diff --git a/param/reqkindbox_get_by_id.go b/param/reqkindbox_get_by_id.go deleted file mode 100644 index 11e5a8b..0000000 --- a/param/reqkindbox_get_by_id.go +++ /dev/null @@ -1,8 +0,0 @@ -package param - -type ReqKindBoxGetByIdRequest struct { - reqKindBoxID uint -} - -type ReqKindBoxGetByIdResponse struct { -} diff --git a/param/reqkindbox_store.go b/param/reqkindbox_store.go deleted file mode 100644 index 381ec74..0000000 --- a/param/reqkindbox_store.go +++ /dev/null @@ -1,10 +0,0 @@ -package param - -import "git.gocasts.ir/ebhomengo/niki/entity" - -type ReqKindBoxStoreRequest struct { - reqKindBox entity.ReqKindBox -} - -type ReqKindBoxStoreResponse struct { -} diff --git a/param/reqkindbox_update.go b/param/reqkindbox_update.go deleted file mode 100644 index e1bfaf8..0000000 --- a/param/reqkindbox_update.go +++ /dev/null @@ -1,11 +0,0 @@ -package param - -import "git.gocasts.ir/ebhomengo/niki/entity" - -type ReqKindBoxUpdateRequest struct { - reqKindBoxID uint - reqKindBox entity.ReqKindBox -} - -type ReqKindBoxUpdateResponse struct { -} diff --git a/repository/mysql/mysqlpiggybank/db.go b/repository/mysql/mysqlpiggybank/db.go index 2e7040a..63819c1 100644 --- a/repository/mysql/mysqlpiggybank/db.go +++ b/repository/mysql/mysqlpiggybank/db.go @@ -1,4 +1,4 @@ -package mysqlpiggybank +package mysqlkindBoxbank import "git.gocasts.ir/ebhomengo/niki/repository/mysql" diff --git a/repository/mysql/mysqlpiggybank/piggy_bank.go b/repository/mysql/mysqlpiggybank/piggy_bank.go index d9fa118..dd76f52 100644 --- a/repository/mysql/mysqlpiggybank/piggy_bank.go +++ b/repository/mysql/mysqlpiggybank/piggy_bank.go @@ -1 +1 @@ -package mysqlpiggybank +package mysqlkindBoxbank diff --git a/service/kind_box/add.go b/service/kind_box/add.go new file mode 100644 index 0000000..0aaf045 --- /dev/null +++ b/service/kind_box/add.go @@ -0,0 +1,10 @@ +package kindboxservice + +import ( + param "git.gocasts.ir/ebhomengo/niki/param/kind_box" +) + +func (s Service) Add(newKindBoxReq param.KindBoxAddRequest) (param.KindBoxAddResponse, error) { + // some code + panic("not implemented") +} diff --git a/service/kind_box/delete.go b/service/kind_box/delete.go new file mode 100644 index 0000000..c7502d7 --- /dev/null +++ b/service/kind_box/delete.go @@ -0,0 +1,7 @@ +package kindboxservice + +import param "git.gocasts.ir/ebhomengo/niki/param/kind_box" + +func (s Service) Delete(kindBoxId param.KindBoxDeleteRequest) error { + panic("not implemented") +} diff --git a/service/kind_box/get_all.go b/service/kind_box/get_all.go new file mode 100644 index 0000000..77a5556 --- /dev/null +++ b/service/kind_box/get_all.go @@ -0,0 +1,7 @@ +package kindboxservice + +import param "git.gocasts.ir/ebhomengo/niki/param/kind_box" + +func (s Service) GetAll() (param.KindBoxGetAllResponse, error) { + panic("not implement") +} diff --git a/service/kind_box/get_by_id.go b/service/kind_box/get_by_id.go new file mode 100644 index 0000000..002d4b9 --- /dev/null +++ b/service/kind_box/get_by_id.go @@ -0,0 +1,7 @@ +package kindboxservice + +import param "git.gocasts.ir/ebhomengo/niki/param/kind_box" + +func (s Service) GetById(request param.KindBoxGetByIdRequest) (param.KindBoxGetByIdResponse, error) { + panic("not implement") +} diff --git a/service/kind_box/service.go b/service/kind_box/service.go new file mode 100644 index 0000000..b2230f7 --- /dev/null +++ b/service/kind_box/service.go @@ -0,0 +1,21 @@ +package kindboxservice + +import "git.gocasts.ir/ebhomengo/niki/entity" + +type Repository interface { + AddKindBox(kindBox entity.KindBox) (entity.KindBox, error) + EditKindBox(kindBoxID uint, kindBoxInput entity.KindBox) (entity.KindBox, error) + DeleteKindBox(kindBoxID uint) error + GetAllKindBox() ([]entity.KindBox, error) + GetKindBoxByID(kindBox uint) (entity.KindBox, error) +} + +type Service struct { + repo Repository +} + +func New(repository Repository) Service { + return Service{ + repo: repository, + } +} diff --git a/service/kind_box/update.go b/service/kind_box/update.go new file mode 100644 index 0000000..50a012d --- /dev/null +++ b/service/kind_box/update.go @@ -0,0 +1,9 @@ +package kindboxservice + +import ( + param "git.gocasts.ir/ebhomengo/niki/param/kind_box" +) + +func (s Service) Update(updatedKindBox param.KindBoxUpdateRequest) (param.KindBoxUpdateResponse, error) { + panic("not implement") +} diff --git a/service/kind_box_req/add.go b/service/kind_box_req/add.go new file mode 100644 index 0000000..5bd5bc3 --- /dev/null +++ b/service/kind_box_req/add.go @@ -0,0 +1,10 @@ +package kindboxservice + +import ( + param "git.gocasts.ir/ebhomengo/niki/param/kind_box_req" +) + +func (s Service) Add(newKindBoxReq param.KindBoxReqAddRequest) (param.KindBoxReqAddResponse, error) { + // some code + panic("not implemented") +} diff --git a/service/kind_box_req/delete.go b/service/kind_box_req/delete.go new file mode 100644 index 0000000..bb97591 --- /dev/null +++ b/service/kind_box_req/delete.go @@ -0,0 +1,7 @@ +package kindboxservice + +import param "git.gocasts.ir/ebhomengo/niki/param/kind_box_req" + +func (s Service) Delete(kindBoxReqId param.KindBoxReqDeleteRequest) error { + panic("not implemented") +} diff --git a/service/kind_box_req/get_all.go b/service/kind_box_req/get_all.go new file mode 100644 index 0000000..1219392 --- /dev/null +++ b/service/kind_box_req/get_all.go @@ -0,0 +1,7 @@ +package kindboxservice + +import param "git.gocasts.ir/ebhomengo/niki/param/kind_box_req" + +func (s Service) GetAll() (param.KindBoxReqGetAllResponse, error) { + panic("not implement") +} diff --git a/service/kind_box_req/get_by_id.go b/service/kind_box_req/get_by_id.go new file mode 100644 index 0000000..f7429a1 --- /dev/null +++ b/service/kind_box_req/get_by_id.go @@ -0,0 +1,7 @@ +package kindboxservice + +import param "git.gocasts.ir/ebhomengo/niki/param/kind_box_req" + +func (s Service) GetById(request param.KindBoxReqGetByIdRequest) (param.KindBoxReqGetByIdResponse, error) { + panic("not implement") +} diff --git a/service/kind_box_req/service.go b/service/kind_box_req/service.go new file mode 100644 index 0000000..488f705 --- /dev/null +++ b/service/kind_box_req/service.go @@ -0,0 +1,21 @@ +package kindboxservice + +import "git.gocasts.ir/ebhomengo/niki/entity" + +type Repository interface { + AddKindBoxReq(kindBoxReq entity.KindBoxReq) (entity.KindBoxReq, error) + EditKindBoxReq(kindBoxReqID uint, kindBoxReqInput entity.KindBoxReq) (entity.KindBoxReq, error) + DeleteKindBoxReq(kindBoxReqID uint) error + GetAllKindBoxReq() ([]entity.KindBoxReq, error) + GetKindBoxReqByID(kindBoxReq uint) (entity.KindBoxReq, error) +} + +type Service struct { + repo Repository +} + +func New(repository Repository) Service { + return Service{ + repo: repository, + } +} diff --git a/service/kind_box_req/update.go b/service/kind_box_req/update.go new file mode 100644 index 0000000..db462a2 --- /dev/null +++ b/service/kind_box_req/update.go @@ -0,0 +1,9 @@ +package kindboxservice + +import ( + param "git.gocasts.ir/ebhomengo/niki/param/kind_box_req" +) + +func (s Service) Update(updatedKindBoxReq param.KindBoxReqUpdateRequest) (param.KindBoxReqUpdateResponse, error) { + panic("not implement") +} diff --git a/service/piggybankservice/delete.go b/service/piggybankservice/delete.go deleted file mode 100644 index 018cb51..0000000 --- a/service/piggybankservice/delete.go +++ /dev/null @@ -1,7 +0,0 @@ -package piggybankservice - -import "git.gocasts.ir/ebhomengo/niki/param" - -func (s Service) Delete(req param.PiggyBankDeleteRequest) (param.PiggyBankDeleteResponse, error) { - return param.PiggyBankDeleteResponse{}, nil -} diff --git a/service/piggybankservice/get_all.go b/service/piggybankservice/get_all.go deleted file mode 100644 index 22815a5..0000000 --- a/service/piggybankservice/get_all.go +++ /dev/null @@ -1,7 +0,0 @@ -package piggybankservice - -import "git.gocasts.ir/ebhomengo/niki/param" - -func (s Service) GetAll(req param.PiggyBankGetAllRequest) (param.PiggyBankGetAllResponse, error) { - return param.PiggyBankGetAllResponse{}, nil -} diff --git a/service/piggybankservice/get_by_id.go b/service/piggybankservice/get_by_id.go deleted file mode 100644 index a61326b..0000000 --- a/service/piggybankservice/get_by_id.go +++ /dev/null @@ -1,7 +0,0 @@ -package piggybankservice - -import "git.gocasts.ir/ebhomengo/niki/param" - -func (s Service) GetById(req param.PiggyBankGetByIdRequest) (param.PiggyBankGetByIdResponse, error) { - return param.PiggyBankGetByIdResponse{}, nil -} diff --git a/service/piggybankservice/service.go b/service/piggybankservice/service.go deleted file mode 100644 index eacf98c..0000000 --- a/service/piggybankservice/service.go +++ /dev/null @@ -1,21 +0,0 @@ -package piggybankservice - -import "git.gocasts.ir/ebhomengo/niki/entity" - -type Repository interface { - AddPiggyBank(piggy entity.PiggyBank) (entity.PiggyBank, error) - EditPiggyBank(piggyID uint, piggyBankInput entity.PiggyBank) (entity.PiggyBank, error) - DeletePiggyBank(piggyID uint) error - GetAllPiggyBank() ([]entity.PiggyBank, error) - GetPiggyBankByID(piggyBank uint) (entity.PiggyBank, error) -} - -type Service struct { - repo Repository -} - -func New(repository Repository) Service { - return Service{ - repo: repository, - } -} diff --git a/service/piggybankservice/store.go b/service/piggybankservice/store.go deleted file mode 100644 index 770e407..0000000 --- a/service/piggybankservice/store.go +++ /dev/null @@ -1,7 +0,0 @@ -package piggybankservice - -import "git.gocasts.ir/ebhomengo/niki/param" - -func (s Service) Store(req param.PiggyBankStoreRequest) (param.PiggyBankStoreResponse, error) { - return param.PiggyBankStoreResponse{}, nil -} diff --git a/service/piggybankservice/update.go b/service/piggybankservice/update.go deleted file mode 100644 index 720a1b0..0000000 --- a/service/piggybankservice/update.go +++ /dev/null @@ -1,7 +0,0 @@ -package piggybankservice - -import "git.gocasts.ir/ebhomengo/niki/param" - -func (s Service) Update(req param.PiggyBankUpdateRequest) (param.PiggyBankUpdateResponse, error) { - return param.PiggyBankUpdateResponse{}, nil -} diff --git a/service/reqkindboxservice/delete.go b/service/reqkindboxservice/delete.go deleted file mode 100644 index 0502538..0000000 --- a/service/reqkindboxservice/delete.go +++ /dev/null @@ -1,7 +0,0 @@ -package reqkindboxservice - -import "git.gocasts.ir/ebhomengo/niki/param" - -func (s Service) Delete(req param.ReqKindBoxDeleteRequest) (param.ReqKindBoxDeleteResponse, error) { - return param.ReqKindBoxDeleteResponse{}, nil -} diff --git a/service/reqkindboxservice/get_all.go b/service/reqkindboxservice/get_all.go deleted file mode 100644 index ab66dc6..0000000 --- a/service/reqkindboxservice/get_all.go +++ /dev/null @@ -1,7 +0,0 @@ -package reqkindboxservice - -import "git.gocasts.ir/ebhomengo/niki/param" - -func (s Service) GetAll(req param.ReqKindBoxGetAllRequest) (param.ReqKindBoxGetAllResponse, error) { - return param.ReqKindBoxGetAllResponse{}, nil -} diff --git a/service/reqkindboxservice/get_by_id.go b/service/reqkindboxservice/get_by_id.go deleted file mode 100644 index 85c4df6..0000000 --- a/service/reqkindboxservice/get_by_id.go +++ /dev/null @@ -1,7 +0,0 @@ -package reqkindboxservice - -import "git.gocasts.ir/ebhomengo/niki/param" - -func (s Service) GetById(req param.ReqKindBoxGetByIdRequest) (param.ReqKindBoxGetByIdResponse, error) { - return param.ReqKindBoxGetByIdResponse{}, nil -} diff --git a/service/reqkindboxservice/service.go b/service/reqkindboxservice/service.go deleted file mode 100644 index 5d3f558..0000000 --- a/service/reqkindboxservice/service.go +++ /dev/null @@ -1,21 +0,0 @@ -package reqkindboxservice - -import "git.gocasts.ir/ebhomengo/niki/entity" - -type Repository interface { - AddReqKindBox(reqKindBox entity.ReqKindBox) (entity.ReqKindBox, error) - EditReqKindBox(reqKindBoxID uint, reqKindBox entity.ReqKindBox) (entity.ReqKindBox, error) - DeleteReqKindBox(reqKindBoxID uint) error - GetAllReqKindBox() ([]entity.ReqKindBox, error) - GetReqKindBoxByID(reqKindBoxID uint) (entity.ReqKindBox, error) -} - -type Service struct { - repo Repository -} - -func New(repository Repository) Service { - return Service{ - repo: repository, - } -} diff --git a/service/reqkindboxservice/store.go b/service/reqkindboxservice/store.go deleted file mode 100644 index 7c741c9..0000000 --- a/service/reqkindboxservice/store.go +++ /dev/null @@ -1,7 +0,0 @@ -package reqkindboxservice - -import "git.gocasts.ir/ebhomengo/niki/param" - -func (s Service) Store(req param.ReqKindBoxStoreRequest) (param.ReqKindBoxStoreResponse, error) { - return param.ReqKindBoxStoreResponse{}, nil -} diff --git a/service/reqkindboxservice/update.go b/service/reqkindboxservice/update.go deleted file mode 100644 index 103fe60..0000000 --- a/service/reqkindboxservice/update.go +++ /dev/null @@ -1,7 +0,0 @@ -package reqkindboxservice - -import "git.gocasts.ir/ebhomengo/niki/param" - -func (s Service) Update(req param.ReqKindBoxUpdateRequest) (param.ReqKindBoxUpdateResponse, error) { - return param.ReqKindBoxUpdateResponse{}, nil -} diff --git a/validator/piggybankvalidator/delete.go b/validator/piggybankvalidator/delete.go deleted file mode 100644 index 4f4ad52..0000000 --- a/validator/piggybankvalidator/delete.go +++ /dev/null @@ -1,7 +0,0 @@ -package piggybankvalidator - -import "git.gocasts.ir/ebhomengo/niki/param" - -func (v Validator) ValidateDeleteRequest(req param.PiggyBankDeleteRequest) { - -} diff --git a/validator/piggybankvalidator/get_by_id.go b/validator/piggybankvalidator/get_by_id.go deleted file mode 100644 index 9dd4122..0000000 --- a/validator/piggybankvalidator/get_by_id.go +++ /dev/null @@ -1,7 +0,0 @@ -package piggybankvalidator - -import "git.gocasts.ir/ebhomengo/niki/param" - -func (v Validator) ValidateGetByIdRequest(req param.PiggyBankGetByIdRequest) { - -} diff --git a/validator/piggybankvalidator/store.go b/validator/piggybankvalidator/store.go deleted file mode 100644 index 15fa4b9..0000000 --- a/validator/piggybankvalidator/store.go +++ /dev/null @@ -1,7 +0,0 @@ -package piggybankvalidator - -import "git.gocasts.ir/ebhomengo/niki/param" - -func (v Validator) ValidateStoreRequest(req param.PiggyBankStoreRequest) { - -} diff --git a/validator/piggybankvalidator/update.go b/validator/piggybankvalidator/update.go deleted file mode 100644 index 15c4dd6..0000000 --- a/validator/piggybankvalidator/update.go +++ /dev/null @@ -1,7 +0,0 @@ -package piggybankvalidator - -import "git.gocasts.ir/ebhomengo/niki/param" - -func (v Validator) ValidateUpdateRequest(req param.PiggyBankUpdateRequest) { - -} diff --git a/validator/piggybankvalidator/validator.go b/validator/piggybankvalidator/validator.go deleted file mode 100644 index 3e7ea90..0000000 --- a/validator/piggybankvalidator/validator.go +++ /dev/null @@ -1,12 +0,0 @@ -package piggybankvalidator - -type Repository interface { -} - -type Validator struct { - repo Repository -} - -func New(repo Repository) Validator { - return Validator{repo: repo} -}