api_byte_lib.go
1.2 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
package bytelib
import (
"gitlab.fjmaimaimai.com/allied-creation/character-library-metadata-bastion/pkg/domain/bytecore"
"gitlab.fjmaimaimai.com/allied-creation/character-library-metadata-bastion/pkg/infrastructure/api"
"time"
)
// ApiByteLib 字库底层接口
type ApiByteLib struct {
api.BaseServiceGateway
baseUrL string
}
func NewApiByteLib(host string) *ApiByteLib {
gt := api.NewBaseServiceGateway(host)
gt.ConnectTimeout = 10 * time.Second
gt.ReadWriteTimeout = 10 * time.Second
return &ApiByteLib{
BaseServiceGateway: gt,
}
}
// 加载数据
func (gateway ApiByteLib) LoadDataTable(param bytecore.ReqLoadDataTable) (*bytecore.DataLoadDataTable, error) {
return nil, nil
}
// EditTable 编辑表格
func (gateway ApiByteLib) EditTable(param bytecore.ReqEditDataTable) (*bytecore.DataEditDataTable, error) {
url := gateway.Host() + "/table/edit"
method := "post"
var data bytecore.DataEditDataTable
err := gateway.FastDoRequest(url, method, param, &data)
if err != nil {
return nil, err
}
return &data, nil
}
// 保存校验文件 (文件地址)
// 生成主表
// 表复制
// 追加数据
// 表删除 (主表、副表、分表)
// 表拆分
// 更新表结构(分表)
// 编辑、添加、删除表数据(副表)