174 lines
3.1 KiB
Go
174 lines
3.1 KiB
Go
package request
|
|
|
|
import (
|
|
"errors"
|
|
"unicode/utf8"
|
|
)
|
|
|
|
type GetExamNoticeReq struct {
|
|
BaseRequest
|
|
}
|
|
|
|
type GetExaminerReq struct {
|
|
BasePageRequest
|
|
SkillId string
|
|
LevelId string
|
|
MapId string
|
|
Requirement string // single double
|
|
SearchKey string
|
|
}
|
|
|
|
func (r *GetExaminerReq) CheckParameter() error {
|
|
err := r.BasePageRequest.CheckParameter()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if r.SkillId == "" {
|
|
return errors.New("SkillId不能为空")
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type CreateExamOrderReq struct {
|
|
BaseRequest
|
|
ExaminerId string
|
|
ExamId string
|
|
}
|
|
|
|
func (r *CreateExamOrderReq) CheckParameter() error {
|
|
err := r.BaseRequest.CheckParameter()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if r.ExaminerId == "" {
|
|
return errors.New("ExaminerId不能为空")
|
|
}
|
|
if r.ExamId == "" {
|
|
return errors.New("ExamId不能为空")
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type GetExamOrderListReq struct {
|
|
BasePageRequest
|
|
}
|
|
|
|
func (r *GetExamOrderListReq) CheckParameter() error {
|
|
err := r.BasePageRequest.CheckParameter()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type SubmitExamOrderReviewReq struct {
|
|
BaseRequest
|
|
OrderNo string
|
|
StartTime string
|
|
EndTime string
|
|
Remark string
|
|
Url string
|
|
Desc string
|
|
VideoUrl string
|
|
}
|
|
|
|
func (r *SubmitExamOrderReviewReq) CheckParameter() error {
|
|
err := r.BaseRequest.CheckParameter()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if r.OrderNo == "" {
|
|
return errors.New("OrderNo不能为空")
|
|
}
|
|
if r.StartTime == "" {
|
|
return errors.New("StartTime不能为空")
|
|
}
|
|
if r.EndTime == "" {
|
|
return errors.New("EndTime不能为空")
|
|
}
|
|
if utf8.RuneCountInString(r.Remark) > 300 {
|
|
return errors.New("Remark不能超过300字")
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type CompleteExamOrderReq struct {
|
|
BaseRequest
|
|
OrderNo string
|
|
}
|
|
|
|
func (r *CompleteExamOrderReq) CheckParameter() error {
|
|
err := r.BaseRequest.CheckParameter()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if r.OrderNo == "" {
|
|
return errors.New("OrderNo不能为空")
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type ExamImg struct {
|
|
Url string
|
|
Desc string
|
|
}
|
|
|
|
type GetExamReq struct {
|
|
BaseRequest
|
|
SkillId string
|
|
LevelId string
|
|
MapId string
|
|
Requirement string // single double
|
|
}
|
|
|
|
func (r *GetExamReq) CheckParameter() error {
|
|
err := r.BaseRequest.CheckParameter()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if r.SkillId == "" {
|
|
return errors.New("SkillId不能为空")
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type ApplyExamOrderCustomerServiceReq struct {
|
|
BaseRequest
|
|
OrderNo string
|
|
Reason string
|
|
}
|
|
|
|
func (r *ApplyExamOrderCustomerServiceReq) CheckParameter() error {
|
|
err := r.BaseRequest.CheckParameter()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if r.OrderNo == "" {
|
|
return errors.New("OrderNo不能为空")
|
|
}
|
|
if utf8.RuneCountInString(r.Reason) > 100 {
|
|
return errors.New("Reason不能超过100字")
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type RateExamOrderReq struct {
|
|
BaseRequest
|
|
OrderNo string
|
|
Content string
|
|
}
|
|
|
|
func (r *RateExamOrderReq) CheckParameter() error {
|
|
err := r.BaseRequest.CheckParameter()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if r.OrderNo == "" {
|
|
return errors.New("OrderNo不能为空")
|
|
}
|
|
if utf8.RuneCountInString(r.Content) > 100 {
|
|
return errors.New("Content不能超过100字")
|
|
}
|
|
return nil
|
|
}
|