config.go 785 字节
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))
}