ucenter.go 723 字节
package v1

import (
	"encoding/json"
	"gitlab.fjmaimaimai.com/mmm-go/gocomm/pkg/log"
	"opp/controllers"
	"opp/protocol"
	"opp/services/auth"
)

type UcenterController struct {
	controllers.BaseController
}

//UCenterLogin
//@router /login [post]
func (this *UcenterController) UCenterLogin() {
	var msg *protocol.ResponseMessage
	defer func() {
		this.Resp(msg)
	}()
	var request *protocol.UCenterLoginRequest
	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(auth.UCenterLogin(header, request))
}