mirror of
https://github.com/abcv7/sfbx-cloud.git
synced 2026-08-16 19:49:49 +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-dict</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<!--数字字典接口模块-->
|
||||
<artifactId>dict-interface</artifactId>
|
||||
<name>dict-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.dict.config;
|
||||
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @ClassName DictFeignConfig.java
|
||||
* @Description feign的最优化配置
|
||||
*/
|
||||
@Configuration
|
||||
@EnableFeignClients(basePackages = "com.itheima.sfbx.dict")
|
||||
public class DictFeignConfig {
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package com.itheima.sfbx.dict.feign;
|
||||
|
||||
import com.itheima.sfbx.dict.hystrix.DataDictHystrix;
|
||||
import com.itheima.sfbx.framework.commons.dto.dict.DataDictVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName DataDictFace.java
|
||||
* @Description:数字字典feign接口类
|
||||
*/
|
||||
@FeignClient(value = "dict-web",fallback = DataDictHystrix.class)
|
||||
public interface DataDictFeign {
|
||||
|
||||
/**
|
||||
* @Description 根据parentKey获取value
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("data-dict-feign/parent-key/{parentKey}")
|
||||
List<DataDictVO> findDataDictVOByParentKey(@PathVariable("parentKey") String parentKey);
|
||||
|
||||
/**
|
||||
* @Description 根据dataKey获取DataDictVO
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("data-dict-feign/data-key/{dataKey}")
|
||||
DataDictVO findDataDictVOByDataKey(@PathVariable("dataKey") String dataKey) ;
|
||||
|
||||
/**
|
||||
* @Description 根据dataKey获取DataDictVO集合
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("data-dict-feign/findValueByDataKeys")
|
||||
List<DataDictVO> findValueByDataKeys(@RequestBody ArrayList<String> dataKeys);
|
||||
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.itheima.sfbx.dict.feign;
|
||||
|
||||
import com.itheima.sfbx.framework.commons.dto.dict.PlacesVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName PlacesFeign.java
|
||||
* @Description 地区feign服务
|
||||
*/
|
||||
@FeignClient(value = "dict-web")
|
||||
public interface PlacesFeign {
|
||||
|
||||
/***
|
||||
* @description 查询下级
|
||||
* @param parentId 父层Id
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("places-fegin/{parentId}")
|
||||
public List<PlacesVO> findPlacesVOListByParentId(@PathVariable("parentId") Long parentId);
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.itheima.sfbx.dict.hystrix;
|
||||
|
||||
import com.itheima.sfbx.dict.feign.DataDictFeign;
|
||||
import com.itheima.sfbx.framework.commons.dto.dict.DataDictVO;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName DataDictHystrix.java
|
||||
* @Description DataDictFeign的Hystrix处理
|
||||
*/
|
||||
@Component
|
||||
public class DataDictHystrix implements DataDictFeign {
|
||||
|
||||
|
||||
@Override
|
||||
public List<DataDictVO> findDataDictVOByParentKey(String parentKey) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataDictVO findDataDictVOByDataKey(String dataKey) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataDictVO> findValueByDataKeys(ArrayList<String> dataKeys) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.itheima.sfbx.dict.hystrix;
|
||||
|
||||
import com.itheima.sfbx.dict.feign.PlacesFeign;
|
||||
import com.itheima.sfbx.framework.commons.dto.dict.PlacesVO;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName PlacesHystrix.java
|
||||
* @Description PlacesFeign的Hystrix
|
||||
*/
|
||||
@Component
|
||||
public class PlacesHystrix implements PlacesFeign {
|
||||
|
||||
@Override
|
||||
public List<PlacesVO> findPlacesVOListByParentId(Long parentId) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user