🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
## 一、概述 实体中,设计blob存储二进制文件,修改或查看的时候,由于二进制过大,不宜直接丢给前端,因此,平台采用的是采用一个内部url映射的方式实现二进制的读取; ## 二、解决方案 举例,sysCorporation字段中,有四个blob字段,存储各种文件,需要进行修改或者查看的时候,需要能够在前端查看这些文件,那么,采用如下方式,动态对每个blob字段产生一个平台内部映射URL,通过该URL能够读取对应字段的文件; ``` @RayDynamicParseFieldOfBlob(modelPropertyName = "sysCorporation", entityClass = "SysCorporation", fieldName = "corporationLogo") @RayDynamicParseFieldOfBlob(modelPropertyName = "sysCorporation", entityClass = "SysCorporation", fieldName = "businessLicense") @RayDynamicParseFieldOfBlob(modelPropertyName = "sysCorporation", entityClass = "SysCorporation", fieldName = "contractAttach") @RayDynamicParseFieldOfBlob(modelPropertyName = "sysCorporation", entityClass = "SysCorporation", fieldName = "miscAttach") public ResponseEntity<ResponseObject> tomodify(@RequestHeader String rayAccessToken, @RequestParam(required = true) long domainId ``` 效果: ![](https://img.kancloud.cn/53/04/53047e0b8174d1826d3dee8206d10353_958x503.png)