-
Notifications
You must be signed in to change notification settings - Fork 0
/
core.go
56 lines (52 loc) · 1.56 KB
/
core.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package ERPProduct
import (
ClassSort "github.com/fotomxq/weeekj_core/v5/class/sort"
ClassTag "github.com/fotomxq/weeekj_core/v5/class/tag"
CoreSQL2 "github.com/fotomxq/weeekj_core/v5/core/sql2"
Router2SystemConfig "github.com/fotomxq/weeekj_core/v5/router2/system_config"
)
//ERP产品信息库
var (
//Sort 分类
Sort = ClassSort.Sort{
SortTableName: "erp_product_sort",
}
//Tags 标签
Tags = ClassTag.Tag{
TagTableName: "erp_product_tags",
}
//缓冲时间
cacheProductTime = 1800
cacheProductCompanyTime = 1800
cacheBrandTime = 1800
cacheBrandBindTime = 1800
cacheTemplateTime = 1800
cacheTemplateBindTime = 1800
cacheProductValsTime = 1800
cacheModelTypeTime = 1800
//OpenSub 订阅
OpenSub = false
//数据表
productDB CoreSQL2.Client
brandDB CoreSQL2.Client
brandBindDB CoreSQL2.Client
templateDB CoreSQL2.Client
templateBindDB CoreSQL2.Client
productValsDB CoreSQL2.Client
modelTypeDB CoreSQL2.Client
)
// Init 初始化
func Init() {
//初始化数据表
productDB.Init(&Router2SystemConfig.MainSQL, "erp_product")
brandDB.Init(&Router2SystemConfig.MainSQL, "erp_product_brand")
brandBindDB.Init(&Router2SystemConfig.MainSQL, "erp_product_brand_bind")
templateDB.Init(&Router2SystemConfig.MainSQL, "erp_product_template")
templateBindDB.Init(&Router2SystemConfig.MainSQL, "erp_product_template_bind")
productValsDB.Init(&Router2SystemConfig.MainSQL, "erp_product_vals")
modelTypeDB.Init(&Router2SystemConfig.MainSQL, "erp_product_model_type")
//nats
if OpenSub {
subNats()
}
}