config.go
2.5 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
package service
import (
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/application/config/query"
)
// 配置服务
type ConfigService struct {
}
// 返回任务状态列表
func (configService *ConfigService) ListTaskStatus(listTaskStatusQuery *query.ListTaskStatusQuery) (interface{}, error) {
if err := listTaskStatusQuery.ValidateQuery(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
taskStatuses := map[int]string{
1: "待发布",
2: "待领取",
3: "进行中",
4: "待验收",
5: "已完成",
}
return map[string]interface{}{
"taskStatuses": taskStatuses,
}, nil
}
// 返回任务类型列表
func (configService *ConfigService) ListTaskTypes(listTaskTypesQuery *query.ListTaskTypesQuery) (interface{}, error) {
if err := listTaskTypesQuery.ValidateQuery(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
taskTypes := map[int]string{
1: "抢单任务",
2: "竞标任务",
}
return map[string]interface{}{
"taskTypes": taskTypes,
}, nil
}
// 返回任务性质列表
func (configService *ConfigService) ListTaskNatures(listTaskNaturesQuery *query.ListTaskNaturesQuery) (interface{}, error) {
if err := listTaskNaturesQuery.ValidateQuery(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
taskNatures := map[int]string{
1: "点",
2: "线",
3: "面",
4: "链",
5: "网",
}
return map[string]interface{}{
"taskNatures": taskNatures,
}, nil
}
// 返回客户价值列表
func (configService *ConfigService) ListCustomerValues(listCustomerValuesQuery *query.ListCustomerValuesQuery) (interface{}, error) {
if err := listCustomerValuesQuery.ValidateQuery(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
customerValues := map[int]string{
1: "口味",
2: "口感",
3: "色泽",
4: "卖相",
5: "包装",
6: "储存",
7: "运输",
8: "价格",
9: "应用",
10: "便利",
11: "交期",
12: "数量",
13: "账期",
14: "品质",
15: "新鲜度",
16: "推广",
17: "规格",
18: "人情关系",
19: "商务服务",
20: "售后服务",
21: "新品",
22: "品牌",
23: "合同",
}
return map[string]interface{}{
"customerValues": customerValues,
}, nil
}
func NewConfigService(options map[string]interface{}) *ConfigService {
newConfigService := &ConfigService{}
return newConfigService
}