hades/templates/service.templ

39 lines
615 B
Plaintext
Raw Normal View History

2024-09-16 10:48:18 +02:00
package service
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"os"
"regexp"
"time"
"{{ App.NameSpace }}/internal/types"
"golang.org/x/crypto/bcrypt"
)
{{ range .Services}}
type IService interface {
{{ .Name}}(ctx context.Context, req types.{{ .Request}}) (types.{{ .Response}}, error)
}
{{ end }}
type service struct {}
{{ range .Services}}
func (s *service) {{ .Name}}(ctx context.Context, req types.{{ .Request}}) (types.{{ .Response}}, error) {
// create business logic
return types.{{ .Response }}{
}, nil
}
{{ end }}
func NewService() IService {
return &service{
}
}