github.com/SupenBysz/gf-admin-community@v0.7.4/sys_model/sys_file.go (about) 1 package sys_model 2 3 import ( 4 "github.com/SupenBysz/gf-admin-community/sys_model/sys_entity" 5 "github.com/gogf/gf/v2/net/ghttp" 6 "github.com/gogf/gf/v2/os/gtime" 7 ) 8 9 // FileUploadInput 上传文件输入参数 10 type FileUploadInput struct { 11 File *ghttp.UploadFile `json:"sys_file" dc:"请选择文件,以form-data方式提交"` // 上传文件对象 12 Name string `json:"name" dc:"自定义文件名"` // 自定义文件名称 13 RandomName bool `json:"randomName" dc:"是否随机文件名" default:"true"` // 是否随机命名文件 14 } 15 16 type FileInfo struct { 17 sys_entity.SysFile 18 ExpiresAt *gtime.Time 19 } 20 21 type UploadFile sys_entity.SysFile 22 23 // OCRIDCardFileUploadInput 上传身份证请求参数 24 type OCRIDCardFileUploadInput struct { 25 FileUploadInput 26 DetectRisk string `json:"detectRisk" default:"false" v:"in:true,false" dc:"是否开启身份证风险类型(身份证复印件、临时身份证、身份证翻拍、修改过的身份证)检测功能,默认不开启"` 27 IDCardSide string `json:"idCardSide" default:"front" v:"in:front,back#参数错误|正反面参数错误" dc:"front身份证含照片的一面,back身份证带国徽的一面,自动检测身份证正反面,如果传参指定方向与图片相反,支持正常识别,返回参数image_status字段为 reversed_side "` 28 } 29 30 // IDCardWithOCR 身份证识别响应信息 31 type IDCardWithOCR struct { 32 sys_entity.SysFile 33 BaiduSdkOCRIDCard 34 // OCRBusinessLicense OCRBusinessLicense `json:"orcBusinessLicense" dc:"营业执照识别的信息"` 35 } 36 37 // OCRBusinessLicense 上传新版营业执照 38 type OCRBusinessLicense struct { 39 FileUploadInput 40 } 41 42 // BusinessLicenseWithOCR 营业执照识别响应信息 43 type BusinessLicenseWithOCR struct { 44 sys_entity.SysFile 45 BusinessLicenseOCR 46 } 47 48 // BankCardWithOCRInput 上传银行卡请求参数 49 type BankCardWithOCRInput struct { 50 FileUploadInput 51 } 52 53 // BankCardWithOCR 银行卡识别响应信息 54 type BankCardWithOCR struct { 55 // 上传文件返回数据 56 sys_entity.SysFile 57 58 // SDK返回的识别数据 59 BaiduSdkOCRBankCard 60 } 61 62 // PictureWithOCRInput 上传图片 63 type PictureWithOCRInput struct { 64 FileUploadInput 65 ImageType uint64 `json:"imageType" dc:"图片类型:0静态图片,1GIF动态图片(仅对首帧进行审核)" default:"0" v:"in:0,1#请选择正确的数据范围"` 66 } 67 68 // PictureWithOCR 图片审核响应信息 69 type PictureWithOCR struct { 70 sys_entity.SysFile 71 Conclusion string `json:"conclusion" dc:"审核结果,可取值描述:合规、不合规、疑似、审核失败"` 72 ConclusionType int `json:"conclusionType" dc:"审核结果类型,可取值1、2、3、4,分别代表1:合规,2:不合规,3:疑似,4:审核失败:"` 73 Data []DescriptionData `json:"data" dc:"不合规/疑似/命中白名单项详细信息。响应成功并且conclusion为疑似或不合规或命中白名单时才返回,响应失败或conclusion为合规且未命中白名单时不返回。"` 74 } 75 76 // DescriptionData 图片审核描述 77 type DescriptionData struct { 78 Type int `json:"type"` 79 SubType int `json:"subType"` 80 Conclusion string `json:"conclusion" dc:"审核结果,可取值描述:合规、不合规、疑似、审核失败"` 81 ConclusionType int `json:"conclusionType" dc:"审核结果类型,可取值1、2、3、4,分别代表1:合规,2:不合规,3:疑似,4:审核失败:"` 82 Msg string `json:"msg"` 83 }