v1
This commit is contained in:
@@ -7,9 +7,8 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"management/internal/erpserver/model/dto"
|
||||
"management/internal/erpserver/model/form"
|
||||
"management/internal/erpserver/model/system"
|
||||
"management/internal/erpserver/model/system/request"
|
||||
"management/internal/erpserver/model/view"
|
||||
"management/internal/erpserver/service/util"
|
||||
"management/internal/erpserver/service/v1"
|
||||
@@ -30,7 +29,7 @@ func NewRoleService(service *v1.Service, repo system.RoleRepository) v1.RoleServ
|
||||
}
|
||||
}
|
||||
|
||||
func (s *roleService) Create(ctx context.Context, req *form.Role) error {
|
||||
func (s *roleService) Create(ctx context.Context, req *request.CreateAndUpdateRole) error {
|
||||
parent := &system.Role{
|
||||
ID: 0,
|
||||
ParentID: 0,
|
||||
@@ -70,7 +69,7 @@ func (s *roleService) Create(ctx context.Context, req *form.Role) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *roleService) Update(ctx context.Context, req *form.Role) error {
|
||||
func (s *roleService) Update(ctx context.Context, req *request.CreateAndUpdateRole) error {
|
||||
parent := &system.Role{
|
||||
ID: 0,
|
||||
ParentID: 0,
|
||||
@@ -84,7 +83,7 @@ func (s *roleService) Update(ctx context.Context, req *form.Role) error {
|
||||
}
|
||||
}
|
||||
|
||||
role, err := s.repo.Get(ctx, *req.ID)
|
||||
role, err := s.repo.Get(ctx, req.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -117,7 +116,7 @@ func (s *roleService) All(ctx context.Context) ([]*system.Role, error) {
|
||||
return res, err
|
||||
}
|
||||
|
||||
func (s *roleService) List(ctx context.Context, q dto.SearchDto) ([]*system.Role, int64, error) {
|
||||
func (s *roleService) List(ctx context.Context, q request.ListRole) ([]*system.Role, int64, error) {
|
||||
count, err := s.repo.Count(ctx, q)
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
|
||||
Reference in New Issue
Block a user