41 lines
1.1 KiB
Go
41 lines
1.1 KiB
Go
|
// Code generated by goctl. DO NOT EDIT.
|
||
|
// goctl 1.7.2
|
||
|
// Source: sentinel.proto
|
||
|
|
||
|
package server
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
|
||
|
"tianyuan-api/apps/sentinel/internal/logic/secret"
|
||
|
"tianyuan-api/apps/sentinel/internal/svc"
|
||
|
"tianyuan-api/apps/sentinel/sentinel"
|
||
|
)
|
||
|
|
||
|
type SecretServer struct {
|
||
|
svcCtx *svc.ServiceContext
|
||
|
sentinel.UnimplementedSecretServer
|
||
|
}
|
||
|
|
||
|
func NewSecretServer(svcCtx *svc.ServiceContext) *SecretServer {
|
||
|
return &SecretServer{
|
||
|
svcCtx: svcCtx,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Secret methods
|
||
|
func (s *SecretServer) CreateSecret(ctx context.Context, in *sentinel.CreateSecretRequest) (*sentinel.Secret, error) {
|
||
|
l := secretlogic.NewCreateSecretLogic(ctx, s.svcCtx)
|
||
|
return l.CreateSecret(in)
|
||
|
}
|
||
|
|
||
|
func (s *SecretServer) GetSecretByUserId(ctx context.Context, in *sentinel.GetRecordByIdRequest) (*sentinel.Secret, error) {
|
||
|
l := secretlogic.NewGetSecretByUserIdLogic(ctx, s.svcCtx)
|
||
|
return l.GetSecretByUserId(in)
|
||
|
}
|
||
|
|
||
|
func (s *SecretServer) GetSecretBySecretId(ctx context.Context, in *sentinel.GetSecretBySecretIdRequest) (*sentinel.Secret, error) {
|
||
|
l := secretlogic.NewGetSecretBySecretIdLogic(ctx, s.svcCtx)
|
||
|
return l.GetSecretBySecretId(in)
|
||
|
}
|