add access_list methods
This commit is contained in:
1 parent
8a0ebe803a
commit
f215008349
20 files changed
+1511
-141
No files matched your search
+39
-24
@@ -8,42 +8,48 @@ import (
|
||||
)
|
||||
|
||||
type SystemHandler struct {
|
||||
GetSystems func(list []int32) ([]entity.System, error) `method:"get_systems" group:"system" inner:"true"`
|
||||
CreateUpdateSystem func(system entity.System) (*entity.System, error) `method:"create_update_system" group:"system" inner:"true"`
|
||||
GetSystemById func(identity controller.Identity) (*entity.System, error) `method:"get_system_by_id" group:"system" inner:"true"`
|
||||
DeleteSystems func(list []int32) (controller.DeleteResponse, error) `method:"delete_systems" group:"system" inner:"true"`
|
||||
GetSystems func([]int32) ([]entity.System, error) `method:"get_systems" group:"system" inner:"true"`
|
||||
CreateUpdateSystem func(entity.System) (*entity.System, error) `method:"create_update_system" group:"system" inner:"true"`
|
||||
GetSystemById func(controller.Identity) (*entity.System, error) `method:"get_system_by_id" group:"system" inner:"true"`
|
||||
DeleteSystems func([]int32) (controller.DeleteResponse, error) `method:"delete_systems" group:"system" inner:"true"`
|
||||
}
|
||||
|
||||
type DomainHandler struct {
|
||||
//GetDomains func(list []int32) ([]entity.Domain, error) `method:"get_domains" group:"domain" inner:"true"`
|
||||
GetDomainsBySystemId func(md metadata.MD) ([]entity.Domain, error) `method:"get_domains_by_system_id" group:"domain" inner:"true"`
|
||||
CreateUpdateDomain func(domain entity.Domain, md metadata.MD) (*entity.Domain, error) `method:"create_update_domain" group:"domain" inner:"true"`
|
||||
GetDomainById func(identity controller.Identity) (*entity.Domain, error) `method:"get_domain_by_id" group:"domain" inner:"true"`
|
||||
DeleteDomains func(list []int32) (controller.DeleteResponse, error) `method:"delete_domains" group:"domain" inner:"true"`
|
||||
//GetDomains func([]int32) ([]entity.Domain, error) `method:"get_domains" group:"domain" inner:"true"`
|
||||
GetDomainsBySystemId func(metadata.MD) ([]entity.Domain, error) `method:"get_domains_by_system_id" group:"domain" inner:"true"`
|
||||
CreateUpdateDomain func(entity.Domain, metadata.MD) (*entity.Domain, error) `method:"create_update_domain" group:"domain" inner:"true"`
|
||||
GetDomainById func(controller.Identity) (*entity.Domain, error) `method:"get_domain_by_id" group:"domain" inner:"true"`
|
||||
DeleteDomains func([]int32) (controller.DeleteResponse, error) `method:"delete_domains" group:"domain" inner:"true"`
|
||||
}
|
||||
|
||||
type ServiceHandler struct {
|
||||
GetService func(list []int32) ([]entity.Service, error) `method:"get_service" group:"service" inner:"true"`
|
||||
GetServicesByDomainId func(identity controller.Identity) ([]entity.Service, error) `method:"get_services_by_domain_id" group:"service" inner:"true"`
|
||||
CreateUpdateService func(service entity.Service) (*entity.Service, error) `method:"create_update_service" group:"service" inner:"true"`
|
||||
GetServiceById func(identity controller.Identity) (*entity.Service, error) `method:"get_service_by_id" group:"service" inner:"true"`
|
||||
DeleteService func(list []int32) (controller.DeleteResponse, error) `method:"delete_service" group:"service" inner:"true"`
|
||||
GetService func([]int32) ([]entity.Service, error) `method:"get_service" group:"service" inner:"true"`
|
||||
GetServicesByDomainId func(controller.Identity) ([]entity.Service, error) `method:"get_services_by_domain_id" group:"service" inner:"true"`
|
||||
CreateUpdateService func(entity.Service) (*entity.Service, error) `method:"create_update_service" group:"service" inner:"true"`
|
||||
GetServiceById func(controller.Identity) (*entity.Service, error) `method:"get_service_by_id" group:"service" inner:"true"`
|
||||
DeleteService func([]int32) (controller.DeleteResponse, error) `method:"delete_service" group:"service" inner:"true"`
|
||||
}
|
||||
|
||||
type ApplicationHandler struct {
|
||||
GetApplications func(list []int32) ([]*controller.AppWithToken, error) `method:"get_applications" group:"application" inner:"true"`
|
||||
GetApplicationsByServiceId func(identity controller.Identity) ([]*controller.AppWithToken, error) `method:"get_applications_by_service_id" group:"application" inner:"true"`
|
||||
CreateUpdateApplication func(application entity.Application) (*controller.AppWithToken, error) `method:"create_update_application" group:"application" inner:"true"`
|
||||
GetApplicationById func(identity controller.Identity) (*controller.AppWithToken, error) `method:"get_application_by_id" group:"application" inner:"true"`
|
||||
DeleteApplications func(list []int32) (controller.DeleteResponse, error) `method:"delete_applications" group:"application" inner:"true"`
|
||||
GetSystemTree func(md metadata.MD) ([]*controller.DomainWithServices, error) `method:"get_system_tree" group:"application" inner:"true"`
|
||||
GetApplications func([]int32) ([]*controller.AppWithToken, error) `method:"get_applications" group:"application" inner:"true"`
|
||||
GetApplicationsByServiceId func(controller.Identity) ([]*controller.AppWithToken, error) `method:"get_applications_by_service_id" group:"application" inner:"true"`
|
||||
CreateUpdateApplication func(entity.Application) (*controller.AppWithToken, error) `method:"create_update_application" group:"application" inner:"true"`
|
||||
GetApplicationById func(controller.Identity) (*controller.AppWithToken, error) `method:"get_application_by_id" group:"application" inner:"true"`
|
||||
DeleteApplications func([]int32) (controller.DeleteResponse, error) `method:"delete_applications" group:"application" inner:"true"`
|
||||
GetSystemTree func(metadata.MD) ([]*controller.DomainWithServices, error) `method:"get_system_tree" group:"application" inner:"true"`
|
||||
}
|
||||
|
||||
type TokenHandler struct {
|
||||
CreateToken func(req controller.CreateTokenRequest) (*controller.AppWithToken, error) `method:"create_token" group:"token" inner:"true"`
|
||||
RevokeTokens func(request controller.RevokeTokensRequest) (*controller.AppWithToken, error) `method:"revoke_tokens" group:"token" inner:"true"`
|
||||
RevokeTokensForApp func(identity controller.Identity) (*controller.DeleteResponse, error) `method:"revoke_tokens_for_app" group:"token" inner:"true"`
|
||||
GetTokensByAppId func(identity controller.Identity) ([]entity.Token, error) `method:"get_tokens_by_app_id" group:"token" inner:"true"`
|
||||
CreateToken func(controller.CreateTokenRequest) (*controller.AppWithToken, error) `method:"create_token" group:"token" inner:"true"`
|
||||
RevokeTokens func(controller.RevokeTokensRequest) (*controller.AppWithToken, error) `method:"revoke_tokens" group:"token" inner:"true"`
|
||||
RevokeTokensForApp func(controller.Identity) (*controller.DeleteResponse, error) `method:"revoke_tokens_for_app" group:"token" inner:"true"`
|
||||
GetTokensByAppId func(controller.Identity) ([]entity.Token, error) `method:"get_tokens_by_app_id" group:"token" inner:"true"`
|
||||
}
|
||||
|
||||
type AccessListHandler struct {
|
||||
GetById func(controller.Identity) (controller.ModuleMethods, error) `method:"get_by_id" group:"access_list" inner:"true"`
|
||||
SetOne func(entity.AccessList) (*controller.CountResponse, error) `method:"set_one" group:"access_list" inner:"true"`
|
||||
SetList func(controller.SetListRequest) (*controller.CountResponse, error) `method:"set_list" group:"access_list" inner:"true"`
|
||||
}
|
||||
|
||||
func GetSystemHandler() *SystemHandler {
|
||||
@@ -95,6 +101,14 @@ func GetTokenHandler() *TokenHandler {
|
||||
}
|
||||
}
|
||||
|
||||
func GetAccessListHandler() *AccessListHandler {
|
||||
return &AccessListHandler{
|
||||
GetById: controller.AccessList.GetById,
|
||||
SetOne: controller.AccessList.SetOne,
|
||||
SetList: controller.AccessList.SetList,
|
||||
}
|
||||
}
|
||||
|
||||
func GetAllHandlers() []interface{} {
|
||||
return []interface{}{
|
||||
GetSystemHandler(),
|
||||
@@ -102,5 +116,6 @@ func GetAllHandlers() []interface{} {
|
||||
GetServiceHandler(),
|
||||
GetApplicationHandler(),
|
||||
GetTokenHandler(),
|
||||
GetAccessListHandler(),
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user