config.go 1.3 KB
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
}