34 lines
725 B
Go
34 lines
725 B
Go
package whitelistlogic
|
|
|
|
import (
|
|
"context"
|
|
|
|
"tianyuan-api/apps/sentinel/internal/svc"
|
|
"tianyuan-api/apps/sentinel/sentinel"
|
|
|
|
"github.com/zeromicro/go-zero/core/logx"
|
|
)
|
|
|
|
type DeleteWhitelistLogic struct {
|
|
ctx context.Context
|
|
svcCtx *svc.ServiceContext
|
|
logx.Logger
|
|
}
|
|
|
|
func NewDeleteWhitelistLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteWhitelistLogic {
|
|
return &DeleteWhitelistLogic{
|
|
ctx: ctx,
|
|
svcCtx: svcCtx,
|
|
Logger: logx.WithContext(ctx),
|
|
}
|
|
}
|
|
|
|
func (l *DeleteWhitelistLogic) DeleteWhitelist(in *sentinel.DeleteWhitelistRequest) (*sentinel.Whitelist, error) {
|
|
err := l.svcCtx.WhitelistModel.Delete(l.ctx, in.Id)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &sentinel.Whitelist{}, nil
|
|
}
|