huanghongfa
2021-07-27 973caebefdd691d45108d56fc96b9aa2e5fc6fe8
springcloud_k8s_panzhihuazhihuishequ/grid_app/src/main/java/com/panzhihua/grid_app/api/CommonApi.java
@@ -2,6 +2,7 @@
import com.panzhihua.common.constants.FtpConstants;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.service.community.CommunityService;
import com.panzhihua.common.utlis.SFTPUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -45,6 +46,9 @@
    private int port;
    @Value("${ftp.url}")
    private String url;
    @Resource
    private CommunityService communityService;
    /**
     * 允许的图片文件后缀
@@ -94,7 +98,7 @@
            log.info("临时文件删除【{}】", delete);
            sftp.uploadMore(FtpConstants.FTPFILEPATH_IDCARD, name, is);
            sftp.logout();
            return R.ok(url + "/idcard/" + name);
            return R.ok(url + "idcard/" + name);
        } catch (Exception e) {
            log.error("上传照片失败【{}】", e.getMessage());
            return R.fail();
@@ -141,7 +145,7 @@
                boolean delete = file1.delete();
                log.info("临时文件删除【{}】", delete);
                sftp.uploadMore(FtpConstants.FTPFILEPATH_IDCARD, name, is);
                urlList.add(url + "/idcard/" + name);
                urlList.add(url + "idcard/" + name);
            } catch (Exception e) {
                log.error("上传文件失败【{}】", e.getMessage());
                return R.fail();
@@ -150,4 +154,10 @@
        sftp.logout();
        return R.ok(urlList);
    }
    @GetMapping("/getConf/noToken")
    @ApiOperation(value = "根据code查询系统配置")
    public R getConf(@RequestParam("code") String code){
        return communityService.getConf(code);
    }
}