mirror of
https://github.com/abcv7/sfbx-cloud.git
synced 2026-08-16 11:47:00 +00:00
功能:在保险、规则、交易、积分和短信模块中实现初始功能和基础组件。
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.itheima.sfbx</groupId>
|
||||
<artifactId>sfbx-file</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<!--文件处理接口模块-->
|
||||
<artifactId>file-interface</artifactId>
|
||||
<name>file-interface</name>
|
||||
<!-- FIXME change it to the project's website -->
|
||||
<url>http://www.example.com</url>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.itheima.sfbx</groupId>
|
||||
<artifactId>framework-feign</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.itheima.sfbx.file.config;
|
||||
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @ClassName DictFenginConfig.java
|
||||
* @Description feign的最优化配置
|
||||
*/
|
||||
@EnableFeignClients(basePackages = "com.itheima.sfbx.file.feign")
|
||||
@Configuration
|
||||
public class FileFeignConfig {
|
||||
}
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
package com.itheima.sfbx.file.feign;
|
||||
|
||||
import com.itheima.sfbx.file.hystrix.FileBusinessHystrix;
|
||||
import com.itheima.sfbx.framework.commons.dto.file.FileVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName FileFeign.java
|
||||
* @Description 附件feign接口
|
||||
*/
|
||||
@FeignClient(value = "file-web",fallback = FileBusinessHystrix.class)
|
||||
public interface FileBusinessFeign {
|
||||
|
||||
/**
|
||||
* @Description 业务与文件绑定
|
||||
* @param fileVO 附件对象
|
||||
* @return com.itheima.travel.req.FileVO
|
||||
*/
|
||||
@PostMapping("file-feign/bind-file")
|
||||
List<FileVO> bindFile(@RequestBody FileVO fileVO);
|
||||
|
||||
/**
|
||||
* @Description 业务绑定多个附件
|
||||
* @param fileVOs 相同业务的多个附件对象
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("file-feign/bind-batch-file")
|
||||
List<FileVO> bindBatchFile(@RequestBody ArrayList<FileVO> fileVOs);
|
||||
|
||||
/**
|
||||
* @Description 移除业务原附件,并绑定新的附件到业务上
|
||||
* @param fileVO 附件对象
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "file-feign/replace-bind-file")
|
||||
Boolean replaceBindFile(@RequestBody FileVO fileVO);
|
||||
|
||||
/**
|
||||
* @Description 移除业务原附件,并批量绑定新的附件到业务上
|
||||
* @param fileVOs 附件对象
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "file-feign/replace-bind-batch-file")
|
||||
Boolean replaceBindBatchFile(@RequestBody ArrayList<FileVO> fileVOs);
|
||||
|
||||
|
||||
/**
|
||||
* @Description 按业务ID查询附件【对象传递参数方式】
|
||||
* @param businessIds 业务IDS
|
||||
* @return List<FileVO>
|
||||
*/
|
||||
@PostMapping("file-feign/find-in-business-ids")
|
||||
List<FileVO> findInBusinessIds(@RequestBody List<Long> businessIds);
|
||||
|
||||
|
||||
/**
|
||||
* @Description 删除业务相关附件
|
||||
* @param businessIds 业务IDS
|
||||
* @return Boolean
|
||||
*/
|
||||
@DeleteMapping("file-feign/delete-by-business-ids")
|
||||
Boolean deleteByBusinessIds(@RequestBody ArrayList<Long> businessIds);
|
||||
|
||||
/**
|
||||
* @Description 定时清理文件
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping("file-feign/clear-file")
|
||||
Boolean clearFile();
|
||||
|
||||
/**
|
||||
* @Description 延迟队列清理文件
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping("file-feign/clear-file-id/{id}")
|
||||
Boolean clearFileById(@PathVariable("id") Long id);
|
||||
|
||||
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.itheima.sfbx.file.feign;
|
||||
|
||||
import com.itheima.sfbx.file.hystrix.FileBusinessHystrix;
|
||||
import com.itheima.sfbx.framework.commons.dto.file.FileVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
/**
|
||||
* @ClassName FileFeign.java
|
||||
* @Description 文件下载feign接口
|
||||
*/
|
||||
@FeignClient(value = "file-web",fallback = FileBusinessHystrix.class)
|
||||
public interface FileDownLoadFeign {
|
||||
|
||||
/***
|
||||
* @description 文件下载-服务远程调用-base64方式返回
|
||||
* @param fileId 上传对象
|
||||
* @return: com.itheima.travel.req.FileVo
|
||||
*/
|
||||
@PostMapping("file-feign/down-load/{fileId}")
|
||||
FileVO downLoad(@PathVariable("fileId") Long fileId);
|
||||
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
package com.itheima.sfbx.file.hystrix;
|
||||
|
||||
import com.itheima.sfbx.framework.commons.dto.file.FileVO;
|
||||
import com.itheima.sfbx.file.feign.FileBusinessFeign;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName FileHystrix.java
|
||||
* @Description FileFeign的Hystrix
|
||||
*/
|
||||
@Component
|
||||
public class FileBusinessHystrix implements FileBusinessFeign {
|
||||
|
||||
|
||||
@Override
|
||||
public List<FileVO> bindFile(FileVO fileVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FileVO> bindBatchFile(ArrayList<FileVO> fileVOs) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean replaceBindFile(FileVO fileVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean replaceBindBatchFile(ArrayList<FileVO> fileVOs) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FileVO> findInBusinessIds(List<Long> businessIds) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteByBusinessIds(ArrayList<Long> businessIds) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean clearFile() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean clearFileById(Long id) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.itheima.sfbx.file.hystrix;
|
||||
|
||||
import com.itheima.sfbx.file.feign.FileDownLoadFeign;
|
||||
import com.itheima.sfbx.framework.commons.dto.file.FileVO;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @ClassName FileHystrix.java
|
||||
* @Description FileFeign的Hystrix
|
||||
*/
|
||||
@Component
|
||||
public class FileDownLoadHystrix implements FileDownLoadFeign {
|
||||
|
||||
|
||||
@Override
|
||||
public FileVO downLoad(Long fileId) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user