12345678910111213141516171819202122232425262728293031323334353637 |
- package admin
- import (
- "context"
- v1 "github.com/go-nunu/nunu-layout-advanced/api/v1"
- admin "github.com/go-nunu/nunu-layout-advanced/api/v1/admin"
- "github.com/go-nunu/nunu-layout-advanced/internal/model"
- adminRep "github.com/go-nunu/nunu-layout-advanced/internal/repository/admin"
- "github.com/go-nunu/nunu-layout-advanced/internal/service"
- )
- type LogService interface {
- GetLog(ctx context.Context, id int64) (*model.Log, error)
- GetLogList(ctx context.Context, req admin.SearchLogParams) (*v1.PaginatedResponse[model.Log], error)
- }
- func NewLogService(
- service *service.Service,
- LogRepository adminRep.LogRepository,
- ) LogService {
- return &logService{
- Service: service,
- LogRepository: LogRepository,
- }
- }
- type logService struct {
- *service.Service
- LogRepository adminRep.LogRepository
- }
- func (s *logService) GetLog(ctx context.Context, id int64) (*model.Log, error) {
- return s.LogRepository.GetLog(ctx, id)
- }
- func (s *logService) GetLogList(ctx context.Context, req admin.SearchLogParams) (*v1.PaginatedResponse[model.Log], error) {
- return s.LogRepository.GetLogList(ctx, req)
- }
|