作者 yangfu

增加 服务配置接口

... ... @@ -43,4 +43,7 @@ h5_host = "http://mmm-web-open-test.fjmaimaimai.com"
suplus_approve_host ="http://suplus-approve-dev.fjmaimaimai.com"
#阿里云
cname ="https://media.fjmaimaimai.com/"
\ No newline at end of file
cname ="https://media.fjmaimaimai.com/"
#服务地址
VOD_SVR_ADDRESS ="http://mmm-open-api-dev.fjmaimaimai.com"
\ No newline at end of file
... ...
... ... @@ -47,4 +47,7 @@ suplus_approve_host ="http://suplus-approve-dev.fjmaimaimai.com"
cname ="https://media.fjmaimaimai.com/"
#企业平台
BUSINESS_ADMIN_SERVICE_HOST ="${BUSINESS_ADMIN_SERVICE_HOST||http://suplus-business-admin-test.fjmaimaimai.com}"
\ No newline at end of file
BUSINESS_ADMIN_SERVICE_HOST ="${BUSINESS_ADMIN_SERVICE_HOST||http://suplus-business-admin-test.fjmaimaimai.com}"
#服务地址
VOD_SVR_ADDRESS ="http://mmm-open-api-dev.fjmaimaimai.com"
\ No newline at end of file
... ...
... ... @@ -46,4 +46,7 @@ suplus_approve_host ="https://public-interface.fjmaimaimai.com/approve"
BUSINESS_ADMIN_SERVICE_HOST ="${BUSINESS_ADMIN_SERVICE_HOST||http://suplus-business-admin-prd.fjmaimaimai.com}"
#阿里云
cname ="https://media.fjmaimaimai.com/"
\ No newline at end of file
cname ="https://media.fjmaimaimai.com/"
#服务地址
VOD_SVR_ADDRESS ="http://mmm-open-api-prd.fjmaimaimai.com"
\ No newline at end of file
... ...
... ... @@ -46,4 +46,7 @@ suplus_approve_host ="http://suplus-approve-test.fjmaimaimai.com"
cname ="https://media.fjmaimaimai.com/"
#企业平台
BUSINESS_ADMIN_SERVICE_HOST ="${BUSINESS_ADMIN_SERVICE_HOST||http://suplus-business-admin-test.fjmaimaimai.com}"
\ No newline at end of file
BUSINESS_ADMIN_SERVICE_HOST ="${BUSINESS_ADMIN_SERVICE_HOST||http://suplus-business-admin-test.fjmaimaimai.com}"
#服务地址
VOD_SVR_ADDRESS ="http://mmm-open-api-test.fjmaimaimai.com"
\ No newline at end of file
... ...
... ... @@ -34,3 +34,24 @@ func (this *ConfigController) GetConfigScore() {
header := controllers.GetRequestHeader(this.Ctx)
msg = protocol.NewReturnResponse(config.GetConfigScore(header, request))
}
//ServiceConfig 服务配置
//@router /service [post]
func (this *ConfigController) ServiceConfig() {
var msg *protocol.ResponseMessage
defer func() {
this.Resp(msg)
}()
var request *protocol.ServiceConfigRequest
if err := json.Unmarshal(this.ByteBody, &request); err != nil {
log.Error(err)
msg = protocol.BadRequestParam(1)
return
}
if b, m := this.Valid(request); !b {
msg = m
return
}
header := controllers.GetRequestHeader(this.Ctx)
msg = protocol.NewReturnResponse(config.ServiceConfig(header, request))
}
... ...
... ... @@ -32,3 +32,19 @@ type ScoreRange struct {
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
}
... ...
... ... @@ -407,6 +407,14 @@ func init() {
MethodParams: param.Make(),
Params: nil})
beego.GlobalControllerRouter["opp/controllers/v1:ConfigController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ConfigController"],
beego.ControllerComments{
Method: "ServiceConfig",
Router: `/service`,
AllowHTTPMethods: []string{"post"},
MethodParams: param.Make(),
Params: nil})
beego.GlobalControllerRouter["opp/controllers/v1:DepartmentController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:DepartmentController"],
beego.ControllerComments{
Method: "Departments",
... ...
... ... @@ -2,6 +2,7 @@ package config
import (
"encoding/json"
"github.com/astaxie/beego"
"gitlab.fjmaimaimai.com/mmm-go/gocomm/pkg/log"
"opp/models"
"opp/protocol"
... ... @@ -22,3 +23,13 @@ func GetConfigScore(header *protocol.RequestHeader, request *protocol.GetConfigS
}
return
}
//ServiceConfig 服务配置
func ServiceConfig(header *protocol.RequestHeader, request *protocol.ServiceConfigRequest) (rsp *protocol.ServiceConfigResponse, err error) {
var ()
rsp = &protocol.ServiceConfigResponse{
ServeConfig: new(protocol.ServeConfig),
}
rsp.ServeConfig.SetVodAddress(beego.AppConfig.String("VOD_SVR_ADDRESS"))
return
}
... ...