project_option.go 749 字节
package command

import (
	"github.com/beego/beego/v2/core/validation"
	"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
)

type StateProjectCommand struct {
	Id    int64 `cname:"项目ID" json:"id,string" valid:"Required"`
	State int   `cname:"项目状态" json:"state"`
}

type CopyProjectCommand struct {
	Id int64 `cname:"模板ID" json:"id,string" valid:"Required"`
}

func (in *StateProjectCommand) Valid(validation *validation.Validation) {
	switch in.State {
	case domain.ProjectStateWaitConfig, domain.ProjectStateWaitActive, domain.ProjectStateEnable, domain.ProjectStateDisable:
	default:
		validation.SetError("state", "状态设置错误")
		return
	}
}

func (in *CopyProjectCommand) Valid(*validation.Validation) {

}