mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2025-12-08 17:12:28 +08:00
JeecgBoot 2.3 里程碑版本发布,支持微服务和单体自由切换、提供新行编辑表格JVXETable
This commit is contained in:
@ -0,0 +1,54 @@
|
||||
<?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">
|
||||
<parent>
|
||||
<artifactId>jeecg-boot-base-api</artifactId>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<version>2.3.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>jeecg-system-cloud-api</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<!-- spring-cloud begin -->
|
||||
<!-- nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<!-- feign -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- sentinel 熔断限流 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
<!-- spring-cloud end -->
|
||||
</dependencies>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<!-- spring-cloud-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>Greenwich.SR3</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
||||
<version>2.1.0.RELEASE</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
</project>
|
||||
@ -0,0 +1,396 @@
|
||||
package org.jeecg.common.system.api;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.jeecg.common.api.CommonAPI;
|
||||
import org.jeecg.common.api.dto.OnlineAuthDTO;
|
||||
import org.jeecg.common.api.dto.message.*;
|
||||
import org.jeecg.common.constant.ServiceNameConstants;
|
||||
import org.jeecg.common.system.api.factory.SysBaseAPIFallbackFactory;
|
||||
import org.jeecg.common.system.vo.*;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 相比较local版
|
||||
* 去掉了一些方法:
|
||||
* addLog getDatabaseType queryAllDepart
|
||||
* queryAllUser(Wrapper wrapper) queryAllUser(String[] userIds, int pageNo, int pageSize)
|
||||
* 修改了一些方法:
|
||||
* createLog
|
||||
* sendSysAnnouncement 只保留了一个,其余全部干掉
|
||||
*
|
||||
* cloud接口数量43 local:35 common:9 额外一个特殊queryAllRole一个当两个用
|
||||
*/
|
||||
@Component
|
||||
@FeignClient(contextId = "sysBaseRemoteApi", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = SysBaseAPIFallbackFactory.class)
|
||||
public interface ISysBaseAPI extends CommonAPI {
|
||||
|
||||
/**
|
||||
* 1发送系统消息
|
||||
* @param message 使用构造器赋值参数 如果不设置category(消息类型)则默认为2 发送系统消息
|
||||
*/
|
||||
@PostMapping("/sys/api/sendSysAnnouncement")
|
||||
void sendSysAnnouncement(@RequestBody MessageDTO message);
|
||||
|
||||
/**
|
||||
* 2发送消息 附带业务参数
|
||||
* @param message 使用构造器赋值参数
|
||||
*/
|
||||
@PostMapping("/sys/api/sendBusAnnouncement")
|
||||
void sendBusAnnouncement(@RequestBody BusMessageDTO message);
|
||||
|
||||
/**
|
||||
* 3通过模板发送消息
|
||||
* @param message 使用构造器赋值参数
|
||||
*/
|
||||
@PostMapping("/sys/api/sendTemplateAnnouncement")
|
||||
void sendTemplateAnnouncement(@RequestBody TemplateMessageDTO message);
|
||||
|
||||
/**
|
||||
* 4通过模板发送消息 附带业务参数
|
||||
* @param message 使用构造器赋值参数
|
||||
*/
|
||||
@PostMapping("/sys/api/sendBusTemplateAnnouncement")
|
||||
void sendBusTemplateAnnouncement(@RequestBody BusTemplateMessageDTO message);
|
||||
|
||||
/**
|
||||
* 5通过消息中心模板,生成推送内容
|
||||
* @param templateDTO 使用构造器赋值参数
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/sys/api/parseTemplateByCode")
|
||||
String parseTemplateByCode(@RequestBody TemplateDTO templateDTO);
|
||||
|
||||
/**
|
||||
* 6根据用户id查询用户信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/getUserById")
|
||||
LoginUser getUserById(@RequestParam("id") String id);
|
||||
|
||||
/**
|
||||
* 7通过用户账号查询角色集合
|
||||
* @param username
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/getRolesByUsername")
|
||||
List<String> getRolesByUsername(@RequestParam("username") String username);
|
||||
|
||||
/**
|
||||
* 8通过用户账号查询部门集合
|
||||
* @param username
|
||||
* @return 部门 id
|
||||
*/
|
||||
@GetMapping("/sys/api/getDepartIdsByUsername")
|
||||
List<String> getDepartIdsByUsername(@RequestParam("username") String username);
|
||||
|
||||
/**
|
||||
* 9通过用户账号查询部门 name
|
||||
* @param username
|
||||
* @return 部门 name
|
||||
*/
|
||||
@GetMapping("/sys/api/getDepartNamesByUsername")
|
||||
List<String> getDepartNamesByUsername(@RequestParam("username") String username);
|
||||
|
||||
/**
|
||||
* 10获取数据字典
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryDictItemsByCode")
|
||||
List<DictModel> queryDictItemsByCode(@RequestParam("code") String code);
|
||||
|
||||
/** 11查询所有的父级字典,按照create_time排序 */
|
||||
@GetMapping("/sys/api/queryAllDict")
|
||||
List<DictModel> queryAllDict();
|
||||
|
||||
/**
|
||||
* 12查询所有分类字典
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryAllDSysCategory")
|
||||
List<SysCategoryModel> queryAllDSysCategory();
|
||||
|
||||
/**
|
||||
* 13获取表数据字典
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryTableDictItemsByCode")
|
||||
List<DictModel> queryTableDictItemsByCode(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code);
|
||||
|
||||
/**
|
||||
* 14查询所有部门 作为字典信息 id -->value,departName -->text
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryAllDepartBackDictModel")
|
||||
List<DictModel> queryAllDepartBackDictModel();
|
||||
|
||||
/**
|
||||
* 15根据业务类型 busType 及业务 busId 修改消息已读
|
||||
*/
|
||||
@GetMapping("/sys/api/updateSysAnnounReadFlag")
|
||||
public void updateSysAnnounReadFlag(@RequestParam("busType") String busType, @RequestParam("busId")String busId);
|
||||
|
||||
/**
|
||||
* 16查询表字典 支持过滤数据
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param filterSql
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryFilterTableDictInfo")
|
||||
List<DictModel> queryFilterTableDictInfo(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("filterSql") String filterSql);
|
||||
|
||||
/**
|
||||
* 17查询指定table的 text code 获取字典,包含text和value
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param keyArray
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
@GetMapping("/sys/api/queryTableDictByKeys")
|
||||
public List<String> queryTableDictByKeys(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("keyArray") String[] keyArray);
|
||||
|
||||
/**
|
||||
* 18查询所有用户 返回ComboModel
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryAllUserBackCombo")
|
||||
public List<ComboModel> queryAllUserBackCombo();
|
||||
|
||||
/**
|
||||
* 19分页查询用户 返回JSONObject
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryAllUser")
|
||||
public JSONObject queryAllUser(@RequestParam(name="userIds",required=false)String userIds, @RequestParam(name="pageNo",required=false) Integer pageNo,@RequestParam(name="pageSize",required=false) int pageSize);
|
||||
|
||||
|
||||
/**
|
||||
* 20获取所有角色 带参
|
||||
* roleIds 默认选中角色
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryAllRole")
|
||||
public List<ComboModel> queryAllRole(@RequestParam(name = "roleIds",required = false)String[] roleIds);
|
||||
|
||||
/**
|
||||
* 21通过用户账号查询角色Id集合
|
||||
* @param username
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/getRoleIdsByUsername")
|
||||
public List<String> getRoleIdsByUsername(@RequestParam("username")String username);
|
||||
|
||||
/**
|
||||
* 22通过部门编号查询部门id
|
||||
* @param orgCode
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/getDepartIdsByOrgCode")
|
||||
public String getDepartIdsByOrgCode(@RequestParam("orgCode")String orgCode);
|
||||
|
||||
/**
|
||||
* 23查询所有部门
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/getAllSysDepart")
|
||||
public List<SysDepartModel> getAllSysDepart();
|
||||
|
||||
/**
|
||||
* 24查找父级部门
|
||||
* @param departId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/getParentDepartId")
|
||||
DictModel getParentDepartId(@RequestParam("departId")String departId);
|
||||
|
||||
/**
|
||||
* 25根据部门Id获取部门负责人
|
||||
* @param deptId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/getDeptHeadByDepId")
|
||||
public List<String> getDeptHeadByDepId(@RequestParam("deptId") String deptId);
|
||||
|
||||
/**
|
||||
* 26给指定用户发消息
|
||||
* @param userIds
|
||||
* @param cmd
|
||||
*/
|
||||
@GetMapping("/sys/api/sendWebSocketMsg")
|
||||
public void sendWebSocketMsg(@RequestParam("userIds")String[] userIds, @RequestParam("cmd") String cmd);
|
||||
|
||||
/**
|
||||
* 27根据id获取所有参与用户
|
||||
* userIds
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryAllUserByIds")
|
||||
public List<LoginUser> queryAllUserByIds(@RequestParam("userIds") String[] userIds);
|
||||
|
||||
/**
|
||||
* 28将会议签到信息推动到预览
|
||||
* userIds
|
||||
* @return
|
||||
* @param userId
|
||||
*/
|
||||
@GetMapping("/sys/api/meetingSignWebsocket")
|
||||
void meetingSignWebsocket(@RequestParam("userId")String userId);
|
||||
|
||||
/**
|
||||
* 29根据name获取所有参与用户
|
||||
* userNames
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryUserByNames")
|
||||
List<LoginUser> queryUserByNames(@RequestParam("userNames")String[] userNames);
|
||||
|
||||
|
||||
/**
|
||||
* 30获取用户的角色集合
|
||||
* @param username
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/getUserRoleSet")
|
||||
Set<String> getUserRoleSet(@RequestParam("username")String username);
|
||||
|
||||
/**
|
||||
* 31获取用户的权限集合
|
||||
* @param username
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/getUserPermissionSet")
|
||||
Set<String> getUserPermissionSet(@RequestParam("username") String username);
|
||||
|
||||
/**
|
||||
* 32判断是否有online访问的权限
|
||||
* @param onlineAuthDTO
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/sys/api/hasOnlineAuth")
|
||||
boolean hasOnlineAuth(@RequestBody OnlineAuthDTO onlineAuthDTO);
|
||||
|
||||
/**
|
||||
* 33通过部门id获取部门全部信息
|
||||
*/
|
||||
@GetMapping("/sys/api/selectAllById")
|
||||
SysDepartModel selectAllById(@RequestParam("id") String id);
|
||||
|
||||
/**
|
||||
* 34根据用户id查询用户所属公司下所有用户ids
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryDeptUsersByUserId")
|
||||
List<String> queryDeptUsersByUserId(@RequestParam("userId") String userId);
|
||||
|
||||
|
||||
//---
|
||||
|
||||
/**
|
||||
* 35查询用户角色信息
|
||||
* @param username
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryUserRoles")
|
||||
Set<String> queryUserRoles(@RequestParam("username")String username);
|
||||
|
||||
/**
|
||||
* 36查询用户权限信息
|
||||
* @param username
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryUserAuths")
|
||||
Set<String> queryUserAuths(@RequestParam("username")String username);
|
||||
|
||||
/**
|
||||
* 37根据 id 查询数据库中存储的 DynamicDataSourceModel
|
||||
*
|
||||
* @param dbSourceId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/getDynamicDbSourceById")
|
||||
DynamicDataSourceModel getDynamicDbSourceById(@RequestParam("dbSourceId") String dbSourceId);
|
||||
|
||||
/**
|
||||
* 38根据 code 查询数据库中存储的 DynamicDataSourceModel
|
||||
*
|
||||
* @param dbSourceCode
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/getDynamicDbSourceByCode")
|
||||
DynamicDataSourceModel getDynamicDbSourceByCode(@RequestParam("dbSourceCode") String dbSourceCode);
|
||||
|
||||
/**
|
||||
* 39根据用户账号查询用户信息 CommonAPI中定义
|
||||
* @param username
|
||||
*/
|
||||
@GetMapping("/sys/api/getUserByName")
|
||||
LoginUser getUserByName(@RequestParam("username") String username);
|
||||
|
||||
/**
|
||||
* 40字典表的 翻译
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param key
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/translateDictFromTable")
|
||||
String translateDictFromTable(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("key") String key);
|
||||
|
||||
/**
|
||||
* 41普通字典的翻译
|
||||
* @param code
|
||||
* @param key
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/translateDict")
|
||||
String translateDict(@RequestParam("code") String code, @RequestParam("key") String key);
|
||||
|
||||
/**
|
||||
* 42查询数据权限
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryPermissionDataRule")
|
||||
List<SysPermissionDataRuleModel> queryPermissionDataRule(@RequestParam("component") String component, @RequestParam("requestPath")String requestPath, @RequestParam("username") String username);
|
||||
|
||||
/**
|
||||
* 43查询用户信息
|
||||
* @param username
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/getCacheUser")
|
||||
SysUserCacheInfo getCacheUser(@RequestParam("username") String username);
|
||||
|
||||
/**
|
||||
* 36根据多个用户账号(逗号分隔),查询返回多个用户信息
|
||||
* @param usernames
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryUsersByUsernames")
|
||||
List<JSONObject> queryUsersByUsernames(String usernames);
|
||||
|
||||
/**
|
||||
* 37根据多个部门编码(逗号分隔),查询返回多个部门信息
|
||||
* @param orgCodes
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryDepartsByOrgcodes")
|
||||
List<JSONObject> queryDepartsByOrgcodes(String orgCodes);
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package org.jeecg.common.system.api.factory;
|
||||
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.system.api.fallback.SysBaseAPIFallback;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class SysBaseAPIFallbackFactory implements FallbackFactory<ISysBaseAPI> {
|
||||
|
||||
@Override
|
||||
public ISysBaseAPI create(Throwable throwable) {
|
||||
SysBaseAPIFallback fallback = new SysBaseAPIFallback();
|
||||
fallback.setCause(throwable);
|
||||
return fallback;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,248 @@
|
||||
package org.jeecg.common.system.api.fallback;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.dto.OnlineAuthDTO;
|
||||
import org.jeecg.common.api.dto.message.*;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.system.vo.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@Slf4j
|
||||
public class SysBaseAPIFallback implements ISysBaseAPI {
|
||||
|
||||
@Setter
|
||||
private Throwable cause;
|
||||
|
||||
@Override
|
||||
public void sendSysAnnouncement(MessageDTO message) {
|
||||
log.error("发送消息失败 {}", cause);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendBusAnnouncement(BusMessageDTO message) {
|
||||
log.error("发送消息失败 {}", cause);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendTemplateAnnouncement(TemplateMessageDTO message) {
|
||||
log.error("发送消息失败 {}", cause);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendBusTemplateAnnouncement(BusTemplateMessageDTO message) {
|
||||
log.error("发送消息失败 {}", cause);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String parseTemplateByCode(TemplateDTO templateDTO) {
|
||||
log.error("通过模板获取消息内容失败 {}", cause);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoginUser getUserById(String id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getRolesByUsername(String username) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getDepartIdsByUsername(String username) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getDepartNamesByUsername(String username) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictModel> queryDictItemsByCode(String code) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictModel> queryAllDict() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysCategoryModel> queryAllDSysCategory() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictModel> queryTableDictItemsByCode(String table, String text, String code) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictModel> queryAllDepartBackDictModel() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSysAnnounReadFlag(String busType, String busId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictModel> queryFilterTableDictInfo(String table, String text, String code, String filterSql) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> queryTableDictByKeys(String table, String text, String code, String[] keyArray) {
|
||||
log.error("queryTableDictByKeys查询失败 {}", cause);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ComboModel> queryAllUserBackCombo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject queryAllUser(String userIds, Integer pageNo, int pageSize) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ComboModel> queryAllRole(String[] roleIds) {
|
||||
log.error("获取角色信息失败 {}", cause);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getRoleIdsByUsername(String username) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDepartIdsByOrgCode(String orgCode) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysDepartModel> getAllSysDepart() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DictModel getParentDepartId(String departId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getDeptHeadByDepId(String deptId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendWebSocketMsg(String[] userIds, String cmd) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LoginUser> queryAllUserByIds(String[] userIds) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void meetingSignWebsocket(String userId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LoginUser> queryUserByNames(String[] userNames) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getUserRoleSet(String username) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getUserPermissionSet(String username) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasOnlineAuth(OnlineAuthDTO onlineAuthDTO) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysDepartModel selectAllById(String id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> queryDeptUsersByUserId(String userId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> queryUserRoles(String username) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> queryUserAuths(String username) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicDataSourceModel getDynamicDbSourceById(String dbSourceId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicDataSourceModel getDynamicDbSourceByCode(String dbSourceCode) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoginUser getUserByName(String username) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String translateDictFromTable(String table, String text, String code, String key) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String translateDict(String code, String key) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysPermissionDataRuleModel> queryPermissionDataRule(String component, String requestPath, String username) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysUserCacheInfo getCacheUser(String username) {
|
||||
log.error("获取用户信息失败 {}", cause);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> queryUsersByUsernames(String usernames) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> queryDepartsByOrgcodes(String orgCodes) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package org.jeecg.config;
|
||||
|
||||
import feign.Feign;
|
||||
import feign.Logger;
|
||||
import feign.RequestInterceptor;
|
||||
import feign.codec.Encoder;
|
||||
import feign.form.spring.SpringFormEncoder;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.springframework.beans.factory.ObjectFactory;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
|
||||
import org.springframework.cloud.openfeign.FeignAutoConfiguration;
|
||||
import org.springframework.cloud.openfeign.support.SpringEncoder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
|
||||
@ConditionalOnClass(Feign.class)
|
||||
@AutoConfigureBefore(FeignAutoConfiguration.class)
|
||||
@Slf4j
|
||||
@Configuration
|
||||
public class FeignConfig {
|
||||
|
||||
@Bean
|
||||
public RequestInterceptor requestInterceptor() {
|
||||
return requestTemplate -> {
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
if (null != attributes) {
|
||||
HttpServletRequest request = attributes.getRequest();
|
||||
log.info("Feign request: {}", request.getRequestURI());
|
||||
// 将token信息放入header中
|
||||
requestTemplate.header(CommonConstant.X_ACCESS_TOKEN, request.getHeader(CommonConstant.X_ACCESS_TOKEN));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Feign 客户端的日志记录,默认级别为NONE
|
||||
* Logger.Level 的具体级别如下:
|
||||
* NONE:不记录任何信息
|
||||
* BASIC:仅记录请求方法、URL以及响应状态码和执行时间
|
||||
* HEADERS:除了记录 BASIC级别的信息外,还会记录请求和响应的头信息
|
||||
* FULL:记录所有请求与响应的明细,包括头信息、请求体、元数据
|
||||
*/
|
||||
@Bean
|
||||
Logger.Level feignLoggerLevel() {
|
||||
return Logger.Level.FULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Feign支持文件上传
|
||||
* @param messageConverters
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
@Primary
|
||||
@Scope("prototype")
|
||||
public Encoder multipartFormEncoder(ObjectFactory<HttpMessageConverters> messageConverters) {
|
||||
return new SpringFormEncoder(new SpringEncoder(messageConverters));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
<?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">
|
||||
<parent>
|
||||
<artifactId>jeecg-boot-base-api</artifactId>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<version>2.3.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>jeecg-system-local-api</artifactId>
|
||||
|
||||
</project>
|
||||
@ -0,0 +1,278 @@
|
||||
package org.jeecg.common.system.api;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.jeecg.common.api.CommonAPI;
|
||||
import org.jeecg.common.api.dto.OnlineAuthDTO;
|
||||
import org.jeecg.common.api.dto.message.*;
|
||||
import org.jeecg.common.system.vo.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @Description 底层共通业务API,提供其他独立模块调用
|
||||
* @Author scott
|
||||
* @Date 2019-4-20
|
||||
* @Version V1.0
|
||||
*/
|
||||
public interface ISysBaseAPI extends CommonAPI {
|
||||
|
||||
|
||||
/**
|
||||
* 1发送系统消息
|
||||
* @param message 使用构造器赋值参数 如果不设置category(消息类型)则默认为2 发送系统消息
|
||||
*/
|
||||
void sendSysAnnouncement(MessageDTO message);
|
||||
|
||||
/**
|
||||
* 2发送消息 附带业务参数
|
||||
* @param message 使用构造器赋值参数
|
||||
*/
|
||||
void sendBusAnnouncement(BusMessageDTO message);
|
||||
|
||||
/**
|
||||
* 3通过模板发送消息
|
||||
* @param message 使用构造器赋值参数
|
||||
*/
|
||||
void sendTemplateAnnouncement(TemplateMessageDTO message);
|
||||
|
||||
/**
|
||||
* 4通过模板发送消息 附带业务参数
|
||||
* @param message 使用构造器赋值参数
|
||||
*/
|
||||
void sendBusTemplateAnnouncement(BusTemplateMessageDTO message);
|
||||
|
||||
/**
|
||||
* 5通过消息中心模板,生成推送内容
|
||||
* @param templateDTO 使用构造器赋值参数
|
||||
* @return
|
||||
*/
|
||||
String parseTemplateByCode(TemplateDTO templateDTO);
|
||||
|
||||
/**
|
||||
* 6根据用户id查询用户信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
LoginUser getUserById(String id);
|
||||
|
||||
/**
|
||||
* 7通过用户账号查询角色集合
|
||||
* @param username
|
||||
* @return
|
||||
*/
|
||||
List<String> getRolesByUsername(String username);
|
||||
|
||||
/**
|
||||
* 8通过用户账号查询部门集合
|
||||
* @param username
|
||||
* @return 部门 id
|
||||
*/
|
||||
List<String> getDepartIdsByUsername(String username);
|
||||
|
||||
/**
|
||||
* 9通过用户账号查询部门 name
|
||||
* @param username
|
||||
* @return 部门 name
|
||||
*/
|
||||
List<String> getDepartNamesByUsername(String username);
|
||||
|
||||
/**
|
||||
* 10获取数据字典
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
public List<DictModel> queryDictItemsByCode(String code);
|
||||
|
||||
/** 11查询所有的父级字典,按照create_time排序 */
|
||||
public List<DictModel> queryAllDict();
|
||||
|
||||
/**
|
||||
* 12查询所有分类字典
|
||||
* @return
|
||||
*/
|
||||
public List<SysCategoryModel> queryAllDSysCategory();
|
||||
|
||||
/**
|
||||
* 13获取表数据字典
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
List<DictModel> queryTableDictItemsByCode(String table, String text, String code);
|
||||
|
||||
/**
|
||||
* 14查询所有部门 作为字典信息 id -->value,departName -->text
|
||||
* @return
|
||||
*/
|
||||
public List<DictModel> queryAllDepartBackDictModel();
|
||||
|
||||
/**
|
||||
* 15根据业务类型及业务id修改消息已读
|
||||
* @param busType
|
||||
* @param busId
|
||||
*/
|
||||
public void updateSysAnnounReadFlag(String busType, String busId);
|
||||
|
||||
/**
|
||||
* 16查询表字典 支持过滤数据
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param filterSql
|
||||
* @return
|
||||
*/
|
||||
public List<DictModel> queryFilterTableDictInfo(String table, String text, String code, String filterSql);
|
||||
|
||||
/**
|
||||
* 17查询指定table的 text code 获取字典,包含text和value
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param keyArray
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public List<String> queryTableDictByKeys(String table, String text, String code, String[] keyArray);
|
||||
|
||||
/**
|
||||
* 18查询所有用户 返回ComboModel
|
||||
* @return
|
||||
*/
|
||||
public List<ComboModel> queryAllUserBackCombo();
|
||||
|
||||
/**
|
||||
* 19分页查询用户 返回JSONObject
|
||||
* @return
|
||||
*/
|
||||
public JSONObject queryAllUser(String userIds, Integer pageNo, Integer pageSize);
|
||||
|
||||
/**
|
||||
* 20获取所有角色
|
||||
* @return
|
||||
*/
|
||||
public List<ComboModel> queryAllRole();
|
||||
|
||||
/**
|
||||
* 21获取所有角色 带参
|
||||
* roleIds 默认选中角色
|
||||
* @return
|
||||
*/
|
||||
public List<ComboModel> queryAllRole(String[] roleIds );
|
||||
|
||||
/**
|
||||
* 22通过用户账号查询角色Id集合
|
||||
* @param username
|
||||
* @return
|
||||
*/
|
||||
public List<String> getRoleIdsByUsername(String username);
|
||||
|
||||
/**
|
||||
* 23通过部门编号查询部门id
|
||||
* @param orgCode
|
||||
* @return
|
||||
*/
|
||||
public String getDepartIdsByOrgCode(String orgCode);
|
||||
|
||||
/**
|
||||
* 24查询所有部门
|
||||
* @return
|
||||
*/
|
||||
public List<SysDepartModel> getAllSysDepart();
|
||||
|
||||
/**
|
||||
* 25查找父级部门
|
||||
* @param departId
|
||||
* @return
|
||||
*/
|
||||
DictModel getParentDepartId(String departId);
|
||||
|
||||
/**
|
||||
* 26根据部门Id获取部门负责人
|
||||
* @param deptId
|
||||
* @return
|
||||
*/
|
||||
public List<String> getDeptHeadByDepId(String deptId);
|
||||
|
||||
/**
|
||||
* 27给指定用户发消息
|
||||
* @param userIds
|
||||
* @param cmd
|
||||
*/
|
||||
public void sendWebSocketMsg(String[] userIds, String cmd);
|
||||
|
||||
/**
|
||||
* 28根据id获取所有参与用户
|
||||
* userIds
|
||||
* @return
|
||||
*/
|
||||
public List<LoginUser> queryAllUserByIds(String[] userIds);
|
||||
|
||||
/**
|
||||
* 29将会议签到信息推动到预览
|
||||
* userIds
|
||||
* @return
|
||||
* @param userId
|
||||
*/
|
||||
void meetingSignWebsocket(String userId);
|
||||
|
||||
/**
|
||||
* 30根据name获取所有参与用户
|
||||
* userNames
|
||||
* @return
|
||||
*/
|
||||
List<LoginUser> queryUserByNames(String[] userNames);
|
||||
|
||||
|
||||
/**
|
||||
* 31获取用户的角色集合
|
||||
* @param username
|
||||
* @return
|
||||
*/
|
||||
Set<String> getUserRoleSet(String username);
|
||||
|
||||
/**
|
||||
* 32获取用户的权限集合
|
||||
* @param username
|
||||
* @return
|
||||
*/
|
||||
Set<String> getUserPermissionSet(String username);
|
||||
|
||||
/**
|
||||
* 33判断是否有online访问的权限
|
||||
* @param onlineAuthDTO
|
||||
* @return
|
||||
*/
|
||||
boolean hasOnlineAuth(OnlineAuthDTO onlineAuthDTO);
|
||||
|
||||
/**
|
||||
* 34通过部门id获取部门全部信息
|
||||
*/
|
||||
SysDepartModel selectAllById(String id);
|
||||
|
||||
/**
|
||||
* 35根据用户id查询用户所属公司下所有用户ids
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<String> queryDeptUsersByUserId(String userId);
|
||||
|
||||
/**
|
||||
* 36根据多个用户账号(逗号分隔),查询返回多个用户信息
|
||||
* @param usernames
|
||||
* @return
|
||||
*/
|
||||
List<JSONObject> queryUsersByUsernames(String usernames);
|
||||
|
||||
/**
|
||||
* 37根据多个部门编码(逗号分隔),查询返回多个部门信息
|
||||
* @param orgCodes
|
||||
* @return
|
||||
*/
|
||||
List<JSONObject> queryDepartsByOrgcodes(String orgCodes);
|
||||
|
||||
}
|
||||
26
jeecg-boot/jeecg-boot-base-api/pom.xml
Normal file
26
jeecg-boot/jeecg-boot-base-api/pom.xml
Normal file
@ -0,0 +1,26 @@
|
||||
<?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">
|
||||
<parent>
|
||||
<artifactId>jeecg-boot-parent</artifactId>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<version>2.3.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>jeecg-boot-base-api</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<modules>
|
||||
<module>jeecg-system-local-api</module>
|
||||
<module>jeecg-system-cloud-api</module>
|
||||
</modules>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>jeecg-boot-base-common</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
Reference in New Issue
Block a user