config.go
1.3 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
package protocol
/*GetConfigScore */
type GetConfigScoreRequest struct {
}
type GetConfigScoreResponse struct {
ScoreConfig
}
type ScoreConfig struct {
DiscoveryScore *DiscoveryScore `json:"discoveryScore"`
SumScore *SumScore `json:"sumScore"` //sumScore
BasicScore *ScoreRange `json:"basicScore"`
ExtraScore *ScoreRange `json:"extraScore"`
ValueScore *ScoreRange `json:"valueScore"`
}
//发现评分计算规则
type DiscoveryScore struct {
BasicFactor float64 `json:"basicFactor"` //基础分系数
ExtraFactor float64 `json:"extraFactor"` //附加分系数
ValueFactor float64 `json:"valueFactor"` //价值分系数
}
//总分计算规则
type SumScore struct {
DiscoveryFactor float64 `json:"discoveryFactor"` //发现分系数
CatchFactor float64 `json:"catchFactor"` //抓住分系数
}
type ScoreRange struct {
Min float64 `json:"min"` //最小分
Max float64 `json:"max"` //最大分
Step float64 `json:"step"` //步长
}
/*ServiceConfig 服务配置*/
type ServiceConfigRequest struct {
}
type ServiceConfigResponse struct {
ServeConfig *ServeConfig `json:"serveConfig"` //服务配置
}
type ServeConfig struct {
VodAddress string `json:"vodSvrAddress"` //视频服务地址
}
func (s *ServeConfig) SetVodAddress(addr string) *ServeConfig {
s.VodAddress = addr
return s
}