domain_service.go
3.0 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package factory
import (
"github.com/linmadan/egglib-go/core/application"
"github.com/linmadan/egglib-go/transaction/pg"
"gitlab.fjmaimaimai.com/allied-creation/character-library-metadata-bastion/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/character-library-metadata-bastion/pkg/domain/bytecore"
"gitlab.fjmaimaimai.com/allied-creation/character-library-metadata-bastion/pkg/infrastructure/domainService"
)
func FastLog(transactionContext application.TransactionContext, logType domain.LogType, sourceId int, logEntry domainService.Log) error {
logService, _ := domainService.NewPGLogService(transactionContext.(*pg.TransactionContext))
return logService.Log(logType, sourceId, logEntry)
}
func CreateLoadDataTableService(transactionContext application.TransactionContext) (domain.PreviewDataTableService, error) {
return domainService.NewLoadDataTableService(transactionContext.(*pg.TransactionContext))
}
func CreateEditDataTableService(transactionContext application.TransactionContext) (domain.EditDataTableService, error) {
return domainService.NewEditDataTableService(transactionContext.(*pg.TransactionContext))
}
func CreateFlushDataTableService(transactionContext application.TransactionContext) (domain.FlushDataTableService, error) {
return domainService.NewFlushDataTableService(transactionContext.(*pg.TransactionContext))
}
func CreateDeleteFileService(transactionContext application.TransactionContext) (domain.DeleteFileService, error) {
return domainService.NewDeleteFileService(transactionContext.(*pg.TransactionContext))
}
func CreateGenerateMainTableService(transactionContext application.TransactionContext) (domain.GenerateMainTableService, error) {
return domainService.NewGenerateMainTableService(transactionContext.(*pg.TransactionContext))
}
func CreateCopyDataTableService(transactionContext application.TransactionContext) (domain.CopyDataTableService, error) {
return domainService.NewCopyDataTableService(transactionContext.(*pg.TransactionContext))
}
func CreateDeleteDataTableService(transactionContext application.TransactionContext) (domain.DeleteDataTableService, error) {
return domainService.NewDeleteDataTableService(transactionContext.(*pg.TransactionContext))
}
func CreateUpdateTableStructService(transactionContext application.TransactionContext) (domain.UpdateTableStructService, error) {
return domainService.NewUpdateTableStructService(transactionContext.(*pg.TransactionContext))
}
func CreateAddTableStructService(transactionContext application.TransactionContext) (domain.AddTableStructService, error) {
return domainService.NewAddTableStructService(transactionContext.(*pg.TransactionContext))
}
func CreateAppendDataToTableService(transactionContext application.TransactionContext) (domain.AppendDataToTableService, error) {
return domainService.NewAppendDataToTableService(transactionContext.(*pg.TransactionContext))
}
// 字库核心
func CreateByteCoreService(transactionContext application.TransactionContext) (bytecore.ByteLibService, error) {
return domainService.ByteCore, nil
}