config.go
766 字节
package v1
import (
"encoding/json"
"opp/controllers"
"opp/protocol"
"opp/services/config"
"gitlab.fjmaimaimai.com/mmm-go/gocomm/pkg/log"
)
//BulletinController 公告
type ConfigController struct {
controllers.BaseController
}
//GetConfigScore
//@router /score/get [post]
func (this *ConfigController) GetConfigScore() {
var msg *protocol.ResponseMessage
defer func() {
this.Resp(msg)
}()
var request *protocol.GetConfigScoreRequest
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.GetConfigScore(header, request))
}