status_partner_info.go 580 字节
package command

import (
	"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/domain"
	"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/lib"
)

type StatusPartnerInfoCommand struct {
	// 合伙人ID
	Id     int64 `json:"id"`
	Status int   `json:"status"`
}

func (command *StatusPartnerInfoCommand) ValidateCommand() error {
	if !(command.Status == domain.PARTNER_STATUS_NO || command.Status == domain.PARTNER_STATUS_YES) {
		return lib.ThrowError(lib.ARG_ERROR, "合伙人状态错误")
	}
	if command.Id == 0 {
		return lib.ThrowError(lib.ARG_ERROR, "合伙人id错误")
	}
	return nil
}