feat(invoice): add send route
This commit is contained in:
34
pkg/invoice/resource.go
Normal file
34
pkg/invoice/resource.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package invoice
|
||||
|
||||
import (
|
||||
"io"
|
||||
"log/slog"
|
||||
|
||||
"code.gitea.io/sdk/gitea"
|
||||
)
|
||||
|
||||
type Repo struct {
|
||||
Owner string `json:"owner"`
|
||||
Repo string `json:"repo"`
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
log *slog.Logger
|
||||
gitea giteaClient
|
||||
pdf pdfGenerator
|
||||
}
|
||||
|
||||
func New(log *slog.Logger, gitea giteaClient, pdf pdfGenerator) *Service {
|
||||
return &Service{
|
||||
log: log,
|
||||
gitea: gitea,
|
||||
pdf: pdf,
|
||||
}
|
||||
}
|
||||
|
||||
type giteaClient interface {
|
||||
ListRepoIssues(owner, repo string, opt gitea.ListIssueOption) ([]*gitea.Issue, *gitea.Response, error)
|
||||
}
|
||||
type pdfGenerator interface {
|
||||
HtmlToPdf(html string) (pdf io.ReadCloser, err error)
|
||||
}
|
||||
Reference in New Issue
Block a user