/** * @ File: * @ Date: 2020/8/28 18:29 * @ Author: JYQ * @ Description: */ package model import ( "fmt" "time" "video_course/errors" ) type VFCodeCodeTypeEnum int const ( _ VFCodeCodeTypeEnum = iota VFCodeCodeTypeLogin ) func VFCodeCodeTypeFromInt(VFCodeCodeTypeInt int) VFCodeCodeTypeEnum { VFCodeCodeType := VFCodeCodeTypeEnum(VFCodeCodeTypeInt) switch VFCodeCodeType { case VFCodeCodeTypeLogin: default: panic(errors.NewParamErr(fmt.Errorf("vfCode"))) } return VFCodeCodeType } type VfCode struct { Id int Name string SendType int CodeType VFCodeCodeTypeEnum Code string Ip string CreateTime time.Time ExpireAt time.Time }