From 6c623e6be6c8e4afea9dc61f2db3645eccaf296c Mon Sep 17 00:00:00 2001 From: masoodk Date: Sun, 17 Dec 2023 19:01:14 +0330 Subject: [PATCH] feat(domain): added request kind box domain --- entity/reqkindbox.go | 11 +++++++++++ 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 +++++++++++ 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 +++++++ 12 files changed, 111 insertions(+) create mode 100644 entity/reqkindbox.go create mode 100644 param/reqkindbox_delete.go create mode 100644 param/reqkindbox_get_all.go create mode 100644 param/reqkindbox_get_by_id.go create mode 100644 param/reqkindbox_store.go create mode 100644 param/reqkindbox_update.go create mode 100644 service/reqkindboxservice/delete.go create mode 100644 service/reqkindboxservice/get_all.go create mode 100644 service/reqkindboxservice/get_by_id.go create mode 100644 service/reqkindboxservice/service.go create mode 100644 service/reqkindboxservice/store.go create mode 100644 service/reqkindboxservice/update.go diff --git a/entity/reqkindbox.go b/entity/reqkindbox.go new file mode 100644 index 0000000..b1ad933 --- /dev/null +++ b/entity/reqkindbox.go @@ -0,0 +1,11 @@ +package entity + +type ReqKindBox struct { + ID uint + TypeId uint + CountRequested uint + CountAccepted uint + NikokarId uint + Status uint + Description string +} diff --git a/param/reqkindbox_delete.go b/param/reqkindbox_delete.go new file mode 100644 index 0000000..9273ee9 --- /dev/null +++ b/param/reqkindbox_delete.go @@ -0,0 +1,8 @@ +package param + +type ReqKindBoxDeleteRequest struct { + reqKindBoxID uint +} + +type ReqKindBoxDeleteResponse struct { +} diff --git a/param/reqkindbox_get_all.go b/param/reqkindbox_get_all.go new file mode 100644 index 0000000..9d20188 --- /dev/null +++ b/param/reqkindbox_get_all.go @@ -0,0 +1,7 @@ +package param + +type ReqKindBoxGetAllRequest struct { +} + +type ReqKindBoxGetAllResponse struct { +} diff --git a/param/reqkindbox_get_by_id.go b/param/reqkindbox_get_by_id.go new file mode 100644 index 0000000..11e5a8b --- /dev/null +++ b/param/reqkindbox_get_by_id.go @@ -0,0 +1,8 @@ +package param + +type ReqKindBoxGetByIdRequest struct { + reqKindBoxID uint +} + +type ReqKindBoxGetByIdResponse struct { +} diff --git a/param/reqkindbox_store.go b/param/reqkindbox_store.go new file mode 100644 index 0000000..381ec74 --- /dev/null +++ b/param/reqkindbox_store.go @@ -0,0 +1,10 @@ +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 new file mode 100644 index 0000000..e1bfaf8 --- /dev/null +++ b/param/reqkindbox_update.go @@ -0,0 +1,11 @@ +package param + +import "git.gocasts.ir/ebhomengo/niki/entity" + +type ReqKindBoxUpdateRequest struct { + reqKindBoxID uint + reqKindBox entity.ReqKindBox +} + +type ReqKindBoxUpdateResponse struct { +} diff --git a/service/reqkindboxservice/delete.go b/service/reqkindboxservice/delete.go new file mode 100644 index 0000000..0502538 --- /dev/null +++ b/service/reqkindboxservice/delete.go @@ -0,0 +1,7 @@ +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 new file mode 100644 index 0000000..ab66dc6 --- /dev/null +++ b/service/reqkindboxservice/get_all.go @@ -0,0 +1,7 @@ +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 new file mode 100644 index 0000000..85c4df6 --- /dev/null +++ b/service/reqkindboxservice/get_by_id.go @@ -0,0 +1,7 @@ +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 new file mode 100644 index 0000000..5d3f558 --- /dev/null +++ b/service/reqkindboxservice/service.go @@ -0,0 +1,21 @@ +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 new file mode 100644 index 0000000..7c741c9 --- /dev/null +++ b/service/reqkindboxservice/store.go @@ -0,0 +1,7 @@ +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 new file mode 100644 index 0000000..103fe60 --- /dev/null +++ b/service/reqkindboxservice/update.go @@ -0,0 +1,7 @@ +package reqkindboxservice + +import "git.gocasts.ir/ebhomengo/niki/param" + +func (s Service) Update(req param.ReqKindBoxUpdateRequest) (param.ReqKindBoxUpdateResponse, error) { + return param.ReqKindBoxUpdateResponse{}, nil +}