package forms

import "errors"

type PeripheralsReceiveCdk struct {
	Sn     string `json:"sn"   form:"sn"`
	OpenId string `json:"openId"   form:"openId"`
}

func (req *PeripheralsReceiveCdk) Check() error {
	if len(req.Sn) < 1 {
		return errors.New("活动编号不能为空！")
	}
	if len(req.OpenId) < 8 {
		return errors.New("openid不能为空或无效！")
	}
	return nil
}
