审查视图

pkg/application/evaluation_cycle/command/cycle_query.go 1.1 KB
郑周 authored
1 2 3 4 5
package command

import "github.com/beego/beego/v2/core/validation"

type QueryCycleCommand struct {
6 7
	CompanyId  int64  `cname:"公司ID" json:"companyId"`
	Name       string `cname:"周期名称" json:"name"`
郑周 authored
8 9
	PageNumber int64  `cname:"分页页码" json:"pageNumber" valid:"Required"`
	PageSize   int64  `cname:"分页数量" json:"pageSize" valid:"Required"`
郑周 authored
10 11
}
12 13 14 15 16 17 18 19 20 21
type StatisticCycleProjectUserCommand struct {
	CompanyId int64 `cname:"公司ID" json:"companyId"`
	CycleId   int64 `cname:"周期ID" json:"cycleId,string"`
}

type CycleTemplateListCommand struct {
	CycleId int64 `cname:"周期ID" json:"cycleId,string" valid:"Required"`
}

type CycleTemplateCommand struct {
郑周 authored
22
	Id int64 `cname:"模板ID" json:"id,string" valid:"Required"`
23 24
}
郑周 authored
25 26 27 28 29 30
func (in *QueryCycleCommand) Valid(validation *validation.Validation) {
	if in.CompanyId == 0 {
		validation.SetError("companyId", "公司ID无效")
		return
	}
}
郑周 authored
31 32 33 34

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

}
35
36 37
func (in *CycleTemplateListCommand) Valid(*validation.Validation) {
38 39 40 41 42
}

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

}