command_create_client_version_request.go 930 字节
package client_version

import (
	"fmt"
	"github.com/astaxie/beego/validation"
	"gitlab.fjmaimaimai.com/mmm-go/godevp/pkg/domain"
)

type CreateClientVersionRequest struct {
	// 提交人
	//Commiter int64 `json:"commiter,omitempty"`
	// 项目名称
	ProjectName string `json:"projectName,omitempty"`
	// 版本号
	Version string `json:"version,omitempty"`
	// 标题
	Title string `json:"title,omitempty"`
	// 其他备注信息
	Remark string `json:"remark,omitempty"`
	// 客户端安装包信息
	ClientPackageInfo []*domain.ClientPackageInfo `json:"clientPackageInfo,omitempty"`
}

func (CreateClientVersionRequest *CreateClientVersionRequest) ValidateCommand() error {
	valid := validation.Validation{}
	b, err := valid.Valid(CreateClientVersionRequest)
	if err != nil {
		return err
	}
	if !b {
		for _, validErr := range valid.Errors {
			return fmt.Errorf("%s  %s", validErr.Key, validErr.Message)
		}
	}
	return nil
}