123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- package admin
- import (
- "context"
- v1 "github.com/go-nunu/nunu-layout-advanced/api/v1"
- v1admin "github.com/go-nunu/nunu-layout-advanced/api/v1/admin"
- "github.com/go-nunu/nunu-layout-advanced/internal/model"
- "github.com/go-nunu/nunu-layout-advanced/internal/repository/admin"
- "github.com/go-nunu/nunu-layout-advanced/internal/service"
- )
- type GatewayIpAdminService interface {
- GetGatewayIpAdmin(ctx context.Context, id int64) (*model.Gatewayip, error)
- GetGatewayGroupIpList(ctx context.Context,req v1admin.SearchGatewayIpParams) (*v1.PaginatedResponse[model.Gatewayip], error)
- AddGatewayIp(ctx context.Context,req model.Gatewayip) error
- EditGatewayIp(ctx context.Context,req model.Gatewayip) error
- DeleteGatewayIp(ctx context.Context,id int64) error
- DeleteGatewayIps(ctx context.Context, ids []int64) error
- }
- func NewGatewayIpAdminService(
- service *service.Service,
- gatewayIpAdminRepository admin.GatewayIpAdminRepository,
- ) GatewayIpAdminService {
- return &gatewayIpAdminService{
- Service: service,
- gatewayIpAdminRepository: gatewayIpAdminRepository,
- }
- }
- type gatewayIpAdminService struct {
- *service.Service
- gatewayIpAdminRepository admin.GatewayIpAdminRepository
- }
- func (s *gatewayIpAdminService) GetGatewayIpAdmin(ctx context.Context, id int64) (*model.Gatewayip, error) {
- return s.gatewayIpAdminRepository.GetGatewayIpAdmin(ctx, id)
- }
- func (s *gatewayIpAdminService) GetGatewayGroupIpList(ctx context.Context,req v1admin.SearchGatewayIpParams) (*v1.PaginatedResponse[model.Gatewayip], error) {
- return s.gatewayIpAdminRepository.GetGatewayGroupIpList(ctx,req)
- }
- func (s *gatewayIpAdminService) AddGatewayIp(ctx context.Context,req model.Gatewayip) error {
- return s.gatewayIpAdminRepository.AddGatewayIp(ctx,req)
- }
- func (s *gatewayIpAdminService) EditGatewayIp(ctx context.Context,req model.Gatewayip) error {
- return s.gatewayIpAdminRepository.EditGatewayIp(ctx,req)
- }
- func (s *gatewayIpAdminService) DeleteGatewayIp(ctx context.Context,id int64) error {
- return s.gatewayIpAdminRepository.DeleteGatewayIp(ctx,id)
- }
- func (s *gatewayIpAdminService) DeleteGatewayIps(ctx context.Context, ids []int64) error {
- return s.gatewayIpAdminRepository.DeleteGatewayIps(ctx,ids)
- }
|