first commit
This commit is contained in:
50
apps/sentinel/internal/server/whitelist/whitelistserver.go
Normal file
50
apps/sentinel/internal/server/whitelist/whitelistserver.go
Normal file
@@ -0,0 +1,50 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.7.2
|
||||
// Source: sentinel.proto
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"tianyuan-api/apps/sentinel/internal/logic/whitelist"
|
||||
"tianyuan-api/apps/sentinel/internal/svc"
|
||||
"tianyuan-api/apps/sentinel/sentinel"
|
||||
)
|
||||
|
||||
type WhitelistServer struct {
|
||||
svcCtx *svc.ServiceContext
|
||||
sentinel.UnimplementedWhitelistServer
|
||||
}
|
||||
|
||||
func NewWhitelistServer(svcCtx *svc.ServiceContext) *WhitelistServer {
|
||||
return &WhitelistServer{
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
// Whitelist methods
|
||||
func (s *WhitelistServer) CreateWhitelist(ctx context.Context, in *sentinel.CreateWhitelistRequest) (*sentinel.Whitelist, error) {
|
||||
l := whitelistlogic.NewCreateWhitelistLogic(ctx, s.svcCtx)
|
||||
return l.CreateWhitelist(in)
|
||||
}
|
||||
|
||||
func (s *WhitelistServer) UpdateWhitelist(ctx context.Context, in *sentinel.UpdateWhitelistRequest) (*sentinel.Whitelist, error) {
|
||||
l := whitelistlogic.NewUpdateWhitelistLogic(ctx, s.svcCtx)
|
||||
return l.UpdateWhitelist(in)
|
||||
}
|
||||
|
||||
func (s *WhitelistServer) DeleteWhitelist(ctx context.Context, in *sentinel.DeleteWhitelistRequest) (*sentinel.Whitelist, error) {
|
||||
l := whitelistlogic.NewDeleteWhitelistLogic(ctx, s.svcCtx)
|
||||
return l.DeleteWhitelist(in)
|
||||
}
|
||||
|
||||
func (s *WhitelistServer) GetWhitePageList(ctx context.Context, in *sentinel.WhitePageListRequest) (*sentinel.WhitelistResponse, error) {
|
||||
l := whitelistlogic.NewGetWhitePageListLogic(ctx, s.svcCtx)
|
||||
return l.GetWhitePageList(in)
|
||||
}
|
||||
|
||||
func (s *WhitelistServer) MatchWhitelistByIp(ctx context.Context, in *sentinel.MatchWhitelistByIpRequest) (*sentinel.MatchResponse, error) {
|
||||
l := whitelistlogic.NewMatchWhitelistByIpLogic(ctx, s.svcCtx)
|
||||
return l.MatchWhitelistByIp(in)
|
||||
}
|
||||
Reference in New Issue
Block a user