add openapi
This commit is contained in:
parent
dcaafdb079
commit
41a90f7ef7
@ -0,0 +1,4 @@
|
||||
package com.qiwenshare.common.util;
|
||||
|
||||
public class OfficeUtil {
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.qiwenshare.file.config.openapi;
|
||||
|
||||
import io.swagger.v3.oas.models.ExternalDocumentation;
|
||||
import io.swagger.v3.oas.models.OpenAPI;
|
||||
import io.swagger.v3.oas.models.info.Info;
|
||||
import io.swagger.v3.oas.models.info.License;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class OpenAPIConfig {
|
||||
|
||||
@Bean
|
||||
public OpenAPI qiwenFileOpenAPI() {
|
||||
return new OpenAPI()
|
||||
.info(new Info().title("qiwenFileOpenAPI")
|
||||
.title("qiwenfile")
|
||||
.description("desc")
|
||||
.version("v0.0.1")
|
||||
.license(new License().name("Apache 2.0").url("http://springdoc.org")))
|
||||
.externalDocs(new ExternalDocumentation()
|
||||
.description("spring wiki")
|
||||
.url("http://www.qiwenshare.com"));
|
||||
}
|
||||
}
|
@ -19,6 +19,7 @@ import com.qiwenshare.file.domain.UserBean;
|
||||
import com.qiwenshare.file.domain.UserFile;
|
||||
import com.qiwenshare.file.dto.*;
|
||||
import com.qiwenshare.file.service.UserFileService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -53,11 +54,7 @@ public class FileController {
|
||||
public static long treeid = 0;
|
||||
|
||||
|
||||
/**
|
||||
* 创建文件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "创建文件")
|
||||
@RequestMapping(value = "/createfile", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public RestResult<String> createFile(@RequestBody CreateFileDto createFileDto, @RequestHeader("token") String token) {
|
||||
@ -89,11 +86,7 @@ public class FileController {
|
||||
return restResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件重命名
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "文件重命名")
|
||||
@RequestMapping(value = "/renamefile", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public RestResult<String> renameFile(@RequestBody RenameFileDto renameFileDto, @RequestHeader("token") String token) {
|
||||
@ -161,13 +154,15 @@ public class FileController {
|
||||
return restResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/recyclefile", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public RestResult<String> recycleFile(@RequestBody FileBean fileBean, @RequestHeader("token") String token) {
|
||||
|
||||
return null;
|
||||
}
|
||||
// @Operation(summary = "文件重命名")
|
||||
// @RequestMapping(value = "/recyclefile", method = RequestMethod.POST)
|
||||
// @ResponseBody
|
||||
// public RestResult<String> recycleFile(@RequestBody FileBean fileBean, @RequestHeader("token") String token) {
|
||||
//
|
||||
// return null;
|
||||
// }
|
||||
|
||||
@Operation(summary = "获取文件列表")
|
||||
@RequestMapping(value = "/getfilelist", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public RestResult<List<Map<String, Object>>> getFileList(FileListDto fileListDto, @RequestHeader("token") String token){
|
||||
@ -200,11 +195,7 @@ public class FileController {
|
||||
return restResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除文件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "批量删除文件")
|
||||
@RequestMapping(value = "/batchdeletefile", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public RestResult<String> deleteImageByIds(@RequestBody BatchDeleteFileDto batchDeleteFileDto, @RequestHeader("token") String token) {
|
||||
@ -224,11 +215,7 @@ public class FileController {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "删除文件")
|
||||
@RequestMapping(value = "/deletefile", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public String deleteFile(@RequestBody DeleteFileDto deleteFileDto, @RequestHeader("token") String token) {
|
||||
@ -247,11 +234,7 @@ public class FileController {
|
||||
return resultJson;
|
||||
}
|
||||
|
||||
/**
|
||||
* 解压文件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "解压文件")
|
||||
@RequestMapping(value = "/unzipfile", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public RestResult<String> unzipFile(@RequestBody UnzipFileDto unzipFileDto, @RequestHeader("token") String token) {
|
||||
@ -337,12 +320,8 @@ public class FileController {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件移动
|
||||
*
|
||||
*
|
||||
* @return 返回前台移动结果
|
||||
*/
|
||||
|
||||
@Operation(summary = "文件移动")
|
||||
@RequestMapping(value = "/movefile", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public RestResult<String> moveFile(@RequestBody MoveFileDto moveFileDto, @RequestHeader("token") String token) {
|
||||
@ -360,12 +339,7 @@ public class FileController {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量移动文件
|
||||
*
|
||||
*
|
||||
* @return 返回前台移动结果
|
||||
*/
|
||||
@Operation(summary = "批量移动文件")
|
||||
@RequestMapping(value = "/batchmovefile", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public RestResult<String> batchMoveFile(@RequestBody BatchMoveFileDto batchMoveFileDto, @RequestHeader("token") String token) {
|
||||
@ -408,11 +382,7 @@ public class FileController {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过文件类型选择文件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "通过文件类型选择文件")
|
||||
@RequestMapping(value = "/selectfilebyfiletype", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public RestResult<List<Map<String, Object>>> selectFileByFileType(int fileType, @RequestHeader("token") String token) {
|
||||
@ -439,10 +409,7 @@ public class FileController {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件树
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "获取文件树")
|
||||
@RequestMapping(value = "/getfiletree", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public RestResult<TreeNode> getFileTree(@RequestHeader("token") String token){
|
||||
|
@ -21,6 +21,7 @@ import com.qiwenshare.file.domain.UserBean;
|
||||
import com.qiwenshare.file.domain.UserFile;
|
||||
import com.qiwenshare.file.dto.UploadFileDto;
|
||||
import com.qiwenshare.file.vo.file.UploadFileVo;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -51,12 +52,7 @@ public class FiletransferController {
|
||||
@Resource
|
||||
IUserFileService userFileService;
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "极速上传")
|
||||
@RequestMapping(value = "/uploadfile", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public RestResult<UploadFileVo> uploadFileSpeed(HttpServletRequest request, UploadFileDto uploadFileDto, @RequestHeader("token") String token) {
|
||||
@ -112,6 +108,7 @@ public class FiletransferController {
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "上传文件")
|
||||
@RequestMapping(value = "/uploadfile", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public RestResult<UploadFileVo> uploadFile(HttpServletRequest request, UploadFileDto uploadFileDto, @RequestHeader("token") String token) {
|
||||
@ -136,11 +133,7 @@ public class FiletransferController {
|
||||
return restResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取存储信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "获取存储信息")
|
||||
@RequestMapping(value = "/getstorage", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public RestResult<StorageBean> getStorage(@RequestHeader("token") String token) {
|
||||
|
@ -25,8 +25,9 @@ public class TaskController {
|
||||
@Resource
|
||||
FileService fileService;
|
||||
|
||||
@Scheduled(cron = "* * * 0/1 * ?")
|
||||
@Scheduled(cron = "0 0 0 0/1 * ?")
|
||||
public void deleteFile() {
|
||||
log.info("111112");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.DATE, -3);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
@ -9,6 +9,7 @@ import com.qiwenshare.file.api.IUserService;
|
||||
import com.qiwenshare.file.config.QiwenFileConfig;
|
||||
import com.qiwenshare.file.domain.UserBean;
|
||||
import com.qiwenshare.file.vo.user.UserLoginVo;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.crypto.hash.SimpleHash;
|
||||
import org.slf4j.Logger;
|
||||
@ -46,7 +47,7 @@ public class UserController {
|
||||
*/
|
||||
public static final String CURRENT_MODULE = "用户管理";
|
||||
|
||||
|
||||
@Operation(summary = "用户注册")
|
||||
@RequestMapping(value = "/adduser", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public RestResult<String> addUser(@RequestBody UserBean userBean) {
|
||||
@ -57,12 +58,7 @@ public class UserController {
|
||||
return restResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户登录
|
||||
*
|
||||
* @param userBean
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "用户登录")
|
||||
@RequestMapping("/userlogin")
|
||||
@ResponseBody
|
||||
public RestResult<UserLoginVo> userLogin(@RequestBody UserBean userBean) {
|
||||
@ -95,10 +91,7 @@ public class UserController {
|
||||
return restResult;
|
||||
}
|
||||
|
||||
/* 检查用户登录信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "检查用户登录信息")
|
||||
@GetMapping("/checkuserlogininfo")
|
||||
@ResponseBody
|
||||
public RestResult<UserBean> checkUserLoginInfo(@RequestHeader("token") String token) {
|
||||
@ -123,12 +116,7 @@ public class UserController {
|
||||
return restResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 得到用户信息通过id
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "得到用户信息通过id")
|
||||
@RequestMapping("/getuserinfobyid")
|
||||
@ResponseBody
|
||||
public String getUserInfoById(int userId) {
|
||||
|
Loading…
Reference in New Issue
Block a user