39 lines
615 B
Plaintext
39 lines
615 B
Plaintext
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{
|
|
}
|
|
} |