first commit

This commit is contained in:
abcv7
2026-02-25 15:08:40 +08:00
commit 7f1d83ada7
2003 changed files with 144362 additions and 0 deletions
+23
View File
@@ -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>
@@ -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 {
}
@@ -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);
}
@@ -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);
}
@@ -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;
}
}
@@ -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;
}
}