!12 代码合并

Merge pull request !12 from MAC/develop
This commit is contained in:
MAC 2021-02-20 13:04:52 +08:00 committed by Gitee
commit f1a61cf123
3 changed files with 20 additions and 1 deletions

View File

@ -1,5 +1,6 @@
package com.qiwenshare.common.cbb; package com.qiwenshare.common.cbb;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import java.util.Map; import java.util.Map;
@ -9,10 +10,15 @@ import java.util.Map;
* @param <T> * @param <T>
*/ */
@Data @Data
@Schema(name = "统一结果返回",required = true)
public class RestResult<T> { public class RestResult<T> {
@Schema(description = "请求是否成功", example = "true")
private Boolean success = true; private Boolean success = true;
@Schema(description = "返回码", example = "20000")
private Integer code; private Integer code;
@Schema(description = "返回信息", example = "成功")
private String message; private String message;
@Schema(description = "返回数据")
private T data; private T data;
// 通用返回成功 // 通用返回成功

View File

@ -6,6 +6,10 @@ import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License; import io.swagger.v3.oas.models.info.License;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
@Configuration @Configuration
@ -22,4 +26,13 @@ public class OpenAPIConfig {
.description("奇文网盘gitee地址") .description("奇文网盘gitee地址")
.url("https://www.gitee.com/qiwen-cloud/qiwen-file")); .url("https://www.gitee.com/qiwen-cloud/qiwen-file"));
} }
@Bean
public Docket demoApi() {
return new Docket(DocumentationType.OAS_30)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.regex("(?!/error.*).*"))
.build();
}
} }

View File

@ -104,7 +104,7 @@ public class RecoveryFileController {
String fileName = filePath.substring(filePath.lastIndexOf("/") + 1); String fileName = filePath.substring(filePath.lastIndexOf("/") + 1);
filePath = PathUtil.getParentPath(filePath); filePath = PathUtil.getParentPath(filePath);
LambdaQueryWrapper<UserFile> lambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<UserFile> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(UserFile::getFilePath, filePath) lambdaQueryWrapper.eq(UserFile::getFilePath, filePath + "/")
.eq(UserFile::getDeleteFlag, 0) .eq(UserFile::getDeleteFlag, 0)
.eq(UserFile::getUserId, sessionUserBean.getUserId()); .eq(UserFile::getUserId, sessionUserBean.getUserId());
List<UserFile> userFileList = userFileService.list(lambdaQueryWrapper); List<UserFile> userFileList = userFileService.list(lambdaQueryWrapper);