class SysOssController extends AbstractController {

    private final SysOssService sysOssService;
    private final ICloudStorage iCloudStorage;

    /**
     * 列表
     */
    @GetMapping(value = "/list")
    public R list(@RequestParam Map<String, Object> params) {
        //查询列表数据
        QueryWrapper<SysOss> queryWrapper = new QueryWrapper<>();
        IPage<SysOss> pageList = sysOssService.page(mpPageConvert.<SysOss>pageParamConvert(params), queryWrapper);
        return R.ok().setData(pageList);
    }

    /**
     * 上传文件
     */
    @PostMapping(value = "/upload")
    public R upload(@RequestParam("file") MultipartFile file) throws Exception {
        if (file.isEmpty()) {
            throw new RRException("上传文件不能为空");
        }

        //上传文件
        String suffix = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
        String url = "";

        //保存文件信息
        SysOss ossEntity = new SysOss();
        ossEntity.setUrl(url);
        ossEntity.setCreateDate(new Date());
        sysOssService.save(ossEntity);

        return R.ok().put("url", url);
    }

    /**
     * 上传文件
     */
    @AuthIgnore
    @PostMapping(value = "/upload/apk")
    public R uploadApk(@RequestParam("file") MultipartFile file) {<FILL_FUNCTION_BODY>}


    /**
     * 删除
     */
    @PostMapping(value = "/delete")
    public R delete(@RequestBody Long[] ids) {
        sysOssService.removeByIds(Arrays.asList(ids));
        return R.ok();
    }

}

        if (file.isEmpty()) {
            return R.error("上传文件不能为空");
        }
        // 获取文件名
        String fileName = file.getOriginalFilename();
        // 获取文件后缀
        String prefix = fileName.substring(fileName.lastIndexOf("."));
        if (prefix == null || !prefix.equals(".apk")) {
            return R.error("只能上传APK文件");
        }

        TbApkVersion apkVersion = null;
        File tempFile = new File(fileName);
        try {
            FileUtils.copyInputStreamToFile(file.getInputStream(), tempFile);
            ApkFile apkFile = new ApkFile(tempFile);
            ApkMeta apkMeta = apkFile.getApkMeta();
            apkVersion = new TbApkVersion();
            apkVersion.setVersionCode(Math.toIntExact(apkMeta.getVersionCode()));
            apkVersion.setVersionName(apkMeta.getVersionName());
            apkVersion.setAppName(apkMeta.getLabel());
            apkVersion.setPackageName(apkMeta.getPackageName());
            apkVersion.setFileName(file.getOriginalFilename());
            apkVersion.setMd5Value(DigestUtil.md5Hex(tempFile));
            apkVersion.setFileSize(String.valueOf(tempFile.length()));

            //上传文件
            String suffix = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
            String url = iCloudStorage.uploadSuffix(file.getBytes(), suffix);

            //保存文件信息
            SysOss ossEntity = new SysOss();
            ossEntity.setUrl(url);
            ossEntity.setCreateDate(new Date());
            sysOssService.save(ossEntity);
            apkVersion.setDownloadUrl(url);


        } catch (Exception e) {
            log.error("文件上传失败:{}", e.getMessage());
            return R.error("文件上传失败");
        }
        tempFile.delete();
        return R.ok().setData(apkVersion);
    
<methods>public non-sealed void <init>() <variables>protected com.suke.czx.common.utils.MPPageConvert mpPageConvert,public com.fasterxml.jackson.databind.ObjectMapper objectMapper