功能:在保险、规则、交易、积分和短信模块中实现初始功能和基础组件。

This commit is contained in:
abcv7
2026-03-03 04:04:22 +08:00
parent e050eb3317
commit e156d625bf
1999 changed files with 146080 additions and 63 deletions
@@ -0,0 +1,24 @@
<?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-security</artifactId>
<version>2.0-SNAPSHOT</version>
</parent>
<!--权限处理:接口模块-->
<artifactId>security-interface</artifactId>
<name>security-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.security.config;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Configuration;
/**
* @ClassName DictFenginConfig.java
* @Description feign的最优化配置
*/
@EnableFeignClients(basePackages = "com.itheima.sfbx.security.feign")
@Configuration
public class SecurityFeignConfig {
}
@@ -0,0 +1,24 @@
package com.itheima.sfbx.security.feign;
import com.itheima.sfbx.framework.commons.dto.security.AuthChannelVO;
import com.itheima.sfbx.security.hystrix.UserHtstrix;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
/**
* @ClassName AuthChannelFeign.java
* @Description TODO
*/
@FeignClient(value = "security-web", fallback = UserHtstrix.class)
public interface AuthChannelFeign {
/**
* @Description 按企业编号和配置类型查询对应的企业信息
* @param companyNo 企业编号
* @return
*/
@PostMapping("auth-channel-feign/find-auth-channel/{companyNo}/{channelLabel}")
public AuthChannelVO findAuthChannelByCompanyNoAndChannelLabel(@PathVariable("companyNo") String companyNo,
@PathVariable("channelLabel") String channelLabel);
}
@@ -0,0 +1,34 @@
package com.itheima.sfbx.security.feign;
import com.itheima.sfbx.framework.commons.dto.security.CompanyVO;
import com.itheima.sfbx.security.hystrix.UserHtstrix;
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.List;
/**
* @Description:用户权限适配服务接口定义
*/
@FeignClient(value = "security-web", fallback = UserHtstrix.class)
public interface CompanyFeign {
/***
* @description 按企业号查询公司
* @param companyNo 企业号
* @return
*/
@PostMapping("company-feign/find-company/{companyNo}")
CompanyVO findCompanyByNo(@PathVariable("companyNo") String companyNo);
/***
* @description 按多个企业号查询公司
* @param companyNos 企业号
* @return
*/
@PostMapping("company-feign/find-company")
List<CompanyVO> findCompanyByNos(@RequestBody List<String> companyNos);
}
@@ -0,0 +1,65 @@
package com.itheima.sfbx.security.feign;
import com.itheima.sfbx.framework.commons.basic.ResponseResult;
import com.itheima.sfbx.framework.commons.dto.security.CustomerVO;
import com.itheima.sfbx.framework.commons.dto.security.UserVO;
import com.itheima.sfbx.security.hystrix.UserHtstrix;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
/**
* @Description:用户权限适配服务接口定义
*/
@FeignClient(value = "security-web",fallback = UserHtstrix.class)
public interface CustomerFeign {
/**
* @Description 按用客户查找用户
* @param username 登录名
* @return
*/
@PostMapping("customer-feign/username-login/{username}/{company}")
UserVO usernameLogin(@PathVariable("username") String username,@PathVariable("company") String company);
/**
* @Description 按用户手机查找用户
* @param mobile 登录名
* @return
*/
@PostMapping("customer-feign/mobile-login/{mobile}/{company}")
UserVO mobileLogin(@PathVariable("mobile") String mobile,@PathVariable("company") String company);
/**
* @Description 按微信openId查找客户
* @param openId 登录名
* @return
*/
@PostMapping("customer-feign/wechat-login/{openId}/{company}")
UserVO wechatLogin(@PathVariable("openId") String openId,@PathVariable("company") String company);
/**
* @Description 注册客户
* @param customerVO 客户信息
* @return
*/
@PostMapping("customer-feign/register-user")
UserVO registerUser(@RequestBody CustomerVO customerVO);
/**
* 重置密码
* @param customerId
* @return
*/
@PostMapping("reset-passwords/{customerId}")
Boolean resetPasswords(@PathVariable("customerId") String customerId);
/**
* 修改用户真实姓名
* @param userId
* @param name
* @return
*/
@PostMapping("customer-feign/update-real-name")
Boolean updateRealName(@RequestParam("userId") String userId,@RequestParam("name") String name);
}
@@ -0,0 +1,72 @@
package com.itheima.sfbx.security.feign;
import com.itheima.sfbx.framework.commons.dto.security.*;
import com.itheima.sfbx.security.hystrix.UserHtstrix;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @Description:用户权限适配服务接口定义
*/
@FeignClient(value = "security-web",fallback = UserHtstrix.class)
public interface UserFeign {
/**
* @Description 按用户名查找用户
* @param username 登录名
* @return
*/
@PostMapping("user-feign/username-login/{username}/{company}")
UserVO usernameLogin(@PathVariable("username") String username,@PathVariable("company") String company);
/**
* @Description 按用户手机查找用户
* @param mobile 登录名
* @return
*/
@PostMapping("user-feign/mobile-login/{mobile}/{company}")
UserVO mobileLogin(@PathVariable("mobile") String mobile,@PathVariable("company") String company);
/**
* @Description 按微信openId查找客户
* @param openId 登录名
* @return
*/
@PostMapping("user-feign/wechat-login/{openId}/{company}")
UserVO wechatLogin(@PathVariable("openId") String openId,@PathVariable("company") String company);
/**
* @Description 查找用户所有角色
* @param userId 用户Id
* @return
*/
@PostMapping("user-feign/find-role-user/{userId}")
List<RoleVO> findRoleByUserId(@PathVariable("userId") Long userId);
/**
* @Description 查询用户有资源
* @param userId 用户Id
* @return
*/
@PostMapping("user-feign/find-resoure-user/{userId}")
List<ResourceVO> findResourceByUserId(@PathVariable("userId") Long userId);
/***
* @description 查询用户数据权限
* @param queryDataSecurityVO 查询对象Vo
*
* @return
*/
@PostMapping(value = "user-feign/user-data-security")
DataSecurityVO userDataSecurity(@RequestBody QueryDataSecurityVO queryDataSecurityVO);
/***
* @description 查询用户数据权限
* @param userId 用户id
* @return
*/
@PostMapping(value = "user-feign/find-user-by-id")
UserVO findUserById(@RequestParam("userId") Long userId);
}
@@ -0,0 +1,21 @@
package com.itheima.sfbx.security.hystrix;
import com.itheima.sfbx.framework.commons.dto.security.AuthChannelVO;
import com.itheima.sfbx.security.feign.AuthChannelFeign;
import com.itheima.sfbx.security.feign.CompanyFeign;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
/**
* @ClassName AuthChannelFeign.java
* @Description TODO
*/
public class AuthChannelHystrix implements AuthChannelFeign {
@Override
public AuthChannelVO findAuthChannelByCompanyNoAndChannelLabel(String companyNo, String channelLabel) {
return null;
}
}
@@ -0,0 +1,27 @@
package com.itheima.sfbx.security.hystrix;
import com.itheima.sfbx.framework.commons.dto.security.CompanyVO;
import com.itheima.sfbx.framework.commons.dto.security.UserVO;
import com.itheima.sfbx.security.feign.CompanyFeign;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @ClassName CompanyFeign.java
* @Description CompanyFeign的Htstrix
*/
@Component
public class CompanyHtstrix implements CompanyFeign {
@Override
public CompanyVO findCompanyByNo(String companyNo) {
return null;
}
@Override
public List<CompanyVO> findCompanyByNos(List<String> companyNos) {
return null;
}
}
@@ -0,0 +1,46 @@
package com.itheima.sfbx.security.hystrix;
import com.itheima.sfbx.framework.commons.basic.ResponseResult;
import com.itheima.sfbx.framework.commons.dto.security.CustomerVO;
import com.itheima.sfbx.framework.commons.dto.security.UserVO;
import com.itheima.sfbx.security.feign.CustomerFeign;
import org.springframework.stereotype.Component;
/**
* @ClassName CustomerFeign.java
* @Description CustomerFeign的Htstrix
*/
@Component
public class CustomerHtstrix implements CustomerFeign {
@Override
public UserVO usernameLogin(String username, String company) {
return null;
}
@Override
public UserVO mobileLogin(String mobile, String company) {
return null;
}
@Override
public UserVO wechatLogin(String openId, String company) {
return null;
}
@Override
public UserVO registerUser(CustomerVO customerVO) {
return null;
}
@Override
public Boolean resetPasswords(String customerId) {
return null;
}
@Override
public Boolean updateRealName(String userId, String name) {
return null;
}
}
@@ -0,0 +1,53 @@
package com.itheima.sfbx.security.hystrix;
import com.itheima.sfbx.framework.commons.dto.security.*;
import com.itheima.sfbx.security.feign.UserFeign;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @ClassName UserHtstrix.java
* @Description UserFeign的Htstrix
*/
@Component
public class UserHtstrix implements UserFeign {
@Override
public UserVO usernameLogin(String username, String company) {
return null;
}
@Override
public UserVO mobileLogin(String mobile, String company) {
return null;
}
@Override
public UserVO wechatLogin(String openId, String company) {
return null;
}
@Override
public List<RoleVO> findRoleByUserId(Long userId) {
return null;
}
@Override
public List<ResourceVO> findResourceByUserId(Long userId) {
return null;
}
@Override
public DataSecurityVO userDataSecurity(QueryDataSecurityVO queryDataSecurityVO) {
return null;
}
@Override
public UserVO findUserById(Long userId) {
return null;
}
}