2024-08-12 14:20:13 +00:00
|
|
|
// Code generated by goctl. DO NOT EDIT.
|
|
|
|
// Source: permission.proto
|
|
|
|
|
|
|
|
package server
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"ark-permission/gen_result/pb/permission"
|
|
|
|
"ark-permission/internal/logic/roleservice"
|
|
|
|
"ark-permission/internal/svc"
|
|
|
|
)
|
|
|
|
|
|
|
|
type RoleServiceServer struct {
|
|
|
|
svcCtx *svc.ServiceContext
|
|
|
|
permission.UnimplementedRoleServiceServer
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewRoleServiceServer(svcCtx *svc.ServiceContext) *RoleServiceServer {
|
|
|
|
return &RoleServiceServer{
|
|
|
|
svcCtx: svcCtx,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-08-19 01:39:05 +00:00
|
|
|
// CreateRole 建立角色
|
|
|
|
func (s *RoleServiceServer) CreateRole(ctx context.Context, in *permission.CreateRoleReq) (*permission.RoleResp, error) {
|
|
|
|
l := roleservicelogic.NewCreateRoleLogic(ctx, s.svcCtx)
|
|
|
|
return l.CreateRole(in)
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetRole 取得搜尋的角色
|
|
|
|
func (s *RoleServiceServer) GetRole(ctx context.Context, in *permission.GetRoleReq) (*permission.GetRoleResp, error) {
|
|
|
|
l := roleservicelogic.NewGetRoleLogic(ctx, s.svcCtx)
|
|
|
|
return l.GetRole(in)
|
|
|
|
}
|
|
|
|
|
|
|
|
// UpdateRole 更新角色
|
|
|
|
func (s *RoleServiceServer) UpdateRole(ctx context.Context, in *permission.UpdateRoleReq) (*permission.RoleResp, error) {
|
|
|
|
l := roleservicelogic.NewUpdateRoleLogic(ctx, s.svcCtx)
|
|
|
|
return l.UpdateRole(in)
|
2024-08-12 14:20:13 +00:00
|
|
|
}
|