init: init refactor
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.10.1
|
||||
// Source: system.proto
|
||||
|
||||
package systemservice
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/system/rpc/system"
|
||||
|
||||
"github.com/zeromicro/go-zero/zrpc"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
type (
|
||||
ClientInfo = system.ClientInfo
|
||||
CommonResp = system.CommonResp
|
||||
GetClientByIdReq = system.GetClientByIdReq
|
||||
GetClientByIdResp = system.GetClientByIdResp
|
||||
GetMenusByRoleIdReq = system.GetMenusByRoleIdReq
|
||||
GetMenusByRoleIdResp = system.GetMenusByRoleIdResp
|
||||
GetRolesByUserIdReq = system.GetRolesByUserIdReq
|
||||
GetRolesByUserIdResp = system.GetRolesByUserIdResp
|
||||
MenuInfo = system.MenuInfo
|
||||
RoleInfo = system.RoleInfo
|
||||
|
||||
SystemService interface {
|
||||
// 获取用户角色列表
|
||||
GetRolesByUserId(ctx context.Context, in *GetRolesByUserIdReq, opts ...grpc.CallOption) (*GetRolesByUserIdResp, error)
|
||||
// 获取角色菜单列表
|
||||
GetMenusByRoleId(ctx context.Context, in *GetMenusByRoleIdReq, opts ...grpc.CallOption) (*GetMenusByRoleIdResp, error)
|
||||
// 获取客户端信息
|
||||
GetClientById(ctx context.Context, in *GetClientByIdReq, opts ...grpc.CallOption) (*GetClientByIdResp, error)
|
||||
}
|
||||
|
||||
defaultSystemService struct {
|
||||
cli zrpc.Client
|
||||
}
|
||||
)
|
||||
|
||||
func NewSystemService(cli zrpc.Client) SystemService {
|
||||
return &defaultSystemService{
|
||||
cli: cli,
|
||||
}
|
||||
}
|
||||
|
||||
// 获取用户角色列表
|
||||
func (m *defaultSystemService) GetRolesByUserId(ctx context.Context, in *GetRolesByUserIdReq, opts ...grpc.CallOption) (*GetRolesByUserIdResp, error) {
|
||||
client := system.NewSystemServiceClient(m.cli.Conn())
|
||||
return client.GetRolesByUserId(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// 获取角色菜单列表
|
||||
func (m *defaultSystemService) GetMenusByRoleId(ctx context.Context, in *GetMenusByRoleIdReq, opts ...grpc.CallOption) (*GetMenusByRoleIdResp, error) {
|
||||
client := system.NewSystemServiceClient(m.cli.Conn())
|
||||
return client.GetMenusByRoleId(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// 获取客户端信息
|
||||
func (m *defaultSystemService) GetClientById(ctx context.Context, in *GetClientByIdReq, opts ...grpc.CallOption) (*GetClientByIdResp, error) {
|
||||
client := system.NewSystemServiceClient(m.cli.Conn())
|
||||
return client.GetClientById(ctx, in, opts...)
|
||||
}
|
||||
Reference in New Issue
Block a user