partner.go 819 字节
package controllers

import (
	"github.com/tiptok/gocomm/pkg/log"
	"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/application/partner"
	"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/protocol"
	protocolx "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/protocol/partner"
)

type PartnerController struct {
	BaseController
}

// Detail
// 测试
func (this *PartnerController) Detail() {
	var msg *protocol.ResponseMessage
	defer func() {
		this.Resp(msg)
	}()
	var request *protocolx.DetailRequest
	if err := this.JsonUnmarshal(&request); err != nil {
		msg = protocol.BadRequestParam(1)
		return
	}
	if b, m := this.Valid(request); !b {
		msg = m
		return
	}
	header := this.GetRequestHeader(this.Ctx)
	data, err := partner.Detail(header, request)
	if err != nil {
		log.Error(err)
	}
	msg = protocol.NewReturnResponse(data, err)
}