add models for MailAccount and Mail
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"kontor-api-gin/internal/models"
|
||||
"kontor-api-gin/internal/repository"
|
||||
"log/slog"
|
||||
)
|
||||
|
||||
type MailAccountService struct {
|
||||
repository *repository.MailAccountRepository
|
||||
}
|
||||
|
||||
func NewMailAccountService(repo *repository.MailAccountRepository) *MailAccountService {
|
||||
service := &MailAccountService{repository: repo}
|
||||
return service
|
||||
}
|
||||
|
||||
func (service *MailAccountService) List(context context.Context) ([]models.MailAccount, error) {
|
||||
slog.Info("MailAccountService#List")
|
||||
return service.repository.FindAll(context)
|
||||
}
|
||||
|
||||
func (service *MailAccountService) Get(context context.Context, id string) (models.MailAccount, error) {
|
||||
slog.Info("MailAccountService#Get")
|
||||
return service.repository.GetById(context, id)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user