/*
 * @description:标段用户关系
 * @Author: CP
 * @Date: 2020-10-22 16:00:19
 * @FilePath: \construction_management\web\viewmodels\bid_account.go
 */
package viewmodels

import validation "github.com/go-ozzo/ozzo-validation/v3"

type BidAccount struct {
	Id           string `form:"id" json:"id"`
	BidsectionId string `form:"bidsectionId" json:"bidsectionId"`
	ProjectId    string `form:"projectId" json:"projectId"`
	AccountId    string `form:"accountId" json:"accountId"`

	FolderId string `form:"folderId"`
}

func (l BidAccount) Validate() error {
	return validation.ValidateStruct(&l,
		// Code cannot be empty, and the length must between 5 and 50
		validation.Field(&l.BidsectionId, validation.Required.Error("标段ID不能为空")),
		validation.Field(&l.AccountId, validation.Required.Error("账号ID不能为空")),
		// validation.Field(&l.FolderId, validation.Required.Error("目录ID不能为空")),
		//validation.Field(&l.Password, validation.Required.Error("密码不能为空"), validation.Length(6, 50).Error("密码最少要输入 6 个字符")),
	)
}
