first commit
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?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-system-api</artifactId>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<version>3.8.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>jeecg-system-cloud-api</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<!-- feign -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
package org.jeecg.common.bpm.api;
|
||||
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.constant.ServiceNameConstants;
|
||||
import org.jeecg.common.online.api.factory.OnlineBaseExtApiFallbackFactory;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
|
||||
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.RequestParam;
|
||||
|
||||
/**
|
||||
* 流程接口
|
||||
*
|
||||
* @ConditionalOnMissingClass("org.jeecg.modules.extbpm.process.service.impl.BpmBaseExtApiImpl") => 有实现类的时候,不实例化Feign接口
|
||||
* @author scott
|
||||
*/
|
||||
@Component
|
||||
@FeignClient(contextId = "bpmBaseRemoteApi", value = ServiceNameConstants.SERVICE_SYSTEM, fallbackFactory = OnlineBaseExtApiFallbackFactory.class)
|
||||
@ConditionalOnMissingClass("org.jeecg.modules.extbpm.process.service.impl.BpmBaseExtApiImpl")
|
||||
public interface IBpmBaseExtApi {
|
||||
/**
|
||||
* 23. 流程提交接口(online,自定义开发)
|
||||
*
|
||||
* @param flowCode
|
||||
* 流程业务关联 例如:joa_leave_01
|
||||
* @param id
|
||||
* 表单业务数据data id
|
||||
* @param formUrl
|
||||
* 流程审批时附件页面默认展示的PC端表单组件(地址)
|
||||
* @param formUrlMobile
|
||||
* 流程审批时附件页面默认展示的移动端表单组件(地址)
|
||||
* @param username
|
||||
* 流程发起人账号
|
||||
* @param jsonData
|
||||
* Json串,额外扩展的流程变量值 【非必填】
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@PostMapping(value = "/act/process/extActProcess/startMutilProcess")
|
||||
Result<String> startMutilProcess(@RequestParam("flowCode") String flowCode, @RequestParam("id") String id,
|
||||
@RequestParam("formUrl") String formUrl, @RequestParam("formUrlMobile") String formUrlMobile,
|
||||
@RequestParam("username") String username, @RequestParam("jsonData") String jsonData) throws Exception;
|
||||
|
||||
/**
|
||||
* 24. 流程提交接口(自定义表单设计器)
|
||||
*
|
||||
* @param flowCode
|
||||
* 流程业务关联 例如:joa_leave_01
|
||||
* @param id
|
||||
* 表单业务数据data id
|
||||
* @param formUrl
|
||||
* 流程审批时附件页面默认展示的PC端表单组件(地址)
|
||||
* @param formUrlMobile
|
||||
* 流程审批时附件页面默认展示的移动端表单组件(地址)
|
||||
* @param username
|
||||
* 流程发起人账号
|
||||
* @param jsonData
|
||||
* Json串,额外扩展的流程变量值 【非必填】
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@PostMapping(value = "/act/process/extActProcess/startDesFormMutilProcess")
|
||||
Result<String> startDesFormMutilProcess(@RequestParam("flowCode") String flowCode, @RequestParam("id") String id,
|
||||
@RequestParam("formUrl") String formUrl, @RequestParam("formUrlMobile") String formUrlMobile,
|
||||
@RequestParam("username") String username, @RequestParam("jsonData") String jsonData) throws Exception;
|
||||
|
||||
/**
|
||||
* 25. 保存流程草稿箱接口(自定义开发表单、online表单)
|
||||
*
|
||||
* @param flowCode
|
||||
* 流程业务关联 例如:joa_leave_01
|
||||
* @param id
|
||||
* 表单业务数据data id
|
||||
* @param formUrl
|
||||
* 流程审批时附件页面默认展示的PC端表单组件(地址) 【非必填】
|
||||
* @param formUrlMobile
|
||||
* 流程审批时附件页面默认展示的移动端表单组件(地址) 【非必填】
|
||||
* @param username
|
||||
* 流程发起人账号
|
||||
* @param jsonData
|
||||
* Json串,额外扩展的流程变量值 【非必填】
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@PostMapping(value = "/act/process/extActProcess/saveMutilProcessDraft")
|
||||
Result<String> saveMutilProcessDraft(@RequestParam("flowCode") String flowCode, @RequestParam("id") String id,
|
||||
@RequestParam("formUrl") String formUrl, @RequestParam("formUrlMobile") String formUrlMobile,
|
||||
@RequestParam("username") String username, @RequestParam("jsonData") String jsonData) throws Exception;
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除应用下的流程
|
||||
*
|
||||
* @param appId 零代码应用ID
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@GetMapping(value = "/act/process/extActProcess/batchDeleteProcessByAppId")
|
||||
Boolean batchDeleteProcessByAppId(@RequestParam("appId") String appId) throws Exception;
|
||||
|
||||
/**
|
||||
* 批量关闭应用下的流程
|
||||
*
|
||||
* @param appId 零代码应用ID
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@GetMapping(value = "/act/process/extActProcess/batchCloseProcessByAppId")
|
||||
Boolean batchCloseProcessByAppId(@RequestParam("appId") String appId) throws Exception;
|
||||
|
||||
/**
|
||||
* 批量激活应用下的流程(打开激活流程,如未发布过则同时发布流程)
|
||||
*
|
||||
* @param appId 零代码应用ID
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@GetMapping(value = "/act/process/extActProcess/batchActivateProcessByAppId")
|
||||
Boolean batchActivateProcessByAppId(String appId) throws Exception;
|
||||
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package org.jeecg.common.bpm.api.factory;
|
||||
|
||||
import org.jeecg.common.bpm.api.IBpmBaseExtApi;
|
||||
import org.jeecg.common.bpm.api.fallback.BpmBaseExtApiFallback;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
|
||||
/**
|
||||
* @Description: BpmBaseExtAPIFallbackFactory
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Component
|
||||
public class BpmBaseExtApiFallbackFactory implements FallbackFactory<IBpmBaseExtApi> {
|
||||
|
||||
@Override
|
||||
public IBpmBaseExtApi create(Throwable throwable) {
|
||||
BpmBaseExtApiFallback fallback = new BpmBaseExtApiFallback();
|
||||
fallback.setCause(throwable);
|
||||
return fallback;
|
||||
}
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
package org.jeecg.common.bpm.api.fallback;
|
||||
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.bpm.api.IBpmBaseExtApi;
|
||||
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* @Description: 进入fallback的方法 检查是否token未设置
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Slf4j
|
||||
public class BpmBaseExtApiFallback implements IBpmBaseExtApi {
|
||||
|
||||
@Setter
|
||||
private Throwable cause;
|
||||
|
||||
@Override
|
||||
public Result<String> startMutilProcess(String flowCode, String id, String formUrl, String formUrlMobile,
|
||||
String username, String jsonData) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<String> startDesFormMutilProcess(String flowCode, String id, String formUrl, String formUrlMobile,
|
||||
String username, String jsonData) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<String> saveMutilProcessDraft(String flowCode, String id, String formUrl, String formUrlMobile,
|
||||
String username, String jsonData) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean batchDeleteProcessByAppId(String appId) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean batchCloseProcessByAppId(String appId) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean batchActivateProcessByAppId(String appId) throws Exception {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+186
@@ -0,0 +1,186 @@
|
||||
package org.jeecg.common.desform.api;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.jeecg.common.constant.ServiceNameConstants;
|
||||
import org.jeecg.common.desform.api.fallbak.DesformBaseApiFallback;
|
||||
import org.jeecg.common.desform.vo.DesignFormDataVo;
|
||||
import org.jeecg.common.lowapp.model.LowAppCopyMenu;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 表单设计器API接口
|
||||
*
|
||||
* @author sunjianlei
|
||||
*/
|
||||
@Component
|
||||
@FeignClient(contextId = "desformBaseRemoteApi", value = ServiceNameConstants.SERVICE_SYSTEM, fallbackFactory = DesformBaseApiFallback.class)
|
||||
@ConditionalOnMissingClass("org.jeecg.modules.online.desform.service.impl.DesformBaseApiImpl")
|
||||
public interface IDesformBaseApi {
|
||||
|
||||
/**
|
||||
* 通过id获取表单数据
|
||||
*
|
||||
* @param desformCode
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/desform/api/getDataById")
|
||||
DesignFormDataVo getDataById(@RequestParam("desformCode") String desformCode, @RequestParam("id") String id);
|
||||
|
||||
/**
|
||||
* 通过id获取表单数据 (数据进行翻译)
|
||||
*
|
||||
* @param desformCode
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/desform/api/getTranslateDataById")
|
||||
DesignFormDataVo getTranslateDataById(@RequestParam("desformCode") String desformCode, @RequestParam("id") String id);
|
||||
|
||||
/**
|
||||
* 通过ids批量获取表单数据,多个ID用英文逗号分割
|
||||
*
|
||||
* @param desformCode
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/desform/api/getDataByIds")
|
||||
List<DesignFormDataVo> getDataByIds(@RequestParam("desformCode") String desformCode, @RequestParam("ids") String ids);
|
||||
|
||||
/**
|
||||
* 通过id修改数据
|
||||
*
|
||||
* @param desformCode
|
||||
* @param id 数据id
|
||||
* @param jsonData 数据json
|
||||
* @return
|
||||
*/
|
||||
@PutMapping(value = "/desform/api/updateDataById")
|
||||
boolean updateDataById(@RequestParam("desformCode") String desformCode, @RequestParam("id") String id, @RequestBody JSONObject jsonData);
|
||||
|
||||
/**
|
||||
* 通过ids批量删除表单数据,多个ID用英文逗号分割
|
||||
*
|
||||
* @param desformCode
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping(value = "/desform/api/deleteDataById")
|
||||
boolean deleteDataById(@RequestParam("desformCode") String desformCode, @RequestParam("ids") String ids);
|
||||
|
||||
/**
|
||||
* 后台翻译多条数据
|
||||
* 翻译数据,封装翻译结果
|
||||
*
|
||||
* @param desformCode 表单编码
|
||||
* @param dataList 数据列表
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/desform/api/translateData/{desformCode}")
|
||||
JSONObject translateListDataByJsonArray(@PathVariable("desformCode") String desformCode, @RequestBody JSONArray dataList);
|
||||
|
||||
/**
|
||||
* 后台翻译多条数据
|
||||
* 翻译数据,封装翻译结果
|
||||
*
|
||||
* @param desformCode 表单编码
|
||||
* @param onlyFields 仅翻译的字段,逗号分割。不传则翻译所有字段
|
||||
* @param dataList 数据列表
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/desform/api/translateData2")
|
||||
JSONObject translateListDataByJsonArray2(
|
||||
@RequestParam("desformCode") String desformCode,
|
||||
@RequestParam(name = "onlyFields", required = false) String onlyFields,
|
||||
@RequestBody JSONArray dataList
|
||||
);
|
||||
|
||||
/**
|
||||
* 删除表单
|
||||
* @param designFormCode
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping(value = "/desform/api/deleteDesignForm")
|
||||
boolean deleteDesignForm(@RequestParam("designFormCode") String designFormCode);
|
||||
|
||||
|
||||
/**
|
||||
* 复制 表单
|
||||
* @param lowAppCopyMenu
|
||||
* @return
|
||||
*/
|
||||
@PutMapping(value = "/desform/api/copyDesignForm")
|
||||
LowAppCopyMenu copyDesignForm(@RequestBody LowAppCopyMenu lowAppCopyMenu);
|
||||
|
||||
/**
|
||||
* 复制app时,复制表单设计器json,需要修改json中的关联记录的编码,子表的编码
|
||||
* @param lowAppCopyMenu
|
||||
* 用到属性如下:
|
||||
* formCodeMapping 表单复制 原表单编码--> 新表单编码的映射关系
|
||||
*/
|
||||
@PutMapping(value = "/desform/api/updateDesignFormJson")
|
||||
void updateDesignFormJson(@RequestBody LowAppCopyMenu lowAppCopyMenu);
|
||||
|
||||
/**
|
||||
* 从备份还原app
|
||||
* @param lowAppCopyMenu
|
||||
* 用到属性如下:
|
||||
* originFormCode 表单设计器 原来的编码、
|
||||
* isIdForm 表单设计器,是否是采用ID访问、
|
||||
* backupKey 备份标识
|
||||
*/
|
||||
@PutMapping(value = "/desform/api/coverDesignForm")
|
||||
void coverDesignForm(@RequestBody LowAppCopyMenu lowAppCopyMenu);
|
||||
|
||||
/**
|
||||
* 通过表单编码获取表单视图列表
|
||||
*
|
||||
* @param desformCode 表单设计器编码
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/desform/api/getViewListByCode")
|
||||
List<JSONObject> getViewListByCode(@RequestParam("desformCode") String desformCode);
|
||||
|
||||
|
||||
/**
|
||||
* 修改自定义按钮的流程id
|
||||
* @param lowAppCopyMenu
|
||||
*/
|
||||
@PutMapping(value = "/desform/api/updateLowAppButtonProcessId")
|
||||
void updateLowAppButtonProcessId(@RequestBody LowAppCopyMenu lowAppCopyMenu);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 复制 列表上方图表配置的 chartId
|
||||
* @param lowAppCopyMenu
|
||||
*/
|
||||
@PutMapping(value = "/desform/api/copyLowAppChart")
|
||||
void copyLowAppChart(@RequestBody LowAppCopyMenu lowAppCopyMenu);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 删除设计器表单
|
||||
* @param menuUrl
|
||||
* @param deleteMongo
|
||||
*/
|
||||
@DeleteMapping(value = "/desform/api/deleteDesignFormForAppCopy")
|
||||
void deleteDesignFormForAppCopy(@RequestParam("menuUrl")String menuUrl, @RequestParam("deleteMongo")Boolean deleteMongo);
|
||||
|
||||
/**
|
||||
* 关联记录的关联表是其他租户下的,则设置该控件不可用
|
||||
* @date 20230913
|
||||
* @author scott
|
||||
*
|
||||
* @param lowAppCopyMenu
|
||||
*/
|
||||
@PutMapping(value = "/desform/api/batchDisabledOtherTenantLinkRecords")
|
||||
void batchDisabledOtherTenantLinkRecords(@RequestBody LowAppCopyMenu lowAppCopyMenu);
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package org.jeecg.common.desform.api.factory;
|
||||
|
||||
import org.jeecg.common.desform.api.IDesformBaseApi;
|
||||
import org.jeecg.common.desform.api.fallbak.DesformBaseApiFallback;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* DesformBaseApiFallbackFactory
|
||||
* @author: sunjianlei
|
||||
*/
|
||||
@Component
|
||||
public class DesformBaseApiFallbackFactory implements FallbackFactory<IDesformBaseApi> {
|
||||
|
||||
@Override
|
||||
public IDesformBaseApi create(Throwable throwable) {
|
||||
DesformBaseApiFallback fallback = new DesformBaseApiFallback();
|
||||
fallback.setCause(throwable);
|
||||
return fallback;
|
||||
}
|
||||
}
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
package org.jeecg.common.desform.api.fallbak;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.desform.api.IDesformBaseApi;
|
||||
import org.jeecg.common.desform.vo.DesignFormDataVo;
|
||||
import org.jeecg.common.lowapp.model.LowAppCopyMenu;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* IDesformBaseApi fallback
|
||||
* @author sunjianlei
|
||||
*/
|
||||
@Slf4j
|
||||
public class DesformBaseApiFallback implements IDesformBaseApi {
|
||||
|
||||
@Setter
|
||||
private Throwable cause;
|
||||
|
||||
@Override
|
||||
public DesignFormDataVo getDataById(String desformCode, String id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DesignFormDataVo getTranslateDataById(String desformCode, String id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DesignFormDataVo> getDataByIds(String desformCode, String ids) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateDataById(String desformCode, String id, JSONObject jsonData) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteDataById(String desformCode, String ids) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject translateListDataByJsonArray(String desformCode, JSONArray dataList) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject translateListDataByJsonArray2(String desformCode, String onlyFields, JSONArray dataList) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteDesignForm(String designFormCode) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LowAppCopyMenu copyDesignForm(LowAppCopyMenu lowAppCopyMenu) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDesignFormJson(LowAppCopyMenu lowAppCopyMenu) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void coverDesignForm(LowAppCopyMenu lowAppCopyMenu) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> getViewListByCode(String desformCode) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateLowAppButtonProcessId(LowAppCopyMenu lowAppCopyMenu) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void copyLowAppChart(LowAppCopyMenu lowAppCopyMenu) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDesignFormForAppCopy(String menuUrl, Boolean deleteMongo) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void batchDisabledOtherTenantLinkRecords(LowAppCopyMenu lowAppCopyMenu) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
package org.jeecg.common.desform.vo;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import org.bson.Document;
|
||||
import org.bson.json.JsonWriterSettings;
|
||||
import org.jeecg.common.desform.vo.def.BigDecimalVoConverter;
|
||||
import org.jeecg.common.desform.vo.def.DesformVoFields;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description: 表单设计数据
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2019-05-16
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
public class DesignFormDataVo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final BigDecimalVoConverter BIG_DECIMAL_CONVERTER = new BigDecimalVoConverter();
|
||||
|
||||
/**
|
||||
* 将MongoDB的数据转换为DesignFormData
|
||||
*
|
||||
* @param document
|
||||
*/
|
||||
public DesignFormDataVo(String desformCode, Document document) {
|
||||
JsonWriterSettings writerSettings = JsonWriterSettings
|
||||
.builder()
|
||||
.decimal128Converter(BIG_DECIMAL_CONVERTER)
|
||||
.build();
|
||||
this.parseDataByJson(desformCode, JSON.parseObject(document.toJson(writerSettings)));
|
||||
}
|
||||
|
||||
public DesignFormDataVo(String desformCode, JSONObject jsonData) {
|
||||
this.parseDataByJson(desformCode, jsonData);
|
||||
}
|
||||
public DesignFormDataVo() {
|
||||
}
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 表单设计ID
|
||||
*/
|
||||
private String desformId;
|
||||
/**
|
||||
* 表单设计编码
|
||||
*/
|
||||
private String desformCode;
|
||||
/**
|
||||
* 表单设计名称
|
||||
*/
|
||||
private String desformName;
|
||||
/**
|
||||
* 表单数据JSON
|
||||
*/
|
||||
private String desformDataJson;
|
||||
/**
|
||||
* 表单设计器原始数据
|
||||
*/
|
||||
private JSONObject desformData;
|
||||
/**
|
||||
* Online表单的Code
|
||||
*/
|
||||
private String onlineFormCode;
|
||||
/**
|
||||
* Online数据表中的id,用于修改
|
||||
*/
|
||||
private String onlineFormDataId;
|
||||
private String bpmStatus;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createBy;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private java.util.Date createTime;
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String updateBy;
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private java.util.Date updateTime;
|
||||
|
||||
/** 非持久化:是否触发流程信号 */
|
||||
private boolean isTriggerProcess = true;
|
||||
|
||||
/**
|
||||
* 获取数据JSON字符串
|
||||
*/
|
||||
public String getDesformDataJson() {
|
||||
if (this.desformData == null) {
|
||||
return this.desformDataJson;
|
||||
}
|
||||
return this.desformData.toJSONString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过 jsonData 赋值
|
||||
*
|
||||
* @param desformCode
|
||||
* @param jsonData
|
||||
*/
|
||||
private void parseDataByJson(String desformCode, JSONObject jsonData) {
|
||||
this.desformCode = desformCode;
|
||||
this.id = jsonData.getString(DesformVoFields.ID);
|
||||
this.desformId = jsonData.getString(DesformVoFields.DESFORM_ID);
|
||||
this.desformName = jsonData.getString(DesformVoFields.DESFORM_NAME);
|
||||
this.onlineFormCode = jsonData.getString(DesformVoFields.ONLINE_FORM_CODE);
|
||||
this.onlineFormDataId = jsonData.getString(DesformVoFields.ONLINE_FORM_ID);
|
||||
this.bpmStatus = jsonData.getString(DesformVoFields.BPM_STATUS);
|
||||
this.createBy = jsonData.getString(DesformVoFields.CREATE_BY);
|
||||
this.createTime = jsonData.getDate(DesformVoFields.CREATE_TIME);
|
||||
this.updateBy = jsonData.getString(DesformVoFields.UPDATE_BY);
|
||||
this.updateTime = jsonData.getDate(DesformVoFields.UPDATE_TIME);
|
||||
this.desformData = jsonData;
|
||||
}
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package org.jeecg.common.desform.vo.def;
|
||||
|
||||
import org.bson.json.Converter;
|
||||
import org.bson.json.StrictJsonWriter;
|
||||
import org.bson.types.Decimal128;
|
||||
|
||||
/**
|
||||
* 将 Decimal128 转换为 BigDecimal
|
||||
*/
|
||||
public class BigDecimalVoConverter implements Converter<Decimal128> {
|
||||
|
||||
@Override
|
||||
public void convert(Decimal128 value, StrictJsonWriter writer) {
|
||||
writer.writeRaw(value.toString());
|
||||
}
|
||||
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package org.jeecg.common.desform.vo.def;
|
||||
|
||||
/**
|
||||
* 表单设计器,MongoDB标准字段
|
||||
*/
|
||||
public interface DesformVoFields {
|
||||
// ID不能去掉前下划线
|
||||
String ID = "_id";
|
||||
String ID_SQL = "id";
|
||||
String DESFORM_ID = "desform_id";
|
||||
String DESFORM_NAME = "desform_name";
|
||||
String ONLINE_FORM_CODE = "online_form_code";
|
||||
String ONLINE_FORM_ID = "online_form_id";
|
||||
String BPM_STATUS = "bpm_status";
|
||||
String CREATE_BY = "create_by";
|
||||
String CREATE_TIME = "create_time";
|
||||
String UPDATE_BY = "update_by";
|
||||
String UPDATE_TIME = "update_time";
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
package org.jeecg.common.drag.api;
|
||||
|
||||
import org.jeecg.common.api.dto.DragRelIdsDTO;
|
||||
import org.jeecg.common.constant.ServiceNameConstants;
|
||||
import org.jeecg.common.drag.api.fallbak.DragBaseApiFallback;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
/**
|
||||
* 仪表盘API接口
|
||||
*
|
||||
* @author lsq
|
||||
* @date 2023/01/09
|
||||
*/
|
||||
@Component
|
||||
@FeignClient(contextId = "dragBaseRemoteApi", value = ServiceNameConstants.SERVICE_SYSTEM, fallbackFactory = DragBaseApiFallback.class)
|
||||
@ConditionalOnMissingClass("org.jeecg.modules.drag.service.impl.OnlDragBaseApiImpl")
|
||||
public interface IDragBaseApi {
|
||||
|
||||
/**
|
||||
* 通过id赋值仪表盘数据
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/drag/api/copyDragPage")
|
||||
String copyDragPage(@RequestParam("id") String id,@RequestParam("tenantId") Integer tenantId);
|
||||
|
||||
/**
|
||||
* 删除表单
|
||||
* @param id
|
||||
*/
|
||||
@DeleteMapping(value = "/drag/api/deleteDragPage")
|
||||
void deleteDragPage(@RequestParam("id") String id);
|
||||
|
||||
/**
|
||||
* 备份仪表盘
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/drag/api/backupsPageCrossApp")
|
||||
String backupsPage(@RequestParam("id") String id,@RequestParam("backupKey") String backupKey);
|
||||
|
||||
/**
|
||||
* 还原仪表盘
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/drag/api/revertPageCrossApp")
|
||||
void revertPage(@RequestParam("id") String id,@RequestParam("backupKey") String backupKey);
|
||||
|
||||
/**
|
||||
*跨应用复制
|
||||
* @param dragRelIdsDTO
|
||||
*/
|
||||
@PostMapping(value = "/drag/api/copyPageCrossApp")
|
||||
String copyPageCrossApp(@RequestBody DragRelIdsDTO dragRelIdsDTO);
|
||||
|
||||
/**
|
||||
* 替换配置关联id
|
||||
* @param dragRelIdsDTO
|
||||
*/
|
||||
@PostMapping(value = "/drag/api/replacePageRelIdsCrossApp")
|
||||
void replacePageRelIdsCrossApp(@RequestBody DragRelIdsDTO dragRelIdsDTO);
|
||||
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package org.jeecg.common.drag.api.factory;
|
||||
|
||||
import org.jeecg.common.drag.api.IDragBaseApi;
|
||||
import org.jeecg.common.drag.api.fallbak.DragBaseApiFallback;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* DragBaseApiFallbackFactory
|
||||
* @author: lsq
|
||||
* @date 2023/01/09
|
||||
*/
|
||||
@Component
|
||||
public class DragBaseApiFallbackFactory implements FallbackFactory<IDragBaseApi> {
|
||||
|
||||
|
||||
@Override
|
||||
public IDragBaseApi create(Throwable throwable) {
|
||||
DragBaseApiFallback fallback = new DragBaseApiFallback();
|
||||
fallback.setCause(throwable);
|
||||
return fallback;
|
||||
}
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package org.jeecg.common.drag.api.fallbak;
|
||||
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.dto.DragRelIdsDTO;
|
||||
import org.jeecg.common.drag.api.IDragBaseApi;
|
||||
|
||||
/**
|
||||
* IDragBaseApi fallback
|
||||
* @author LSQ
|
||||
* @date 2023/01/09
|
||||
*/
|
||||
@Slf4j
|
||||
public class DragBaseApiFallback implements IDragBaseApi {
|
||||
|
||||
@Setter
|
||||
private Throwable cause;
|
||||
|
||||
@Override
|
||||
public String copyDragPage(String id,Integer tenantId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDragPage(String id) {}
|
||||
|
||||
@Override
|
||||
public String backupsPage(String id, String backupKey) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void revertPage(String id, String backupKey) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String copyPageCrossApp(DragRelIdsDTO dragRelIdsDTO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void replacePageRelIdsCrossApp(DragRelIdsDTO dragRelIdsDTO) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
package org.jeecg.common.easyoa.api;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.jeecg.common.constant.ServiceNameConstants;
|
||||
import org.jeecg.common.constant.enums.FileTypeEnum;
|
||||
import org.jeecg.common.easyoa.api.factory.EasyOaBaseApiFallbackFactory;
|
||||
import org.jeecg.common.system.vo.SysFilesModel;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @Description: EasyOA Feign API接口
|
||||
* @author: jeecg-boot
|
||||
* @date: 2022/3/29 20:40
|
||||
*/
|
||||
@Component
|
||||
@FeignClient(contextId = "easyoaBaseRemoteApi", value = ServiceNameConstants.SERVICE_JOA, fallbackFactory = EasyOaBaseApiFallbackFactory.class)
|
||||
@ConditionalOnMissingClass("org.jeecg.modules.eoa.officialdoc.service.impl.EasyOaBaseApiImpl")
|
||||
public interface IEasyOaBaseApi {
|
||||
|
||||
/**
|
||||
* 获取公文发文模板
|
||||
*
|
||||
* @param fileId
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/eoa/api/oaOfficialdocOrgancode/getTemp")
|
||||
JSONObject oaOfficialdocOrgancodeGetTemp(@RequestParam("fileId") String fileId, @RequestParam("code") String code);
|
||||
|
||||
/**
|
||||
* 用户id和模板id修改
|
||||
* @param oaOfficialdocTemp 包含用户id和模板id
|
||||
* @return boolean 是否修改成功
|
||||
*/
|
||||
@PostMapping("/oaOfficialdocTemp/editByFiledId")
|
||||
boolean oaOfficialdocTempEditByFiledId(@RequestBody JSONObject oaOfficialdocTemp);
|
||||
|
||||
/**
|
||||
* 通过fileId查询所有
|
||||
*
|
||||
* @param filedId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/eoa/api/oaOfficialdocTemp/getTempByFileId")
|
||||
JSONObject oaOfficialdocTempGetTempByFileId(@RequestParam("filedId") String filedId);
|
||||
|
||||
/**
|
||||
* 通过fileId修改公文word名称
|
||||
*
|
||||
* @param filedId
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/eoa/api/oaOfficialdocTemp/updateNameByFileId")
|
||||
boolean oaOfficialdocTempUpdateNameByFileId(@RequestParam("filedId") String filedId, @RequestParam("name") String name);
|
||||
|
||||
/**
|
||||
* 添加文件到知识库
|
||||
*
|
||||
* @param sysFilesModel
|
||||
*/
|
||||
@PostMapping("/eoa/api/addSysFiles")
|
||||
void addSysFiles(@RequestBody SysFilesModel sysFilesModel);
|
||||
|
||||
/**
|
||||
* 通过文件路径获取文件id
|
||||
*
|
||||
* @param fileId
|
||||
*/
|
||||
@GetMapping("/eoa/api/getFileUrl")
|
||||
String getFileUrl(@RequestParam(name = "fileId") String fileId);
|
||||
|
||||
/**
|
||||
* 添加公共文件
|
||||
*
|
||||
* @param orgName
|
||||
* @param fileType
|
||||
* @param savePath
|
||||
* @param size
|
||||
*/
|
||||
@PostMapping("/eoa/api/addSysCommonFile")
|
||||
void addSysCommonFile(@RequestParam(name = "orgName") String orgName, @RequestParam(name = "fileType") FileTypeEnum fileType, @RequestParam(name = "savePath") String savePath, @RequestParam(name = "size") long size);
|
||||
|
||||
/**
|
||||
* 根据文件id获取文件
|
||||
*
|
||||
* @param fileId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/eoa/api/getFileById")
|
||||
SysFilesModel getFileById(@RequestParam(name = "fileId") String fileId);}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package org.jeecg.common.easyoa.api.factory;
|
||||
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.jeecg.common.easyoa.api.IEasyOaBaseApi;
|
||||
import org.jeecg.common.easyoa.api.fallback.EasyOaBaseApiFallback;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @Description: EasyOaBaseAPIFallbackFactory
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Component
|
||||
public class EasyOaBaseApiFallbackFactory implements FallbackFactory<IEasyOaBaseApi> {
|
||||
|
||||
@Override
|
||||
public IEasyOaBaseApi create(Throwable throwable) {
|
||||
EasyOaBaseApiFallback fallback = new EasyOaBaseApiFallback();
|
||||
fallback.setCause(throwable);
|
||||
return fallback;
|
||||
}
|
||||
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
package org.jeecg.common.easyoa.api.fallback;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Setter;
|
||||
import org.jeecg.common.constant.enums.FileTypeEnum;
|
||||
import org.jeecg.common.easyoa.api.IEasyOaBaseApi;
|
||||
import org.jeecg.common.system.vo.SysFilesModel;
|
||||
|
||||
/**
|
||||
* @Description: EasyOaBaseApiFallback
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
public class EasyOaBaseApiFallback implements IEasyOaBaseApi {
|
||||
|
||||
@Setter
|
||||
private Throwable cause;
|
||||
|
||||
@Override
|
||||
public JSONObject oaOfficialdocOrgancodeGetTemp(String fileId, String code) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean oaOfficialdocTempEditByFiledId(JSONObject oaOfficialdocTemp) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject oaOfficialdocTempGetTempByFileId(String filedId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean oaOfficialdocTempUpdateNameByFileId(String filedId, String name) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addSysFiles(SysFilesModel sysFilesModel) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFileUrl(String fileId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addSysCommonFile(String orgName, FileTypeEnum fileType, String savePath, long size) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysFilesModel getFileById(String fileId) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
package org.jeecg.common.lowapp.api;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.jeecg.common.constant.ServiceNameConstants;
|
||||
import org.jeecg.common.lowapp.factory.LowAppBaseApiFallbackFactory;
|
||||
import org.jeecg.common.lowapp.model.LowAppFormAuthRecordModel;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 【lowapp】Feign API接口
|
||||
*
|
||||
* @ConditionalOnMissingClass("org.jeecg.modules.online.low.service.impl.LowAppBaseApiImpl") => 有实现类的时候,不实例化Feign接口
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Component
|
||||
//@FeignClient(contextId = "onlineBaseRemoteApi", value = ServiceNameConstants.SERVICE_ONLINE, fallbackFactory = LowAppBaseApiFallbackFactory.class)
|
||||
@FeignClient(contextId = "lowAppBaseApi", value = ServiceNameConstants.SERVICE_SYSTEM, fallbackFactory = LowAppBaseApiFallbackFactory.class)
|
||||
@ConditionalOnMissingClass("org.jeecg.modules.online.low.service.impl.LowAppBaseApiImpl")
|
||||
public interface ILowAppBaseApi {
|
||||
|
||||
/**
|
||||
* 获取 low app表单的查询 权限信息
|
||||
* @param userId
|
||||
* @param appId
|
||||
* @param designFormCode
|
||||
* @param authType
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/online/api/getLowAppReadAuth")
|
||||
LowAppFormAuthRecordModel getLowAppReadAuth(@RequestParam("userId") String userId, @RequestParam("appId") String appId, @RequestParam("designFormCode") String designFormCode, @RequestParam("authType") String authType);
|
||||
|
||||
/**
|
||||
* 获取 low app表单的查询 权限信息
|
||||
*
|
||||
* @param userId
|
||||
* @param appId
|
||||
* @param designFormCode
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/online/api/getLowAppFormFieldAllAuth")
|
||||
List<JSONObject> getLowAppFormFieldAllAuth(@RequestParam("userId") String userId, @RequestParam("appId") String appId, @RequestParam("designFormCode") String designFormCode);
|
||||
|
||||
/**
|
||||
* 根据表单ID或表单编码查询菜单(用于兼容新旧版本)
|
||||
*
|
||||
* @param desformId
|
||||
* @param desformCode
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/online/api/getLowAppMenuByDesformIdOrCode")
|
||||
JSONObject getLowAppMenuByDesformIdOrCode(@RequestParam("lowAppId") String lowAppId, @RequestParam("desformId") String desformId, @RequestParam("desformCode") String desformCode);
|
||||
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package org.jeecg.common.lowapp.factory;
|
||||
|
||||
import org.jeecg.common.lowapp.api.ILowAppBaseApi;
|
||||
import org.jeecg.common.lowapp.fallback.LowAppBaseApiFallback;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @Description: LowAppBaseApiFallbackFactory
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Component
|
||||
public class LowAppBaseApiFallbackFactory implements FallbackFactory<ILowAppBaseApi> {
|
||||
|
||||
@Override
|
||||
public ILowAppBaseApi create(Throwable throwable) {
|
||||
LowAppBaseApiFallback fallback = new LowAppBaseApiFallback();
|
||||
fallback.setCause(throwable);
|
||||
return fallback;
|
||||
}
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package org.jeecg.common.lowapp.fallback;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.lowapp.api.ILowAppBaseApi;
|
||||
import org.jeecg.common.lowapp.model.LowAppFormAuthRecordModel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 进入fallback的方法 检查是否token未设置
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Slf4j
|
||||
public class LowAppBaseApiFallback implements ILowAppBaseApi {
|
||||
|
||||
@Setter
|
||||
private Throwable cause;
|
||||
|
||||
@Override
|
||||
public LowAppFormAuthRecordModel getLowAppReadAuth(String userId, String appId, String designFormCode, String authType) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> getLowAppFormFieldAllAuth(String userId, String appId, String designFormCode) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getLowAppMenuByDesformIdOrCode(String lowAppId, String desformId, String desformCode) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
+118
@@ -0,0 +1,118 @@
|
||||
package org.jeecg.common.miniflow;
|
||||
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.constant.ServiceNameConstants;
|
||||
import org.jeecg.common.desform.vo.DesignFormDataVo;
|
||||
import org.jeecg.common.lowapp.model.LowAppCopyMenu;
|
||||
import org.jeecg.common.miniflow.factory.SignalProcessStartApiFallbackFactory;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 流程启动接口
|
||||
*
|
||||
* @author zyf
|
||||
*/
|
||||
@Component
|
||||
@FeignClient(contextId = "signalProcessStartApi", value = ServiceNameConstants.SERVICE_SYSTEM, fallbackFactory = SignalProcessStartApiFallbackFactory.class)
|
||||
public interface ISignalProcessStartApi {
|
||||
|
||||
/**
|
||||
* 流程发布的时候,批量同步日期触发字段,生成定时job
|
||||
*
|
||||
* 逻辑说明:
|
||||
* 发布流程的时候做一下操作
|
||||
* 1.删除流程所有的,自定义流程定时器配置
|
||||
* 2.查询符合条件的数据,插入定期器配置
|
||||
* 3.删除流程、暂停流程,要不要清理定时器??
|
||||
*
|
||||
* 缺点:一条数据一个定期器,数据太多了
|
||||
*
|
||||
* @param processKey 流程 key
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/act/designer/miniDesFlow/api/batchSyncDateFieldTriggerJob")
|
||||
void batchSyncDateFieldTriggerProcessJob(@RequestParam("processKey") String processKey) ;
|
||||
|
||||
/**
|
||||
* 纠正定时流程的开始时间
|
||||
* (自定义corn定时规则时,无法指定开始时间,只能手工改下 act_ru_timer_job 的首次执行时间 DUEDATE_)
|
||||
*
|
||||
* @param processKey
|
||||
*/
|
||||
@PostMapping("/act/designer/miniDesFlow/api/setTimeTriggerProcessJobStartTime")
|
||||
void setTimeTriggerProcessJobStartTime(@RequestParam("processKey") String processKey) ;
|
||||
|
||||
/**
|
||||
* 信号流程启动
|
||||
*
|
||||
* @param action 动作(add/update/delete)
|
||||
* @param dataId 数据ID
|
||||
* @param data 数据
|
||||
* @param formKey 表单key
|
||||
* @param applyUserId 发起人
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/act/designer/miniDesFlow/api/signalStartProcess")
|
||||
Result signalStartProcess(@RequestParam("action") String action, @RequestParam(value = "dataId",required = false) String dataId, @RequestParam(value = "data",required = false) DesignFormDataVo data, @RequestParam("formKey") String formKey, @RequestParam("applyUserId") String applyUserId);
|
||||
|
||||
|
||||
/**
|
||||
* 按钮流程启动
|
||||
* @param processId 流程ID
|
||||
* @param inputParams 流程参数
|
||||
* @param applyUserId 发起人
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/act/designer/miniDesFlow/api/buttonStartProcess")
|
||||
Result buttonStartProcess(@RequestParam("processId") String processId,@RequestParam(value = "dataId",required = false) String dataId,@RequestParam(value = "formKey",required = false) String formKey,@RequestParam(value = "inputParams",required = false) String inputParams,@RequestParam("applyUserId") String applyUserId);
|
||||
|
||||
/**
|
||||
* 人员事件启动流程
|
||||
* @param eventType 事件类型(1入职 2离职)
|
||||
* @param loginUser 用户数据对象
|
||||
* @param applyUserId 发起人
|
||||
* @param tenantId 租户ID
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/act/designer/miniDesFlow/api/userStartProcess")
|
||||
Result userStartProcess(@RequestParam("eventType") Integer eventType, @RequestBody LoginUser loginUser, @RequestParam("applyUserId") String applyUserId, @RequestParam("tenantId") String tenantId);
|
||||
|
||||
|
||||
/**
|
||||
* 复制low app下的流程信息
|
||||
* @param lowAppCopyMenu
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/act/designer/miniDesFlow/api/copyAppProcess")
|
||||
Map<String, String> copyAppProcess(@RequestBody LowAppCopyMenu lowAppCopyMenu, @RequestParam("isCrossTenant") Boolean isCrossTenant);
|
||||
|
||||
|
||||
/**
|
||||
* 备份low-app的工作流信息
|
||||
* @param appId
|
||||
* @param backupKey
|
||||
*/
|
||||
@PutMapping("/act/designer/miniDesFlow/api/backupAppProcess")
|
||||
void backupAppProcess(@RequestParam("appId")String appId, @RequestParam("backupKey")String backupKey);
|
||||
|
||||
/**
|
||||
* 还原备份low-app的工作流信息
|
||||
* @param appId
|
||||
* @param backupKey
|
||||
*/
|
||||
@PutMapping("/act/designer/miniDesFlow/api/coverAppProcess")
|
||||
void coverAppProcess(@RequestParam("appId")String appId, @RequestParam("backupKey")String backupKey);
|
||||
|
||||
|
||||
/**
|
||||
* 删除流程信息
|
||||
* @param appId
|
||||
*/
|
||||
@DeleteMapping("/act/designer/miniDesFlow/api/deleteAppProcess")
|
||||
void deleteAppProcess(@RequestParam("appId")String appId);
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package org.jeecg.common.miniflow.factory;
|
||||
|
||||
import org.jeecg.common.miniflow.ISignalProcessStartApi;
|
||||
import org.jeecg.common.miniflow.fallback.SignalProcessStartApiFallback;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @Description: SignalProcessStartApiFallbackFactory
|
||||
* @author: zyf
|
||||
*/
|
||||
@Component
|
||||
public class SignalProcessStartApiFallbackFactory implements FallbackFactory<ISignalProcessStartApi> {
|
||||
|
||||
@Override
|
||||
public ISignalProcessStartApi create(Throwable throwable) {
|
||||
SignalProcessStartApiFallback fallback = new SignalProcessStartApiFallback();
|
||||
fallback.setCause(throwable);
|
||||
return fallback;
|
||||
}
|
||||
|
||||
}
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
package org.jeecg.common.miniflow.fallback;
|
||||
|
||||
import lombok.Setter;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.desform.vo.DesignFormDataVo;
|
||||
import org.jeecg.common.lowapp.model.LowAppCopyMenu;
|
||||
import org.jeecg.common.miniflow.ISignalProcessStartApi;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: SignalProcessStartApiFallback
|
||||
* @author: zyf
|
||||
*/
|
||||
public class SignalProcessStartApiFallback implements ISignalProcessStartApi {
|
||||
|
||||
@Setter
|
||||
private Throwable cause;
|
||||
|
||||
|
||||
@Override
|
||||
public void batchSyncDateFieldTriggerProcessJob(String processKey) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTimeTriggerProcessJobStartTime(String processKey) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result signalStartProcess(String action, String dataId, DesignFormDataVo data, String formKey, String applyUserId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result buttonStartProcess(String processId,String dataId,String formKey, String inputParams, String applyUserId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result userStartProcess(Integer eventType, LoginUser loginUser, String applyUserId,String tenantId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> copyAppProcess(LowAppCopyMenu lowAppCopyMenu, Boolean isCrossTenant ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void backupAppProcess(String appId, String backupKey) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void coverAppProcess(String appId, String backupKey) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAppProcess(String appId) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
package org.jeecg.common.online.api;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.jeecg.common.constant.ServiceNameConstants;
|
||||
import org.jeecg.common.lowapp.model.LowAppFormAuthRecordModel;
|
||||
import org.jeecg.common.online.api.factory.OnlineBaseExtApiFallbackFactory;
|
||||
import org.jeecg.common.system.vo.DictModel;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 【Online】Feign API接口
|
||||
*
|
||||
* @ConditionalOnMissingClass("org.jeecg.modules.online.cgform.service.impl.OnlineBaseExtApiImpl") => 有实现类的时候,不实例化Feign接口
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Component
|
||||
//@FeignClient(contextId = "onlineBaseRemoteApi", value = ServiceNameConstants.SERVICE_ONLINE, fallbackFactory = OnlineBaseExtApiFallbackFactory.class)
|
||||
@FeignClient(contextId = "onlineBaseRemoteApi", value = ServiceNameConstants.SERVICE_SYSTEM, fallbackFactory = OnlineBaseExtApiFallbackFactory.class)
|
||||
@ConditionalOnMissingClass("org.jeecg.modules.online.cgform.service.impl.OnlineBaseExtApiImpl")
|
||||
public interface IOnlineBaseExtApi {
|
||||
|
||||
/**
|
||||
* 【Online】 表单设计器专用:同步新增
|
||||
* @param tableName 表名
|
||||
* @param jsonObject
|
||||
* @throws Exception
|
||||
* @return String
|
||||
*/
|
||||
@PostMapping(value = "/online/api/cgform/crazyForm/{name}")
|
||||
String cgformPostCrazyForm(@PathVariable("name") String tableName, @RequestBody JSONObject jsonObject) throws Exception;
|
||||
|
||||
/**
|
||||
* 【Online】 表单设计器专用:同步编辑
|
||||
* @param tableName 表名
|
||||
* @param jsonObject
|
||||
* @throws Exception
|
||||
* @return String
|
||||
*/
|
||||
@PutMapping(value = "/online/api/cgform/crazyForm/{name}")
|
||||
String cgformPutCrazyForm(@PathVariable("name") String tableName, @RequestBody JSONObject jsonObject) throws Exception;
|
||||
|
||||
/**
|
||||
* 通过online表名查询数据,同时查询出子表的数据
|
||||
*
|
||||
* @param tableName online表名
|
||||
* @param dataIds online数据ID
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/online/api/cgform/queryAllDataByTableName")
|
||||
JSONObject cgformQueryAllDataByTableName(@RequestParam("tableName") String tableName, @RequestParam("dataIds") String dataIds);
|
||||
|
||||
/**
|
||||
* online表单删除数据
|
||||
*
|
||||
* @param cgformCode Online表单code
|
||||
* @param dataIds 数据ID,可逗号分割
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping("/online/api/cgform/cgformDeleteDataByCode")
|
||||
String cgformDeleteDataByCode(@RequestParam("cgformCode") String cgformCode, @RequestParam("dataIds") String dataIds);
|
||||
|
||||
/**
|
||||
* 【cgreport】通过 head code 获取 sql语句,并执行该语句返回查询数据
|
||||
*
|
||||
* @param code 报表Code,如果没传ID就通过code查
|
||||
* @param forceKey
|
||||
* @param dataList
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/online/api/cgreportGetData")
|
||||
Map<String, Object> cgreportGetData(@RequestParam("code") String code, @RequestParam("forceKey") String forceKey, @RequestParam("dataList") String dataList);
|
||||
|
||||
/**
|
||||
* 【cgreport】对 cgreportGetData 的返回值做优化,封装 DictModel 集合
|
||||
* @param code
|
||||
* @param dictText
|
||||
* @param dictCode
|
||||
* @param dataList
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/online/api/cgreportGetDataPackage")
|
||||
List<DictModel> cgreportGetDataPackage(@RequestParam("code") String code, @RequestParam("dictText") String dictText, @RequestParam("dictCode") String dictCode, @RequestParam("dataList") String dataList);
|
||||
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package org.jeecg.common.online.api.factory;
|
||||
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.jeecg.common.online.api.IOnlineBaseExtApi;
|
||||
import org.jeecg.common.online.api.fallback.OnlineBaseExtApiFallback;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @Description: OnlineBaseExtAPIFallbackFactory
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Component
|
||||
public class OnlineBaseExtApiFallbackFactory implements FallbackFactory<IOnlineBaseExtApi> {
|
||||
|
||||
@Override
|
||||
public IOnlineBaseExtApi create(Throwable throwable) {
|
||||
OnlineBaseExtApiFallback fallback = new OnlineBaseExtApiFallback();
|
||||
fallback.setCause(throwable);
|
||||
return fallback;
|
||||
}
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
package org.jeecg.common.online.api.fallback;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.lowapp.model.LowAppFormAuthRecordModel;
|
||||
import org.jeecg.common.online.api.IOnlineBaseExtApi;
|
||||
import org.jeecg.common.system.vo.DictModel;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 进入fallback的方法 检查是否token未设置
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Slf4j
|
||||
public class OnlineBaseExtApiFallback implements IOnlineBaseExtApi {
|
||||
|
||||
@Setter
|
||||
private Throwable cause;
|
||||
|
||||
@Override
|
||||
public String cgformPostCrazyForm(String tableName, JSONObject jsonObject) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String cgformPutCrazyForm(String tableName, JSONObject jsonObject) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject cgformQueryAllDataByTableName(String tableName, String dataIds) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String cgformDeleteDataByCode(String cgformCode, String dataIds) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> cgreportGetData(String code, String forceKey, String dataList) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictModel> cgreportGetDataPackage(String code, String dictText, String dictCode, String dataList) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
package org.jeecg.common.pay.api;
|
||||
|
||||
import org.jeecg.common.constant.ServiceNameConstants;
|
||||
import org.jeecg.common.pay.api.factory.PayBaseApiFallbackFactory;
|
||||
import org.jeecg.common.system.vo.SysPayVipVo;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* @Description: 支付接口通用api
|
||||
*
|
||||
* @author: wangshuai
|
||||
* @date: 2023/6/25 19:20
|
||||
*/
|
||||
@Component
|
||||
@FeignClient(contextId = "payBaseRemoteApi", value = ServiceNameConstants.SERVICE_SYSTEM, fallbackFactory = PayBaseApiFallbackFactory.class)
|
||||
@ConditionalOnMissingClass("org.jeecg.modules.service.impl.SysVipPayServiceImpl")
|
||||
public interface IPayBaseApi {
|
||||
|
||||
/**
|
||||
* 验证当前登录用户是否为vip
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/pay/vipMembership/verifyVipIdentity")
|
||||
SysPayVipVo verifyVipIdentity();
|
||||
|
||||
/**
|
||||
* 检查当前登录用户的短信发送是否超限
|
||||
*
|
||||
* @return 达到上限返回true
|
||||
*/
|
||||
@GetMapping("/pay/vipMembership/checkSmsSendLimit")
|
||||
boolean checkSmsSendLimit(@RequestParam("tenantId")Integer tenantId, @RequestParam("userId") String userId);
|
||||
|
||||
/**
|
||||
* 当前登录用户短信发送次数加1
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/pay/vipMembership/plusSmsCountYearUsed")
|
||||
boolean plusSmsCountYearUsed(@RequestParam("tenantId")Integer tenantId, @RequestParam("userId") String userId);
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package org.jeecg.common.pay.api.factory;
|
||||
|
||||
import org.jeecg.common.pay.api.IPayBaseApi;
|
||||
import org.jeecg.common.pay.api.fallback.PayBaseApiFallback;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class PayBaseApiFallbackFactory implements FallbackFactory<IPayBaseApi> {
|
||||
@Override
|
||||
public IPayBaseApi create(Throwable cause) {
|
||||
PayBaseApiFallback payBaseApiFallback = new PayBaseApiFallback();
|
||||
payBaseApiFallback.setCause(cause);
|
||||
return payBaseApiFallback;
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package org.jeecg.common.pay.api.fallback;
|
||||
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.pay.api.IPayBaseApi;
|
||||
import org.jeecg.common.system.vo.SysPayVipVo;
|
||||
|
||||
@Slf4j
|
||||
public class PayBaseApiFallback implements IPayBaseApi {
|
||||
@Setter
|
||||
private Throwable cause;
|
||||
|
||||
@Override
|
||||
public SysPayVipVo verifyVipIdentity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkSmsSendLimit(Integer tenantId, String userId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean plusSmsCountYearUsed(Integer tenantId, String userId) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+795
@@ -0,0 +1,795 @@
|
||||
package org.jeecg.common.system.api;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.jeecg.common.api.CommonAPI;
|
||||
import org.jeecg.common.api.dto.DataLogDTO;
|
||||
import org.jeecg.common.api.dto.OnlineAuthDTO;
|
||||
import org.jeecg.common.api.dto.message.*;
|
||||
import org.jeecg.common.constant.ServiceNameConstants;
|
||||
import org.jeecg.common.constant.enums.EmailTemplateEnum;
|
||||
import org.jeecg.common.desensitization.annotation.SensitiveDecode;
|
||||
import org.jeecg.common.system.api.factory.SysBaseAPIFallbackFactory;
|
||||
import org.jeecg.common.system.vo.*;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
*
|
||||
* 1、cloud接口数量43 local:35 common:9 额外一个特殊queryAllRole一个当两个用
|
||||
* - 相比较local版
|
||||
* - 去掉了一些方法:addLog、getDatabaseType、queryAllDepart、queryAllUser(Wrapper wrapper)、queryAllUser(String[] userIds, int pageNo, int pageSize)
|
||||
* - 修改了一些方法:createLog、sendSysAnnouncement(只保留了一个,其余全部干掉)
|
||||
* 2、@ConditionalOnMissingClass("org.jeecg.modules.system.service.impl.SysBaseApiImpl")=> 有实现类的时候,不实例化Feign接口
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Component
|
||||
@FeignClient(contextId = "sysBaseRemoteApi", value = ServiceNameConstants.SERVICE_SYSTEM, fallbackFactory = SysBaseAPIFallbackFactory.class)
|
||||
@ConditionalOnMissingClass("org.jeecg.modules.system.service.impl.SysBaseApiImpl")
|
||||
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
|
||||
*/
|
||||
@SensitiveDecode
|
||||
@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);
|
||||
|
||||
/**
|
||||
* 7通过用户账号查询角色集合
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/getRolesByUserId")
|
||||
List<String> getRolesByUserId(@RequestParam("userId") String userId);
|
||||
|
||||
/**
|
||||
* 8通过用户账号查询部门集合
|
||||
* @param username
|
||||
* @return 部门 id
|
||||
*/
|
||||
@GetMapping("/sys/api/getDepartIdsByUsername")
|
||||
List<String> getDepartIdsByUsername(@RequestParam("username") String username);
|
||||
|
||||
/**
|
||||
* 8通过用户账号查询部门集合
|
||||
* @param userId
|
||||
* @return 部门 id
|
||||
*/
|
||||
@GetMapping("/sys/api/getDepartIdsByUserId")
|
||||
List<String> getDepartIdsByUserId(@RequestParam("userId") String userId);
|
||||
|
||||
/**
|
||||
* 8.2 通过用户账号查询部门父ID集合
|
||||
* @param username
|
||||
* @return 部门 parentIds
|
||||
*/
|
||||
@GetMapping("/sys/api/getDepartParentIdsByUsername")
|
||||
Set<String> getDepartParentIdsByUsername(@RequestParam("username")String username);
|
||||
|
||||
/**
|
||||
* 8.3 查询部门父ID集合
|
||||
* @param depIds
|
||||
* @return 部门 parentIds
|
||||
*/
|
||||
@GetMapping("/sys/api/getDepartParentIdsByDepIds")
|
||||
Set<String> getDepartParentIdsByDepIds(@RequestParam("depIds") Set<String> depIds);
|
||||
|
||||
/**
|
||||
* 9通过用户账号查询部门 name
|
||||
* @param username
|
||||
* @return 部门 name
|
||||
*/
|
||||
@GetMapping("/sys/api/getDepartNamesByUsername")
|
||||
List<String> getDepartNamesByUsername(@RequestParam("username") String username);
|
||||
|
||||
/**
|
||||
* 10获取数据字典
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/sys/api/queryDictItemsByCode")
|
||||
List<DictModel> queryDictItemsByCode(@RequestParam("code") String code);
|
||||
|
||||
/**
|
||||
* 获取有效的数据字典项
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/sys/api/queryEnableDictItemsByCode")
|
||||
public List<DictModel> queryEnableDictItemsByCode(@RequestParam("code") String code);
|
||||
|
||||
/** 11查询所有的父级字典,按照create_time排序
|
||||
* @return List<DictModel> 字典值集合
|
||||
*/
|
||||
@GetMapping("/sys/api/queryAllDict")
|
||||
List<DictModel> queryAllDict();
|
||||
|
||||
/**
|
||||
* 12查询所有分类字典
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryAllSysCategory")
|
||||
List<SysCategoryModel> queryAllSysCategory();
|
||||
|
||||
/**
|
||||
* 13获取表数据字典
|
||||
* @param tableFilterSql
|
||||
* @param text
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/sys/api/queryTableDictItemsByCode")
|
||||
List<DictModel> queryTableDictItemsByCode(@RequestParam("tableFilterSql") String tableFilterSql, @RequestParam("text") String text, @RequestParam("code") String code);
|
||||
|
||||
/**
|
||||
* 14查询所有部门 作为字典信息 id -->value,departName -->text
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryAllDepartBackDictModel")
|
||||
List<DictModel> queryAllDepartBackDictModel();
|
||||
|
||||
/**
|
||||
* 15根据业务类型 busType 及业务 busId 修改消息已读
|
||||
* @param busType 业务类型
|
||||
* @param busId 业务id
|
||||
*/
|
||||
@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
|
||||
* @param userIds 多个用户id
|
||||
* @param pageNo 当前页数
|
||||
* @param pageSize 每页条数
|
||||
* @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) Integer pageSize);
|
||||
|
||||
|
||||
/**
|
||||
* 20获取所有角色 带参
|
||||
* @param 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获取所有参与用户
|
||||
* @param userIds 多个用户id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryAllUserByIds")
|
||||
public List<UserAccountInfo> queryAllUserByIds(@RequestParam("userIds") String[] userIds);
|
||||
|
||||
/**
|
||||
* 28将会议签到信息推动到预览
|
||||
* userIds
|
||||
* @return
|
||||
* @param userId
|
||||
*/
|
||||
@GetMapping("/sys/api/meetingSignWebsocket")
|
||||
void meetingSignWebsocket(@RequestParam("userId")String userId);
|
||||
|
||||
/**
|
||||
* 29根据name获取所有参与用户
|
||||
* @param userNames 多个用户账号
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryUserByNames")
|
||||
List<UserAccountInfo> queryUserByNames(@RequestParam("userNames")String[] userNames);
|
||||
|
||||
|
||||
/**
|
||||
* 30获取用户的角色集合
|
||||
* @param username
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/getUserRoleSet")
|
||||
Set<String> getUserRoleSet(@RequestParam("username")String username);
|
||||
|
||||
/**
|
||||
* 30获取用户的角色集合
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/getUserRoleSetById")
|
||||
Set<String> getUserRoleSetById(@RequestParam("userId")String userId);
|
||||
|
||||
/**
|
||||
* 31获取用户的权限集合
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/getUserPermissionSet")
|
||||
Set<String> getUserPermissionSet(@RequestParam("userId") String userId);
|
||||
|
||||
/**
|
||||
* 32判断是否有online访问的权限
|
||||
* @param onlineAuthDTO
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/sys/api/hasOnlineAuth")
|
||||
boolean hasOnlineAuth(@RequestBody OnlineAuthDTO onlineAuthDTO);
|
||||
|
||||
/**
|
||||
* 33通过部门id获取部门全部信息
|
||||
* @param id 部门id
|
||||
* @return SysDepartModel 部门信息
|
||||
*/
|
||||
@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
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/sys/api/queryUserRoles")
|
||||
Set<String> queryUserRoles(@RequestParam("username")String username);
|
||||
|
||||
/**
|
||||
* 35查询用户角色信息
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/sys/api/queryUserRolesById")
|
||||
Set<String> queryUserRolesById(@RequestParam("userId")String userId);
|
||||
|
||||
/**
|
||||
* 36查询用户权限信息
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/sys/api/queryUserAuths")
|
||||
Set<String> queryUserAuths(@RequestParam("userId")String userId);
|
||||
|
||||
/**
|
||||
* 37根据 id 查询数据库中存储的 DynamicDataSourceModel
|
||||
*
|
||||
* @param dbSourceId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/sys/api/getDynamicDbSourceById")
|
||||
DynamicDataSourceModel getDynamicDbSourceById(@RequestParam("dbSourceId") String dbSourceId);
|
||||
|
||||
/**
|
||||
* 38根据 code 查询数据库中存储的 DynamicDataSourceModel
|
||||
*
|
||||
* @param dbSourceCode
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/sys/api/getDynamicDbSourceByCode")
|
||||
DynamicDataSourceModel getDynamicDbSourceByCode(@RequestParam("dbSourceCode") String dbSourceCode);
|
||||
|
||||
/**
|
||||
* 39根据用户账号查询用户信息 CommonAPI中定义
|
||||
* @param username
|
||||
* @return LoginUser 用户信息
|
||||
*/
|
||||
@Override
|
||||
@SensitiveDecode
|
||||
@GetMapping("/sys/api/getUserByName")
|
||||
LoginUser getUserByName(@RequestParam("username") String username);
|
||||
|
||||
/**
|
||||
* 39根据用户账号查询用户ID CommonAPI中定义
|
||||
* @param username
|
||||
* @return 用户ID
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/sys/api/getUserIdByName")
|
||||
String getUserIdByName(@RequestParam("username") String username);
|
||||
|
||||
/**
|
||||
* 40字典表的 翻译
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param key
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@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
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/sys/api/translateDict")
|
||||
String translateDict(@RequestParam("code") String code, @RequestParam("key") String key);
|
||||
|
||||
/**
|
||||
* 42查询数据权限
|
||||
* @param component
|
||||
* @param requestPath
|
||||
* @param username 用户姓名
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/sys/api/queryPermissionDataRule")
|
||||
List<SysPermissionDataRuleModel> queryPermissionDataRule(@RequestParam("component") String component, @RequestParam("requestPath")String requestPath, @RequestParam("username") String username);
|
||||
|
||||
/**
|
||||
* 43查询用户信息
|
||||
* @param username
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/sys/api/getCacheUser")
|
||||
SysUserCacheInfo getCacheUser(@RequestParam("username") String username);
|
||||
|
||||
/**
|
||||
* 36根据多个用户账号(逗号分隔),查询返回多个用户信息
|
||||
* @param usernames
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryUsersByUsernames")
|
||||
List<JSONObject> queryUsersByUsernames(@RequestParam("usernames") String usernames);
|
||||
|
||||
/**
|
||||
* 37根据多个用户ID(逗号分隔),查询返回多个用户信息
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/sys/api/queryUsersByIds")
|
||||
List<JSONObject> queryUsersByIds(@RequestParam("ids") String ids);
|
||||
|
||||
/**
|
||||
* 38根据多个部门编码(逗号分隔),查询返回多个部门信息
|
||||
* @param orgCodes
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/sys/api/queryDepartsByOrgcodes")
|
||||
List<JSONObject> queryDepartsByOrgcodes(@RequestParam("orgCodes") String orgCodes);
|
||||
|
||||
// /**
|
||||
// * 39根据多个部门编码(逗号分隔),查询返回多个部门信息
|
||||
// * @param ids
|
||||
// * @return
|
||||
// */
|
||||
// @GetMapping("/sys/api/queryDepartsByOrgIds")
|
||||
// List<JSONObject> queryDepartsByOrgIds(@RequestParam("ids") String ids);
|
||||
|
||||
/**
|
||||
* 40发送邮件消息
|
||||
* @param email
|
||||
* @param title
|
||||
* @param content
|
||||
*/
|
||||
@GetMapping("/sys/api/sendEmailMsg")
|
||||
void sendEmailMsg(@RequestParam("email")String email,@RequestParam("title")String title,@RequestParam("content")String content);
|
||||
|
||||
/**
|
||||
* 发送html模版邮件消息
|
||||
*
|
||||
* @param email
|
||||
* @param title
|
||||
* @param emailTemplateEnum 邮件模版枚举
|
||||
* @param params 模版参数
|
||||
*/
|
||||
@GetMapping("/sys/api/sendHtmlTemplateEmail")
|
||||
void sendHtmlTemplateEmail(@RequestParam("email") String email, @RequestParam("title") String title, @RequestParam("emailEnum") EmailTemplateEnum emailTemplateEnum, @RequestParam("params") JSONObject params);
|
||||
/**
|
||||
* 41 获取公司下级部门和公司下所有用户id
|
||||
* @param orgCode 部门编号
|
||||
* @return List<Map>
|
||||
*/
|
||||
@GetMapping("/sys/api/getDeptUserByOrgCode")
|
||||
List<Map> getDeptUserByOrgCode(@RequestParam("orgCode")String orgCode);
|
||||
|
||||
/**
|
||||
* 42 查询分类字典翻译
|
||||
* @param ids 多个分类字典id
|
||||
* @return List<String>
|
||||
*/
|
||||
@GetMapping("/sys/api/loadCategoryDictItem")
|
||||
List<String> loadCategoryDictItem(@RequestParam("ids") String ids);
|
||||
|
||||
/**
|
||||
* 44 反向翻译分类字典,用于导入
|
||||
*
|
||||
* @param names 名称,逗号分割
|
||||
*/
|
||||
@GetMapping("/sys/api/loadCategoryDictItemByNames")
|
||||
List<String> loadCategoryDictItemByNames(@RequestParam("names") String names, @RequestParam("delNotExist") boolean delNotExist);
|
||||
|
||||
/**
|
||||
* 43 根据字典code加载字典text
|
||||
*
|
||||
* @param dictCode 顺序:tableName,text,code
|
||||
* @param keys 要查询的key
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/loadDictItem")
|
||||
List<String> loadDictItem(@RequestParam("dictCode") String dictCode, @RequestParam("keys") String keys);
|
||||
|
||||
/**
|
||||
* 复制应用下的所有字典配置到新的租户下
|
||||
*
|
||||
* @param originalAppId 原始低代码应用ID
|
||||
* @param appId 新的低代码应用ID
|
||||
* @param tenantId 新的租户ID
|
||||
* @return Map<String, String> Map<原字典编码, 新字典编码>
|
||||
*/
|
||||
@GetMapping("/sys/api/copyLowAppDict")
|
||||
Map<String, String> copyLowAppDict(@RequestParam("originalAppId") String originalAppId, @RequestParam("appId") String appId, @RequestParam("tenantId") String tenantId);
|
||||
|
||||
/**
|
||||
* 44 根据字典code查询字典项
|
||||
*
|
||||
* @param dictCode 顺序:tableName,text,code
|
||||
* @param dictCode 要查询的key
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/getDictItems")
|
||||
List<DictModel> getDictItems(@RequestParam("dictCode") String dictCode);
|
||||
|
||||
/**
|
||||
* 45 根据多个字典code查询多个字典项
|
||||
*
|
||||
* @param dictCodeList
|
||||
* @return key = dictCode ; value=对应的字典项
|
||||
*/
|
||||
@RequestMapping("/sys/api/getManyDictItems")
|
||||
Map<String, List<DictModel>> getManyDictItems(@RequestParam("dictCodeList") List<String> dictCodeList);
|
||||
|
||||
/**
|
||||
* 46 【JSearchSelectTag下拉搜索组件专用接口】
|
||||
* 大数据量的字典表 走异步加载 即前端输入内容过滤数据
|
||||
*
|
||||
* @param dictCode 字典code格式:table,text,code
|
||||
* @param keyword 过滤关键字
|
||||
* @param pageSize 每页条数
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/loadDictItemByKeyword")
|
||||
List<DictModel> loadDictItemByKeyword(@RequestParam("dictCode") String dictCode, @RequestParam("keyword") String keyword, @RequestParam(value = "pageNo", defaultValue = "1", required = false) Integer pageNo, @RequestParam(value = "pageSize", required = false) Integer pageSize);
|
||||
|
||||
/**
|
||||
* 47 根据多个部门id(逗号分隔),查询返回多个部门信息
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryDepartsByIds")
|
||||
List<JSONObject> queryDepartsByIds(@RequestParam("ids") String ids);
|
||||
|
||||
/**
|
||||
* 48 普通字典的翻译,根据多个dictCode和多条数据,多个以逗号分割
|
||||
* @param dictCodes
|
||||
* @param keys
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/sys/api/translateManyDict")
|
||||
Map<String, List<DictModel>> translateManyDict(@RequestParam("dictCodes") String dictCodes, @RequestParam("keys") String keys);
|
||||
|
||||
//update-begin---author:chenrui ---date:20231221 for:[issues/#5643]解决分布式下表字典跨库无法查询问题------------
|
||||
/**
|
||||
* 49 字典表的 翻译,可批量
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param keys 多个用逗号分割
|
||||
* @param ds
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/sys/api/translateDictFromTableByKeys")
|
||||
List<DictModel> translateDictFromTableByKeys(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("keys") String keys, @RequestParam("ds") String ds);
|
||||
//update-end---author:chenrui ---date:20231221 for:[issues/#5643]解决分布式下表字典跨库无法查询问题------------
|
||||
|
||||
/**
|
||||
* 发送模板消息
|
||||
*/
|
||||
@PostMapping("/sys/api/sendTemplateMessage")
|
||||
void sendTemplateMessage(@RequestBody MessageDTO message);
|
||||
|
||||
/**
|
||||
* 获取模板内容
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/getTemplateContent")
|
||||
String getTemplateContent(@RequestParam("code") String code);
|
||||
|
||||
/**
|
||||
* 新增数据日志
|
||||
* @param dataLogDto
|
||||
*/
|
||||
@PostMapping("/sys/api/saveDataLog")
|
||||
void saveDataLog(@RequestBody DataLogDTO dataLogDto);
|
||||
|
||||
/**
|
||||
* 更新头像
|
||||
* @param loginUser
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/sys/api/updateAvatar")
|
||||
void updateAvatar(@RequestBody LoginUser loginUser);
|
||||
|
||||
@GetMapping("/sys/api/sendAppChatSocket")
|
||||
void sendAppChatSocket(@RequestParam(name="userId") String userId);
|
||||
|
||||
/**
|
||||
* 根据角色id查询角色code
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/getRoleCode")
|
||||
String getRoleCodeById(String id);
|
||||
|
||||
/**
|
||||
* 根据roleCode查询角色信息,可逗号分隔多个
|
||||
*
|
||||
* @param roleCodes
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryRoleDictByCode")
|
||||
List<DictModel> queryRoleDictByCode(@RequestParam(name = "roleCodes") String roleCodes);
|
||||
|
||||
|
||||
/**
|
||||
* 根据高级查询条件查询用户
|
||||
* @param superQuery
|
||||
* @param matchType
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryUserBySuperQuery")
|
||||
List<JSONObject> queryUserBySuperQuery(@RequestParam(name="superQuery")String superQuery,@RequestParam(name="matchType")String matchType);
|
||||
|
||||
|
||||
/**
|
||||
* 根据ID条件查询用户
|
||||
* @param id
|
||||
* @return JSONObject
|
||||
*/
|
||||
@GetMapping("/sys/api/queryUserById")
|
||||
JSONObject queryUserById(String id);
|
||||
|
||||
|
||||
/**
|
||||
* 根据高级查询条件查询部门
|
||||
* @param superQuery
|
||||
* @param matchType
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryDeptBySuperQuery")
|
||||
List<JSONObject> queryDeptBySuperQuery(@RequestParam(name="superQuery")String superQuery,@RequestParam(name="matchType")String matchType);
|
||||
|
||||
/**
|
||||
* 根据高级查询条件查询角色
|
||||
* @param superQuery
|
||||
* @param matchType
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryRoleBySuperQuery")
|
||||
List<JSONObject> queryRoleBySuperQuery(@RequestParam(name="superQuery")String superQuery,@RequestParam(name="matchType")String matchType);
|
||||
|
||||
|
||||
/**
|
||||
* 根据租户ID查询用户ID
|
||||
* @param tenantId 租户ID
|
||||
* @return List<String>
|
||||
*/
|
||||
@GetMapping("/sys/api/selectUserIdByTenantId")
|
||||
List<String> selectUserIdByTenantId(@RequestParam("tenantId")String tenantId);
|
||||
|
||||
|
||||
/**
|
||||
* 根据部门ID查询用户ID
|
||||
* @param deptIds
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryUserIdsByDeptIds")
|
||||
List<String> queryUserIdsByDeptIds(List<String> deptIds);
|
||||
|
||||
/**
|
||||
* 根据部门ID查询用户账号
|
||||
* @param deptIds
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryUserAccountsByDeptIds")
|
||||
List<String> queryUserAccountsByDeptIds(List<String> deptIds);
|
||||
|
||||
/**
|
||||
* 根据角色编码 查询用户ID
|
||||
* @param roleCodes
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryUserIdsByRoleds")
|
||||
List<String> queryUserIdsByRoleds(List<String> roleCodes);
|
||||
|
||||
/**
|
||||
* 根据职务ID查询用户ID
|
||||
* @param positionIds
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryUserIdsByPositionIds")
|
||||
List<String> queryUserIdsByPositionIds(List<String> positionIds);
|
||||
|
||||
/**
|
||||
* 根据部门和子部门下的所有用户账号
|
||||
*
|
||||
* @param orgCode 部门编码
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/getUserAccountsByDepCode")
|
||||
public List<String> getUserAccountsByDepCode(@RequestParam("orgCode")String orgCode);
|
||||
|
||||
/**
|
||||
* 检查查询sql的表和字段是否在白名单中
|
||||
*
|
||||
* @param selectSql
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/dictTableWhiteListCheckBySql")
|
||||
boolean dictTableWhiteListCheckBySql(@RequestParam("selectSql") String selectSql);
|
||||
|
||||
/**
|
||||
* 根据字典表或者字典编码,校验是否在白名单中
|
||||
*
|
||||
* @param tableOrDictCode 表名或dictCode
|
||||
* @param fields 如果传的是dictCode,则该参数必须传null
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/dictTableWhiteListCheckByDict")
|
||||
boolean dictTableWhiteListCheckByDict(
|
||||
@RequestParam("tableOrDictCode") String tableOrDictCode,
|
||||
@RequestParam(value = "fields", required = false) String... fields
|
||||
);
|
||||
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package org.jeecg.common.system.api.factory;
|
||||
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.system.api.fallback.SysBaseAPIFallback;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @Description: SysBaseAPIFallbackFactory
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Component
|
||||
public class SysBaseAPIFallbackFactory implements FallbackFactory<ISysBaseAPI> {
|
||||
|
||||
@Override
|
||||
public ISysBaseAPI create(Throwable throwable) {
|
||||
SysBaseAPIFallback fallback = new SysBaseAPIFallback();
|
||||
fallback.setCause(throwable);
|
||||
return fallback;
|
||||
}
|
||||
}
|
||||
+467
@@ -0,0 +1,467 @@
|
||||
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.DataLogDTO;
|
||||
import org.jeecg.common.api.dto.OnlineAuthDTO;
|
||||
import org.jeecg.common.api.dto.message.*;
|
||||
import org.jeecg.common.constant.enums.EmailTemplateEnum;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.system.vo.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 进入fallback的方法 检查是否token未设置
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@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> getRolesByUserId(String userId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getDepartIdsByUsername(String username) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getDepartIdsByUserId(String userId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getDepartParentIdsByUsername(String username) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getDepartParentIdsByDepIds(Set<String> depIds) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getDepartNamesByUsername(String username) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictModel> queryDictItemsByCode(String code) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictModel> queryEnableDictItemsByCode(String code) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictModel> queryAllDict() {
|
||||
log.error("fegin接口queryAllDict失败:"+cause.getMessage(), cause);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysCategoryModel> queryAllSysCategory() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictModel> queryTableDictItemsByCode(String tableFilterSql, 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, Integer 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<UserAccountInfo> queryAllUserByIds(String[] userIds) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void meetingSignWebsocket(String userId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserAccountInfo> queryUserByNames(String[] userNames) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getUserRoleSet(String username) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getUserRoleSetById(String userId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getUserPermissionSet(String userId) {
|
||||
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> queryUserRolesById(String userId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> queryUserAuths(String userId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicDataSourceModel getDynamicDbSourceById(String dbSourceId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicDataSourceModel getDynamicDbSourceByCode(String dbSourceCode) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoginUser getUserByName(String username) {
|
||||
log.error("jeecg-system服务节点不通,导致获取登录用户信息失败: " + cause.getMessage(), cause);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserIdByName(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> queryUsersByIds(String ids) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> queryDepartsByOrgcodes(String orgCodes) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> queryDepartsByIds(String ids) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<DictModel>> translateManyDict(String dictCodes, String keys) {
|
||||
return null;
|
||||
}
|
||||
|
||||
//update-begin---author:chenrui ---date:20231221 for:[issues/#5643]解决分布式下表字典跨库无法查询问题------------
|
||||
@Override
|
||||
public List<DictModel> translateDictFromTableByKeys(String table, String text, String code, String keys, String dataSource) {
|
||||
return null;
|
||||
}
|
||||
//update-end---author:chenrui ---date:20231221 for:[issues/#5643]解决分布式下表字典跨库无法查询问题------------
|
||||
|
||||
@Override
|
||||
public void sendTemplateMessage(MessageDTO message) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTemplateContent(String code) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveDataLog(DataLogDTO dataLogDto) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendEmailMsg(String email,String title,String content) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendHtmlTemplateEmail(String email, String title, EmailTemplateEnum emailTemplateEnum, JSONObject params) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map> getDeptUserByOrgCode(String orgCode) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public List<JSONObject> queryDepartsByOrgIds(String ids) {
|
||||
// return null;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public List<String> loadCategoryDictItem(String ids) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> loadCategoryDictItemByNames(String names, boolean delNotExist) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> loadDictItem(String dictCode, String keys) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> copyLowAppDict(String originalAppId, String appId, String tenantId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictModel> getDictItems(String dictCode) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<DictModel>> getManyDictItems(List<String> dictCodeList) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictModel> loadDictItemByKeyword(String dictCode, String keyword, Integer pageNo, Integer pageSize) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateAvatar(LoginUser loginUser) { }
|
||||
|
||||
@Override
|
||||
public void sendAppChatSocket(String userId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRoleCodeById(String id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictModel> queryRoleDictByCode(String roleCodes) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> queryUserBySuperQuery(String superQuery, String matchType) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject queryUserById(String id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> queryDeptBySuperQuery(String superQuery, String matchType) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> queryRoleBySuperQuery(String superQuery, String matchType) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> selectUserIdByTenantId(String tenantId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> queryUserIdsByDeptIds(List<String> deptIds) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> queryUserAccountsByDeptIds(List<String> deptIds) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> queryUserIdsByRoleds(List<String> roleCodes) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> queryUserIdsByPositionIds(List<String> positionIds) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getUserAccountsByDepCode(String orgCode) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dictTableWhiteListCheckBySql(String selectSql) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dictTableWhiteListCheckByDict(String tableOrDictCode, String... fields) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
+180
@@ -0,0 +1,180 @@
|
||||
//package org.jeecg.config;
|
||||
//
|
||||
//import java.io.IOException;
|
||||
//import java.util.ArrayList;
|
||||
//import java.util.Arrays;
|
||||
//import java.util.List;
|
||||
//import java.util.SortedMap;
|
||||
//
|
||||
//import javax.servlet.http.HttpServletRequest;
|
||||
//
|
||||
//import org.jeecg.common.config.mqtoken.UserTokenContext;
|
||||
//import org.jeecg.common.constant.CommonConstant;
|
||||
//import org.jeecg.common.util.DateUtils;
|
||||
//import org.jeecg.common.util.PathMatcherUtil;
|
||||
//import org.jeecg.config.sign.interceptor.SignAuthConfiguration;
|
||||
//import org.jeecg.config.sign.util.HttpUtils;
|
||||
//import org.jeecg.config.sign.util.SignUtil;
|
||||
//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.SpringDecoder;
|
||||
//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.http.MediaType;
|
||||
//import org.springframework.web.context.request.RequestContextHolder;
|
||||
//import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
//
|
||||
//import com.alibaba.fastjson.JSON;
|
||||
//import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
//import com.alibaba.fastjson.support.config.FastJsonConfig;
|
||||
//import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
|
||||
//import com.alibaba.fastjson.support.springfox.SwaggerJsonSerializer;
|
||||
//
|
||||
//import feign.Feign;
|
||||
//import feign.Logger;
|
||||
//import feign.RequestInterceptor;
|
||||
//import feign.codec.Decoder;
|
||||
//import feign.codec.Encoder;
|
||||
//import feign.form.spring.SpringFormEncoder;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//
|
||||
///**
|
||||
// * @Description: FeignConfig
|
||||
// * @author: JeecgBoot
|
||||
// */
|
||||
//@ConditionalOnClass(Feign.class)
|
||||
//@AutoConfigureBefore(FeignAutoConfiguration.class)
|
||||
//@Slf4j
|
||||
//@Configuration
|
||||
//public class FeignConfig {
|
||||
//
|
||||
// /**
|
||||
// * 设置feign header参数
|
||||
// * 【X_ACCESS_TOKEN】【X_SIGN】【X_TIMESTAMP】
|
||||
// * @return
|
||||
// */
|
||||
// @Bean
|
||||
// public RequestInterceptor requestInterceptor() {
|
||||
// return requestTemplate -> {
|
||||
// ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
// if (null != attributes) {
|
||||
// HttpServletRequest request = attributes.getRequest();
|
||||
// log.debug("Feign request: {}", request.getRequestURI());
|
||||
// // 将token信息放入header中
|
||||
// String token = request.getHeader(CommonConstant.X_ACCESS_TOKEN);
|
||||
// if(token==null || "".equals(token)){
|
||||
// token = request.getParameter("token");
|
||||
// }
|
||||
// log.info("Feign Login Request token: {}", token);
|
||||
// requestTemplate.header(CommonConstant.X_ACCESS_TOKEN, token);
|
||||
// }else{
|
||||
// //解决后台任务、MQ中调用feign接口,无会话token的问题
|
||||
// String token = UserTokenContext.getToken();
|
||||
// log.info("Feign No Login token: {}", token);
|
||||
// requestTemplate.header(CommonConstant.X_ACCESS_TOKEN, token);
|
||||
// }
|
||||
//
|
||||
// //================================================================================================================
|
||||
// //针对特殊接口,进行加签验证 ——根据URL地址过滤请求 【字典表参数签名验证】
|
||||
// if (PathMatcherUtil.matches(Arrays.asList(SignAuthConfiguration.SIGN_URL_LIST),requestTemplate.path())) {
|
||||
// try {
|
||||
// log.info("============================ [begin] fegin api url ============================");
|
||||
// log.info(requestTemplate.path());
|
||||
// log.info(requestTemplate.method());
|
||||
// String queryLine = requestTemplate.queryLine();
|
||||
// String questionMark="?";
|
||||
// if(queryLine!=null && queryLine.startsWith(questionMark)){
|
||||
// queryLine = queryLine.substring(1);
|
||||
// }
|
||||
// log.info(queryLine);
|
||||
// if(requestTemplate.body()!=null){
|
||||
// log.info(new String(requestTemplate.body()));
|
||||
// }
|
||||
// SortedMap<String, String> allParams = HttpUtils.getAllParams(requestTemplate.path(),queryLine,requestTemplate.body(),requestTemplate.method());
|
||||
// String sign = SignUtil.getParamsSign(allParams);
|
||||
// log.info(" Feign request params sign: {}",sign);
|
||||
// log.info("============================ [end] fegin api url ============================");
|
||||
// requestTemplate.header(CommonConstant.X_SIGN, sign);
|
||||
// requestTemplate.header(CommonConstant.X_TIMESTAMP, String.valueOf(System.currentTimeMillis()));
|
||||
// } catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
// //================================================================================================================
|
||||
// };
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 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));
|
||||
// }
|
||||
//
|
||||
// // update-begin--Author:sunjianlei Date:20210604 for: 给 Feign 添加 FastJson 的解析支持 ----------
|
||||
// /**
|
||||
// * 给 Feign 添加 FastJson 的解析支持
|
||||
// */
|
||||
// @Bean
|
||||
// public Encoder feignEncoder() {
|
||||
// return new SpringEncoder(feignHttpMessageConverter());
|
||||
// }
|
||||
//
|
||||
// @Bean("apiFeignDecoder")
|
||||
// public Decoder feignDecoder() {
|
||||
// return new SpringDecoder(feignHttpMessageConverter());
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 设置解码器为fastjson
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// private ObjectFactory<HttpMessageConverters> feignHttpMessageConverter() {
|
||||
// final HttpMessageConverters httpMessageConverters = new HttpMessageConverters(this.getFastJsonConverter());
|
||||
// return () -> httpMessageConverters;
|
||||
// }
|
||||
//
|
||||
// private FastJsonHttpMessageConverter getFastJsonConverter() {
|
||||
// FastJsonHttpMessageConverter converter = new FastJsonHttpMessageConverter();
|
||||
//
|
||||
// List<MediaType> supportedMediaTypes = new ArrayList<>();
|
||||
// MediaType mediaTypeJson = MediaType.valueOf(MediaType.APPLICATION_JSON_VALUE);
|
||||
// supportedMediaTypes.add(mediaTypeJson);
|
||||
// converter.setSupportedMediaTypes(supportedMediaTypes);
|
||||
// FastJsonConfig config = new FastJsonConfig();
|
||||
// config.getSerializeConfig().put(JSON.class, new SwaggerJsonSerializer());
|
||||
// config.setSerializerFeatures(SerializerFeature.DisableCircularReferenceDetect);
|
||||
// converter.setFastJsonConfig(config);
|
||||
//
|
||||
// return converter;
|
||||
// }
|
||||
// // update-end--Author:sunjianlei Date:20210604 for: 给 Feign 添加 FastJson 的解析支持 ----------
|
||||
//
|
||||
//}
|
||||
Reference in New Issue
Block a user