update
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -13,3 +13,4 @@ os_del.cmd
|
||||
os_del_doc.cmd
|
||||
.svn
|
||||
derby.log
|
||||
/scripts/downloaded_files/
|
||||
|
||||
@@ -80,6 +80,10 @@ services:
|
||||
- 8005:80
|
||||
physical-crawler:
|
||||
container_name: physical-crawler
|
||||
restart: on-failure
|
||||
depends_on:
|
||||
- physical-mysql
|
||||
- physical-minio
|
||||
image: registry.cn-shanghai.aliyuncs.com/physical/physical-crawler
|
||||
ports:
|
||||
- "25000:5000"
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
package org.jeecg.modules.oss.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.modules.oss.entity.OssFile;
|
||||
@@ -13,14 +17,12 @@ import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 云存储示例 DEMO
|
||||
*
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Slf4j
|
||||
@@ -54,8 +56,7 @@ public class OssFileController {
|
||||
try {
|
||||
ossFileService.upload(multipartFile);
|
||||
result.success("上传成功!");
|
||||
}
|
||||
catch (Exception ex) {
|
||||
} catch (Exception ex) {
|
||||
log.info(ex.getMessage(), ex);
|
||||
result.error500("上传失败");
|
||||
}
|
||||
@@ -69,7 +70,7 @@ public class OssFileController {
|
||||
OssFile file = ossFileService.getById(id);
|
||||
if (file == null) {
|
||||
result.error500("未找到对应实体");
|
||||
}else {
|
||||
} else {
|
||||
boolean ok = ossFileService.delete(file);
|
||||
result.success("删除成功!");
|
||||
}
|
||||
@@ -81,17 +82,40 @@ public class OssFileController {
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/queryById")
|
||||
@Operation(summary = "文件管理-通过id查询")
|
||||
public Result<OssFile> queryById(@RequestParam(name = "id") String id) {
|
||||
Result<OssFile> result = new Result<>();
|
||||
OssFile file = ossFileService.getById(id);
|
||||
if (file == null) {
|
||||
result.error500("未找到对应实体");
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
result.setResult(file);
|
||||
result.setSuccess(true);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询.
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/queryByIds")
|
||||
@Operation(summary = "文件管理-通过多个id逗号分割批量查询查询")
|
||||
public Result<List<OssFile>> queryByIdList(@RequestParam(name = "ids") String ids) {
|
||||
Result<List<OssFile>> result = new Result<>();
|
||||
String[] idList = ids.split(",");
|
||||
List<OssFile> resultList = new ArrayList<>();
|
||||
for (int i = 0; i < idList.length; i++) {
|
||||
OssFile file = ossFileService.getById(idList[i]);
|
||||
resultList.add(file);
|
||||
}
|
||||
if (CollectionUtil.isEmpty(resultList)) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
result.setResult(resultList);
|
||||
result.setSuccess(true);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,10 +9,10 @@ from minio.error import S3Error
|
||||
minio_public_url = 'http://58.215.212.230:8005/oss/'
|
||||
# MySQL 连接配置
|
||||
db_config = {
|
||||
# 'host': 'physical-mysql',
|
||||
# 'port': 3306,
|
||||
'host': '192.168.50.100',
|
||||
'port': 23306,
|
||||
'host': 'physical-mysql',
|
||||
'port': 3306,
|
||||
# 'host': '192.168.50.100',
|
||||
# 'port': 23306,
|
||||
'user': 'root',
|
||||
'password': '123456',
|
||||
'database': 'physical-boot'
|
||||
@@ -20,8 +20,8 @@ db_config = {
|
||||
|
||||
# minio 配置
|
||||
minio_client = Minio(
|
||||
# "physical-minio:9000", # MinIO服务器地址或IP
|
||||
"192.168.50.100:29000", # MinIO服务器地址或IP
|
||||
"physical-minio:9000", # MinIO服务器地址或IP
|
||||
# "192.168.50.100:29000", # MinIO服务器地址或IP
|
||||
access_key="root", # 替换为你的Access Key
|
||||
secret_key="12345678", # 替换为你的Secret Key
|
||||
secure=False # 如果使用的是http则为False
|
||||
|
||||
Reference in New Issue
Block a user