Browse Source

1.公司设置接口调整
2.文件服务API修改,处理调用报错

chenw 7 years ago
parent
commit
9334e88cf6

+ 2 - 3
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java

@@ -114,7 +114,7 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
         }else{
             String oldCode = getMapper().getCodeById(product.getId());
             if (!product.getPr_code().equals(oldCode)){
-                validEnableUpdate(product.getId());
+                validEnableUpdateCode(product.getId());
             }
             //物料发生过除库存初始化外的出入库单时,不能新增,修改,删除
             validProductOperation(product.getId(), BizExceptionCode.BIZ_RELDELETE_UPDATEPROD);
@@ -290,7 +290,6 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
 
     @Override
     public DocBaseDTO close(Long id) {
-        validEnableUpdate(id);
         DocBaseDTO docBaseDTO = null;
         if(id != null && id > 0){
             String code = getMapper().getCodeById(id);
@@ -415,7 +414,7 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
      * 校验是否存在关联单据,不存在时才允许更新物料编号
      * @param id
      */
-    private void validEnableUpdate(Long id){
+    private void validEnableUpdateCode(Long id){
         int count = 0;
         //采购
         count = getMapper().getCountFromPurc(id, BaseContextHolder.getCompanyId());

+ 4 - 0
base-servers/account/account-dto/pom.xml

@@ -22,6 +22,10 @@
             <groupId>com.usoftchina.saas</groupId>
             <artifactId>commons-dto</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>file-dto</artifactId>
+        </dependency>
     </dependencies>
 
 </project>

+ 39 - 0
base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/CompanyDTO.java

@@ -1,8 +1,11 @@
 package com.usoftchina.saas.account.dto;
 
+import com.usoftchina.saas.file.dto.FileInfoDTO;
 import io.swagger.annotations.ApiModel;
 
 import java.io.Serializable;
+import java.util.List;
+import java.util.Map;
 
 /**
  * @author yingp
@@ -21,6 +24,42 @@ public class CompanyDTO implements Serializable{
     private String businessCode;
     private String address;
     private String logoUrl;
+    private String tel;
+    private String fax;
+    private String signet;      //电子章
+    private List<Map<String, FileInfoDTO>> fileInfoList;
+
+    public List<Map<String, FileInfoDTO>> getFileInfoList() {
+        return fileInfoList;
+    }
+
+    public void setFileInfoList(List<Map<String, FileInfoDTO>> fileInfoList) {
+        this.fileInfoList = fileInfoList;
+    }
+
+    public String getTel() {
+        return tel;
+    }
+
+    public void setTel(String tel) {
+        this.tel = tel;
+    }
+
+    public String getFax() {
+        return fax;
+    }
+
+    public void setFax(String fax) {
+        this.fax = fax;
+    }
+
+    public String getSignet() {
+        return signet;
+    }
+
+    public void setSignet(String signet) {
+        this.signet = signet;
+    }
 
     public Long getId() {
         return id;

+ 41 - 5
base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/CompanyRegDTO.java

@@ -10,6 +10,7 @@ import java.io.Serializable;
  */
 @ApiModel(value = "CompanyReg", description = "公司注册信息")
 public class CompanyRegDTO implements Serializable{
+    private Long id;
     /**
      * 唯一名称
      */
@@ -19,7 +20,42 @@ public class CompanyRegDTO implements Serializable{
      */
     private String businessCode;
     private String address;
-    private String logoUrl;
+    private String logoId;
+    private String tel;
+    private String fax;
+    private String signet;      //电子章
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getTel() {
+        return tel;
+    }
+
+    public void setTel(String tel) {
+        this.tel = tel;
+    }
+
+    public String getFax() {
+        return fax;
+    }
+
+    public void setFax(String fax) {
+        this.fax = fax;
+    }
+
+    public String getSignet() {
+        return signet;
+    }
+
+    public void setSignet(String signet) {
+        this.signet = signet;
+    }
 
     public String getName() {
         return name;
@@ -46,11 +82,11 @@ public class CompanyRegDTO implements Serializable{
     }
 
     public String getLogoUrl() {
-        return logoUrl;
+        return logoId;
     }
 
-    public void setLogoUrl(String logoUrl) {
-        this.logoUrl = logoUrl;
+    public void setLogoUrl(String logoId) {
+        this.logoId = logoId;
     }
 
     @Override
@@ -59,7 +95,7 @@ public class CompanyRegDTO implements Serializable{
                 "name='" + name + '\'' +
                 ", businessCode='" + businessCode + '\'' +
                 ", address='" + address + '\'' +
-                ", logoUrl='" + logoUrl + '\'' +
+                ", logoUrl='" + logoId + '\'' +
                 '}';
     }
 }

+ 12 - 0
base-servers/account/account-server/pom.xml

@@ -21,10 +21,18 @@
             <groupId>com.usoftchina.saas</groupId>
             <artifactId>account-api</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>file-api</artifactId>
+        </dependency>
         <dependency>
             <groupId>com.usoftchina.saas</groupId>
             <artifactId>auth-client</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>file-dto</artifactId>
+        </dependency>
         <!-- db -->
         <dependency>
             <groupId>mysql</groupId>
@@ -34,6 +42,10 @@
             <groupId>org.mybatis.spring.boot</groupId>
             <artifactId>mybatis-spring-boot-starter</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper-spring-boot-starter</artifactId>
+        </dependency>
         <!-- sleuth -->
         <dependency>
             <groupId>org.springframework.cloud</groupId>

+ 2 - 0
base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/AccountApplication.java

@@ -5,6 +5,7 @@ import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
+import org.springframework.cloud.openfeign.EnableFeignClients;
 import org.springframework.transaction.annotation.EnableTransactionManagement;
 
 /**
@@ -13,6 +14,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
  */
 @SpringBootApplication
 @EnableEurekaClient
+@EnableFeignClients("com.usoftchina.saas")
 @EnableTransactionManagement
 @MapperScan(basePackages = "com.usoftchina.saas.account.mapper")
 @EnableAuthClient

+ 12 - 0
base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/controller/CompanyController.java

@@ -7,10 +7,14 @@ import com.usoftchina.saas.account.service.CompanyService;
 import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.exception.ExceptionCode;
+import com.usoftchina.saas.file.dto.FileInfoDTO;
 import com.usoftchina.saas.utils.BeanMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * @author yingp
  * @date 2018/10/2
@@ -46,6 +50,12 @@ public class CompanyController {
         return Result.success();
     }
 
+    @PostMapping("/save")
+    public Result save(@RequestBody CompanyRegDTO companyRegDTO){
+        companyService.update(companyRegDTO);
+        return Result.success();
+    }
+
     /**
      * 按名称查找
      *
@@ -86,8 +96,10 @@ public class CompanyController {
     @GetMapping(path = "/read/current")
     public Result<CompanyDTO> getCurrentCompany() {
         Company company = companyService.findByPrimaryKey(BaseContextHolder.getCompanyId());
+        List<Map<String, FileInfoDTO>> fileInfoList = companyService.getFileByCompany(company);
         if (null != company) {
             CompanyDTO companyDTO = BeanMapper.map(company, CompanyDTO.class);
+            companyDTO.setFileInfoList(fileInfoList);
             return Result.success(companyDTO);
         }
         return Result.error(ExceptionCode.COMPANY_NOT_EXIST);

+ 7 - 1
base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/mapper/CompanyMapper.java

@@ -1,5 +1,6 @@
 package com.usoftchina.saas.account.mapper;
 
+import com.usoftchina.saas.account.dto.CompanyRegDTO;
 import com.usoftchina.saas.account.po.Company;
 import com.usoftchina.saas.account.vo.CompanyBaseVO;
 import org.apache.ibatis.annotations.Param;
@@ -67,5 +68,10 @@ public interface CompanyMapper {
      */
     int deleteByPrimaryKey(@Param("id") Long id);
 
-
+    /**
+     * 更新
+     * @param companyRegDTO
+     * @return
+     */
+    int updateByPrimaryKeySelective(CompanyRegDTO companyRegDTO);
 }

+ 37 - 0
base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/po/Company.java

@@ -24,6 +24,43 @@ public class Company implements Serializable {
      * 企业logo
      */
     private String logoUrl;
+    private String tel;
+    private String fax;
+    private String signet;
+    private String uu;
+
+    public String getTel() {
+        return tel;
+    }
+
+    public void setTel(String tel) {
+        this.tel = tel;
+    }
+
+    public String getFax() {
+        return fax;
+    }
+
+    public void setFax(String fax) {
+        this.fax = fax;
+    }
+
+    public String getSignet() {
+        return signet;
+    }
+
+    public void setSignet(String signet) {
+        this.signet = signet;
+    }
+
+    public String getUu() {
+        return uu;
+    }
+
+    public void setUu(String uu) {
+        this.uu = uu;
+    }
+
     protected Date createTime;
     protected long creatorId;
     protected Date updateTime;

+ 17 - 0
base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/service/CompanyService.java

@@ -1,9 +1,12 @@
 package com.usoftchina.saas.account.service;
 
+import com.usoftchina.saas.account.dto.CompanyRegDTO;
 import com.usoftchina.saas.account.po.Company;
 import com.usoftchina.saas.account.vo.CompanyBaseVO;
+import com.usoftchina.saas.file.dto.FileInfoDTO;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author yingp
@@ -42,6 +45,14 @@ public interface CompanyService {
      */
     Company findByPrimaryKey(Long id);
 
+    /**
+     * 查找公司的附件信息
+     *
+     * @param company
+     * @return
+     */
+    List<Map<String,FileInfoDTO>> getFileByCompany(Company company);
+
     /**
      * 按个人账户查找全部绑定企业
      *
@@ -73,4 +84,10 @@ public interface CompanyService {
      * @param appId
      */
     void unbindApp(long companyId, String appId);
+
+    /**
+     * 更新公司信息
+     * @param companyRegDTO
+     */
+    void update(CompanyRegDTO companyRegDTO);
 }

+ 29 - 2
base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/service/impl/CompanyServiceImpl.java

@@ -1,5 +1,6 @@
 package com.usoftchina.saas.account.service.impl;
 
+import com.usoftchina.saas.account.dto.CompanyRegDTO;
 import com.usoftchina.saas.account.mapper.AccountCompanyMapper;
 import com.usoftchina.saas.account.mapper.CompanyAppMapper;
 import com.usoftchina.saas.account.mapper.CompanyMapper;
@@ -7,12 +8,14 @@ import com.usoftchina.saas.account.po.Company;
 import com.usoftchina.saas.account.service.CompanyService;
 import com.usoftchina.saas.account.vo.CompanyBaseVO;
 import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.file.api.FileApi;
+import com.usoftchina.saas.file.dto.FileInfoDTO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.StringUtils;
 
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 
 /**
  * @author yingp
@@ -30,6 +33,9 @@ public class CompanyServiceImpl implements CompanyService{
     @Autowired
     private CompanyAppMapper companyAppMapper;
 
+    @Autowired
+    private FileApi fileApi;
+
     @Override
     public boolean save(Company company) {
         Date nowDate = new Date();
@@ -41,6 +47,13 @@ public class CompanyServiceImpl implements CompanyService{
         return companyMapper.insert(company) > 0;
     }
 
+    @Override
+    public void update(CompanyRegDTO companyRegDTO){
+        if (companyRegDTO.getId() > 0) {
+            companyMapper.updateByPrimaryKeySelective(companyRegDTO);
+        }
+    }
+
     @Override
     public Company findByName(String name) {
         return companyMapper.selectByName(name);
@@ -56,6 +69,20 @@ public class CompanyServiceImpl implements CompanyService{
         return companyMapper.selectByPrimaryKey(id);
     }
 
+    @Override
+    public List<Map<String, FileInfoDTO>> getFileByCompany(Company company){
+        List<Map<String,FileInfoDTO>> fileInfoList = new ArrayList<Map<String, FileInfoDTO>>();
+        Map<String, FileInfoDTO> fileInfoMap = new HashMap<String, FileInfoDTO>();
+        if (!StringUtils.isEmpty(company.getLogoUrl())){
+            fileInfoMap.put("logo", fileApi.getFileInfoByPath(company.getLogoUrl()).getData());
+        }
+        if (!StringUtils.isEmpty(company.getSignet())){
+            fileInfoMap.put("signet", fileApi.getFileInfoByPath(company.getSignet()).getData());
+        }
+        fileInfoList.add(fileInfoMap);
+        return fileInfoList;
+    }
+
     @Override
     public List<CompanyBaseVO> findBaseByAccountId(Long accountId) {
         return companyMapper.selectBaseByAccountId(accountId);

+ 31 - 3
base-servers/account/account-server/src/main/resources/mapper/CompanyMapper.xml

@@ -10,6 +10,11 @@
         <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
         <result column="updater_id" jdbcType="BIGINT" property="updaterId"/>
         <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
+        <result column="fax" jdbcType="VARCHAR" property="fax"/>
+        <result column="tel" jdbcType="VARCHAR" property="tel"/>
+        <result column="signet" jdbcType="VARCHAR" property="signet"/>
+        <result column="uu" jdbcType="VARCHAR" property="uu"/>
+        <result column="logo_url" jdbcType="VARCHAR" property="logoUrl"/>
     </resultMap>
     <resultMap id="BaseResultMap" type="com.usoftchina.saas.account.vo.CompanyBaseVO">
         <id column="id" jdbcType="BIGINT" property="id"/>
@@ -17,14 +22,16 @@
         <result column="logo_url" jdbcType="VARCHAR" property="logoUrl"/>
     </resultMap>
     <sql id="baseColumns">
-        id,name,business_code,address,creator_id,create_time,updater_id,update_time
+        id,name,business_code,address,creator_id,create_time,updater_id,update_time,fax,tel,signet,uu,logo_url
     </sql>
     <insert id="insert" parameterType="com.usoftchina.saas.account.po.Company"
             useGeneratedKeys="true" keyProperty="id">
-        insert into ac_company(name, business_code, address, logo_url, creator_id, create_time, updater_id, update_time)
+        insert into ac_company(name, business_code, address, logo_url, creator_id, create_time, updater_id, update_time,
+        tel, fax, signet, uu)
         values (#{name,jdbcType=VARCHAR}, #{businessCode,jdbcType=VARCHAR},
         #{address,jdbcType=VARCHAR}, #{logoUrl,jdbcType=VARCHAR}, #{creatorId,jdbcType=BIGINT},
-        #{createTime,jdbcType=TIMESTAMP}, #{updaterId,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP})
+        #{createTime,jdbcType=TIMESTAMP}, #{updaterId,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP},
+        #{tel,jdbcType=VARCHAR}, #{fax,jdbcType=VARCHAR}, #{signet,jdbcType=VARCHAR}, #{uu,jdbcType=VARCHAR})
     </insert>
     <insert id="insertSelective" parameterType="com.usoftchina.saas.account.po.Company"
             useGeneratedKeys="true" keyProperty="id">
@@ -98,4 +105,25 @@
     <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
         delete from ac_company where id=#{id,jdbcType=BIGINT}
     </delete>
+    <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.account.po.Company">
+        UPDATE ac_company
+        <set>
+            <if test="address != null">
+                address = #{address,jdbcType=VARCHAR},
+            </if>
+            <if test="logoUrl != null">
+                logo_url = #{logoUrl,jdbcType=VARCHAR},
+            </if>
+            <if test="tel != null">
+                tel = #{tel,jdbcType=VARCHAR},
+            </if>
+            <if test="fax != null">
+                fax = #{fax,jdbcType=VARCHAR},
+            </if>
+            <if test="signet != null">
+                signet = #{signet,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where id = #{id}
+    </update>
 </mapper>

+ 13 - 13
base-servers/file/file-api/src/main/java/com/usoftchina/saas/file/api/FileApi.java

@@ -39,7 +39,7 @@ public interface FileApi {
      * @return
      */
     @PostMapping(value = "/folder")
-    Result<FolderDTO> createFolder(FolderSaveDTO newFolder);
+    Result<FolderDTO> createFolder(@RequestBody FolderSaveDTO newFolder);
 
     /**
      * 根据id查看文件详情
@@ -57,7 +57,7 @@ public interface FileApi {
      * @return
      */
     @GetMapping(value = "/info")
-    Result<FileInfoDTO> getFileInfoByPath(@RequestParam String path);
+    Result<FileInfoDTO> getFileInfoByPath(@RequestParam("path") String path);
 
     /**
      * 查看子文件
@@ -66,7 +66,7 @@ public interface FileApi {
      * @return
      */
     @GetMapping(value = "/list")
-    Result<List<FileInfoDTO>> listFiles(Long folderId);
+    Result<List<FileInfoDTO>> listFiles(@RequestParam("folderId") Long folderId);
 
     /**
      * 上传文件到指定文件夹
@@ -77,7 +77,7 @@ public interface FileApi {
      * @throws Exception
      */
     @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
-    Result<FileInfoDTO> upload(Long folderId, @RequestPart(value = "file") MultipartFile file) throws Exception;
+    Result<FileInfoDTO> upload(@RequestParam("folderId") Long folderId, @RequestPart(value = "file") MultipartFile file) throws Exception;
 
     /**
      * 文件下载
@@ -86,7 +86,7 @@ public interface FileApi {
      * @return
      */
     @GetMapping(value = "/download/{id}")
-    byte[] download(@PathVariable Long id);
+    byte[] download(@PathVariable("id") Long id);
 
     /**
      * 文件下载
@@ -95,7 +95,7 @@ public interface FileApi {
      * @return
      */
     @GetMapping(value = "/download")
-    byte[] downloadByPath(@RequestParam String path);
+    byte[] downloadByPath(@RequestParam("path") String path);
 
     /**
      * 删除文件
@@ -105,8 +105,8 @@ public interface FileApi {
      * @return
      */
     @GetMapping(value = "/delete/{id}")
-    Result delete(@PathVariable Long id,
-                  @RequestParam(required = false, defaultValue = "false") Boolean purge);
+    Result delete(@PathVariable("id") Long id,
+                  @RequestParam(required = false, defaultValue = "false", value = "purge") Boolean purge);
 
     /**
      * 删除文件
@@ -116,8 +116,8 @@ public interface FileApi {
      * @return
      */
     @GetMapping(value = "/delete")
-    Result deleteByPath(@PathVariable Long id,
-                  @RequestParam(required = false, defaultValue = "false") Boolean purge);
+    Result deleteByPath(@PathVariable("id") Long id,
+                  @RequestParam(required = false, defaultValue = "false", value = "purge") Boolean purge);
 
     /**
      * 还原文件
@@ -126,7 +126,7 @@ public interface FileApi {
      * @return
      */
     @GetMapping(value = "/restore/{id}")
-    Result restore(@PathVariable Long id);
+    Result restore(@PathVariable("id") Long id);
 
     /**
      * 还原文件
@@ -135,7 +135,7 @@ public interface FileApi {
      * @return
      */
     @GetMapping(value = "/restore")
-    Result restoreByPath(@RequestParam String path);
+    Result restoreByPath(@RequestParam("path") String path);
 
     /**
      * 移动文件到文件夹
@@ -145,5 +145,5 @@ public interface FileApi {
      * @return
      */
     @GetMapping(value = "/move")
-    Result move(@RequestParam Long fileId, @RequestParam Long folderId);
+    Result move(@RequestParam("fileId") Long fileId, @RequestParam("folderId") Long folderId);
 }

+ 16 - 16
base-servers/file/file-server/src/main/java/com/usoftchina/saas/file/controller/FileController.java

@@ -82,7 +82,7 @@ public class FileController {
 
     @ApiOperation(value = "创建文件夹")
     @PostMapping(value = "/folder")
-    public Result<FolderDTO> createFolder(FolderSaveDTO newFolder) {
+    public Result<FolderDTO> createFolder(@RequestBody FolderSaveDTO newFolder) {
         BizAssert.notNull(newFolder.getName(), ExceptionCode.FOLDER_NAME_EMPTY);
         // 检查父文件夹
         FileInfo parent = checkFolder(newFolder.getFolderId());
@@ -93,7 +93,7 @@ public class FileController {
 
     @ApiOperation(value = "上传文件")
     @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
-    public Result<FileInfoDTO> upload(Long folderId, @RequestPart(value = "file") MultipartFile file) throws Exception {
+    public Result<FileInfoDTO> upload(@RequestParam("folderId") Long folderId, @RequestPart(value = "file") MultipartFile file) throws Exception {
         // 检查父文件夹
         FileInfo parent = checkFolder(folderId);
         FileInfo info = FileInfo.newFile(file).folder(parent.getId())
@@ -104,7 +104,7 @@ public class FileController {
 
     @ApiOperation(value = "下载文件")
     @GetMapping(value = "/download/{id}")
-    public void download(@PathVariable Long id, HttpServletResponse response) throws Exception {
+    public void download(@PathVariable("id") Long id, HttpServletResponse response) throws Exception {
         FileInfo info = fileService.findByPrimaryKey(id);
         if (null == info) {
             throw new BizException(ExceptionCode.FILE_NOT_EXISTS);
@@ -135,7 +135,7 @@ public class FileController {
 
     @ApiOperation(value = "下载文件")
     @GetMapping(value = "/download")
-    public void download(@RequestParam String path, HttpServletResponse response) throws Exception {
+    public void download(@RequestParam("path") String path, HttpServletResponse response) throws Exception {
         FileInfo info = fileService.findByFullPath(path);
         if (null == info) {
             throw new BizException(ExceptionCode.FILE_NOT_EXISTS);
@@ -145,7 +145,7 @@ public class FileController {
 
     @ApiOperation(value = "查看文件")
     @GetMapping(value = "/view/{id}")
-    public void view(@PathVariable Long id, HttpServletResponse response) throws Exception {
+    public void view(@PathVariable("id") Long id, HttpServletResponse response) throws Exception {
         FileInfo info = fileService.findByPrimaryKey(id);
         if (null == info) {
             throw new BizException(ExceptionCode.FILE_NOT_EXISTS);
@@ -169,7 +169,7 @@ public class FileController {
 
     @ApiOperation(value = "查看文件")
     @GetMapping(value = "/view")
-    public void view(@RequestParam String path, HttpServletResponse response) throws Exception {
+    public void view(@RequestParam("path") String path, HttpServletResponse response) throws Exception {
         FileInfo info = fileService.findByFullPath(path);
         if (null == info) {
             throw new BizException(ExceptionCode.FILE_NOT_EXISTS);
@@ -179,7 +179,7 @@ public class FileController {
 
     @ApiOperation(value = "查看文件信息")
     @GetMapping(value = "/info/{id}")
-    public Result<FileInfoDTO> getFileInfo(@PathVariable Long id) {
+    public Result<FileInfoDTO> getFileInfo(@PathVariable("id") Long id) {
         FileInfo info = fileService.findByPrimaryKey(id);
         if (null != info) {
             return Result.success(BeanMapper.map(info, FileInfoDTO.class));
@@ -189,7 +189,7 @@ public class FileController {
 
     @ApiOperation(value = "查看文件信息")
     @GetMapping(value = "/info")
-    public Result<FileInfoDTO> getFileInfo(@RequestParam String path) {
+    public Result<FileInfoDTO> getFileInfo(@RequestParam("path") String path) {
         FileInfo info = fileService.findByFullPath(path);
         if (null != info) {
             return Result.success(BeanMapper.map(info, FileInfoDTO.class));
@@ -199,7 +199,7 @@ public class FileController {
 
     @ApiOperation(value = "查看子文件")
     @GetMapping(value = "/list")
-    public Result<List<FileInfoDTO>> listFiles(Long folderId) {
+    public Result<List<FileInfoDTO>> listFiles(@RequestParam("folderId") Long folderId) {
         List<FileInfo> files = fileService.findByFolderId(checkFolder(folderId).getId());
         return Result.success(BeanMapper.mapList(files, FileInfoDTO.class));
     }
@@ -287,8 +287,8 @@ public class FileController {
 
     @ApiOperation(value = "删除文件")
     @GetMapping(value = "/delete/{id}")
-    public Result delete(@PathVariable Long id,
-                         @RequestParam(required = false, defaultValue = "false") Boolean purge) {
+    public Result delete(@PathVariable("id") Long id,
+                         @RequestParam(required = false, defaultValue = "false", value = "purge") Boolean purge) {
         FileInfo info = fileService.findByPrimaryKey(id);
         if (null != info) {
             if (purge) {
@@ -302,8 +302,8 @@ public class FileController {
 
     @ApiOperation(value = "删除文件")
     @GetMapping(value = "/delete")
-    public Result delete(@RequestParam String path,
-                         @RequestParam(required = false, defaultValue = "false") Boolean purge) {
+    public Result delete(@RequestParam("id") String path,
+                         @RequestParam(required = false, defaultValue = "false", value = "purge") Boolean purge) {
         FileInfo info = fileService.findByFullPath(path);
         if (null != info) {
             if (purge) {
@@ -317,7 +317,7 @@ public class FileController {
 
     @ApiOperation(value = "还原文件")
     @GetMapping(value = "/restore/{id}")
-    public Result restore(@PathVariable Long id) {
+    public Result restore(@PathVariable("id") Long id) {
         FileInfo info = fileService.findByPrimaryKey(id);
         if (null != info) {
             cascadeRestore(info);
@@ -327,7 +327,7 @@ public class FileController {
 
     @ApiOperation(value = "还原文件")
     @GetMapping(value = "/restore")
-    public Result restore(@RequestParam String path) {
+    public Result restore(@RequestParam("path") String path) {
         FileInfo info = fileService.findByFullPath(path);
         if (null != info) {
             cascadeRestore(info);
@@ -337,7 +337,7 @@ public class FileController {
 
     @ApiOperation(value = "移动文件到文件夹")
     @GetMapping(value = "/move")
-    public Result move(@RequestParam Long fileId, @RequestParam Long folderId) {
+    public Result move(@RequestParam("fileId") Long fileId, @RequestParam("folderId") Long folderId) {
         FileInfo info = fileService.findByPrimaryKey(fileId);
         if (null != info) {
             info.setFolderId(folderId);