package constvar type BaseOperationType int const ( BaseOperationTypeIncoming BaseOperationType = iota + 1 //收货 BaseOperationTypeOutgoing //交货 BaseOperationTypeInternal //内部调拨 ) func (slf BaseOperationType) IsValid() bool { return slf == BaseOperationTypeIncoming || slf == BaseOperationTypeOutgoing || slf == BaseOperationTypeInternal } type ReservationMethod int const ( ReservationMethodAtConfirm ReservationMethod = iota + 1 //在确认时 ReservationMethodManual //手动 ReservationMethodByDate //在预定日期之前 ) func (slf ReservationMethod) IsValid() bool { return slf == ReservationMethodAtConfirm || slf == ReservationMethodManual || slf == ReservationMethodByDate } type WhetherType int const ( WhetherTypeAsk WhetherType = iota + 1 //询问 WhetherTypeAlways //总是 ReservationNever //从不 ) func (slf WhetherType) IsValid() bool { return slf == WhetherTypeAsk || slf == WhetherTypeAlways || slf == ReservationNever }