-
Notifications
You must be signed in to change notification settings - Fork 0
/
service.go
41 lines (37 loc) · 1.06 KB
/
service.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package alert
import (
"github.com/ca-risken/common/pkg/logging"
"github.com/ca-risken/core/pkg/db"
"github.com/ca-risken/core/proto/alert"
"github.com/ca-risken/core/proto/finding"
"github.com/ca-risken/core/proto/project"
)
var _ alert.AlertServiceServer = (*AlertService)(nil)
type AlertService struct {
repository db.AlertRepository
findingClient finding.FindingServiceClient
projectClient project.ProjectServiceClient
maxAnalyzeAPICall int64
baseURL string
logger logging.Logger
defaultLocale string
}
func NewAlertService(
maxAnalyzeAPICall int64,
baseURL string,
findingClient finding.FindingServiceClient,
projectClient project.ProjectServiceClient,
repository db.AlertRepository,
logger logging.Logger,
defaultLocale string,
) *AlertService {
return &AlertService{
repository: repository,
findingClient: findingClient,
projectClient: projectClient,
maxAnalyzeAPICall: maxAnalyzeAPICall,
baseURL: baseURL,
logger: logger,
defaultLocale: defaultLocale,
}
}