forked from github/dataease
Merge pull request #3063 from dataease/pr@dev@feat_msg_channel
feat(系统管理-消息中心): 增加第三方消息平台
This commit is contained in:
commit
ad1889d9e9
@ -68,6 +68,7 @@ public class ShiroServiceImpl implements ShiroService {
|
||||
|
||||
filterChainDefinitionMap.put("/**/*.json", ANON);
|
||||
filterChainDefinitionMap.put("/system/ui/**", ANON);
|
||||
filterChainDefinitionMap.put("/system/file/**", ANON);
|
||||
filterChainDefinitionMap.put("/**/*.js", ANON);
|
||||
filterChainDefinitionMap.put("/**/*.css", ANON);
|
||||
filterChainDefinitionMap.put("/**/*.map", ANON);
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.dataease.controller.sys;
|
||||
|
||||
import io.dataease.plugins.common.base.domain.FileMetadata;
|
||||
import io.dataease.plugins.common.base.domain.SystemParameter;
|
||||
import io.dataease.commons.constants.ParamConstants;
|
||||
import io.dataease.controller.sys.response.BasicInfo;
|
||||
@ -13,16 +14,15 @@ import io.dataease.service.system.EmailService;
|
||||
import io.dataease.service.system.SystemParameterService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.core.io.ByteArrayResource;
|
||||
import org.springframework.http.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -108,6 +108,23 @@ public class SystemParameterController {
|
||||
return new ResponseEntity<>(bytes, headers, HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/file/down/{fileId}/{fileName}")
|
||||
public ResponseEntity<ByteArrayResource> down(@PathVariable("fileId") String fileId, @PathVariable("fileName") String fileName) throws Exception{
|
||||
|
||||
FileMetadata fileMetadata = fileService.getFileMetadataById(fileId);
|
||||
String type = fileMetadata.getType();
|
||||
if (!StringUtils.endsWith(fileName.toUpperCase(), type.toUpperCase())) {
|
||||
fileName += ("." + type);
|
||||
}
|
||||
byte[] bytes = fileService.loadFileAsBytes(fileId);
|
||||
ByteArrayResource bar = new ByteArrayResource(bytes);
|
||||
final HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
|
||||
ContentDisposition contentDisposition = ContentDisposition.parse("attachment; filename=" + URLEncoder.encode(fileName, "UTF-8"));
|
||||
headers.setContentDisposition(contentDisposition);
|
||||
return new ResponseEntity<>(bar, headers, HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping(value = "/save/ui", consumes = {"multipart/form-data"})
|
||||
public void saveUIInfo(@RequestPart("request") Map<String, List<SystemParameterDTO>> systemParameterMap, @RequestPart(value = "files", required = false) List<MultipartFile> bodyFiles) throws IOException {
|
||||
systemParameterService.saveUIInfo(systemParameterMap, bodyFiles);
|
||||
|
@ -0,0 +1,32 @@
|
||||
package io.dataease.service.message.service.strategy;
|
||||
|
||||
import io.dataease.auth.entity.SysUserEntity;
|
||||
import io.dataease.auth.service.AuthUserService;
|
||||
import io.dataease.plugins.config.SpringContextUtil;
|
||||
import io.dataease.plugins.xpack.dingtalk.service.DingtalkXpackService;
|
||||
import io.dataease.service.message.service.SendService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service("sendDingtalk")
|
||||
public class SendDingtalk implements SendService {
|
||||
|
||||
@Autowired
|
||||
private AuthUserService authUserService;
|
||||
|
||||
@Override
|
||||
public void sendMsg(Long userId, Long typeId, String content, String param) {
|
||||
SysUserEntity userEntity = authUserService.getUserById(userId);
|
||||
|
||||
if (userEntity.getFrom() == 5 && authUserService.supportDingtalk()) {
|
||||
String username = userEntity.getUsername();
|
||||
DingtalkXpackService dingtalkXpackService = SpringContextUtil.getBean(DingtalkXpackService.class);
|
||||
List<String> userIds = new ArrayList<>();
|
||||
userIds.add(username);
|
||||
dingtalkXpackService.pushMsg(userIds, content);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package io.dataease.service.message.service.strategy;
|
||||
|
||||
import io.dataease.auth.entity.SysUserEntity;
|
||||
import io.dataease.auth.service.AuthUserService;
|
||||
import io.dataease.plugins.config.SpringContextUtil;
|
||||
import io.dataease.plugins.xpack.lark.service.LarkXpackService;
|
||||
import io.dataease.service.message.service.SendService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service("sendLark")
|
||||
public class SendLark implements SendService {
|
||||
|
||||
@Autowired
|
||||
private AuthUserService authUserService;
|
||||
|
||||
@Override
|
||||
public void sendMsg(Long userId, Long typeId, String content, String param) {
|
||||
SysUserEntity userEntity = authUserService.getUserById(userId);
|
||||
|
||||
if (userEntity.getFrom() == 6 && authUserService.supportLark()) {
|
||||
String username = userEntity.getUsername();
|
||||
LarkXpackService larkXpackService = SpringContextUtil.getBean(LarkXpackService.class);
|
||||
List<String> userIds = new ArrayList<>();
|
||||
userIds.add(username);
|
||||
larkXpackService.pushMsg(userIds, content);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package io.dataease.service.message.service.strategy;
|
||||
|
||||
import io.dataease.auth.entity.SysUserEntity;
|
||||
import io.dataease.auth.service.AuthUserService;
|
||||
import io.dataease.plugins.config.SpringContextUtil;
|
||||
import io.dataease.plugins.xpack.wecom.service.WecomXpackService;
|
||||
import io.dataease.service.message.service.SendService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service("sendWecom")
|
||||
public class SendWecom implements SendService {
|
||||
|
||||
@Autowired
|
||||
private AuthUserService authUserService;
|
||||
@Override
|
||||
public void sendMsg(Long userId, Long typeId, String content, String param) {
|
||||
SysUserEntity userEntity = authUserService.getUserById(userId);
|
||||
|
||||
if (userEntity.getFrom() == 4 && authUserService.supportWecom()) {
|
||||
String username = userEntity.getUsername();
|
||||
WecomXpackService wecomXpackService = SpringContextUtil.getBean(WecomXpackService.class);
|
||||
List<String> userIds = new ArrayList<>();
|
||||
userIds.add(username);
|
||||
wecomXpackService.pushMsg(userIds, content);
|
||||
}
|
||||
}
|
||||
}
|
@ -84,7 +84,7 @@ i18n_cst_ds_tb_or_field_deleted=Custom dataset union data is deleted or field ch
|
||||
i18n_no_all_delete_privilege_folder=This folder have sources which have no manage or view privilege,Can Not Be Deleted.
|
||||
i18n_excel_field_repeat=Duplicate fields exist, please modify and try again.
|
||||
i18n_schema_is_empty=Database schema is empty
|
||||
\u7AD9\u5185\u6D88\u606F=Internal Messages
|
||||
\u7AD9\u5185\u6D88\u606F=Messages Center
|
||||
\u6240\u6709\u6D88\u606F=All Messages
|
||||
\u672A\u8BFB\u6D88\u606F=Unread Messages
|
||||
\u5DF2\u8BFB\u6D88\u606F==Read Messages
|
||||
|
@ -84,7 +84,7 @@ i18n_cst_ds_tb_or_field_deleted=\u81EA\u5B9A\u4E49\u6570\u636E\u96C6\u6240\u5173
|
||||
i18n_no_all_delete_privilege_folder=\u8BE5\u76EE\u5F55\u4E0B\u5B58\u5728\u6CA1\u6709\u7BA1\u7406\u6743\u9650\u6216\u67E5\u770B\u6743\u9650\u7684\u8D44\u6E90\uFF0C\u65E0\u6CD5\u5220\u9664
|
||||
i18n_excel_field_repeat=\u5B58\u5728\u91CD\u590D\u5B57\u6BB5\uFF0C\u8BF7\u4FEE\u6539\u540E\u91CD\u8BD5
|
||||
i18n_schema_is_empty=\u6570\u636E\u5E93 Schema \u4E3A\u7A7A
|
||||
\u7AD9\u5185\u6D88\u606F=\u7AD9\u5185\u6D88\u606F
|
||||
\u7AD9\u5185\u6D88\u606F=\u6D88\u606F\u4E2D\u5FC3
|
||||
\u6240\u6709\u6D88\u606F=\u6240\u6709\u6D88\u606F
|
||||
\u672A\u8BFB\u6D88\u606F=\u672A\u8BFB\u6D88\u606F
|
||||
\u5DF2\u8BFB\u6D88\u606F=\u5DF2\u8BFB\u6D88\u606F
|
||||
@ -219,5 +219,5 @@ I18N_USER_DONOT_EXIST=\u7528\u6237\u4E0D\u5B58\u5728
|
||||
I18N_USER_SOURCE_PWD_ERROR=\u539F\u59CB\u5BC6\u7801\u9519\u8BEF
|
||||
I18N_USER_PWD_FORMAT_ERROR=\u5BC6\u7801\u683C\u5F0F\u9519\u8BEF
|
||||
|
||||
I18N_DS_INVALID=数据源无效.
|
||||
I18N_DS_INVALID_TABLE=数据源中有无效的表
|
||||
I18N_DS_INVALID=\u6570\u636E\u6E90\u65E0\u6548.
|
||||
I18N_DS_INVALID_TABLE=\u6570\u636E\u6E90\u4E2D\u6709\u65E0\u6548\u7684\u8868
|
@ -84,7 +84,7 @@ i18n_cst_ds_tb_or_field_deleted=\u81EA\u5B9A\u7FA9\u6578\u64DA\u96C6\u6240\u95DC
|
||||
i18n_no_all_delete_privilege_folder=\u8A72\u76EE\u9304\u4E0B\u5B58\u5728\u6C92\u6709\u7BA1\u7406\u6B0A\u9650\u6216\u67E5\u770B\u6B0A\u9650\u7684\u8CC7\u6E90\uFF0C\u7121\u6CD5\u522A\u9664
|
||||
i18n_excel_field_repeat=\u5B58\u5728\u91CD\u5FA9\u5B57\u6BB5\uFF0C\u8ACB\u4FEE\u6539\u5F8C\u91CD\u8BD5
|
||||
i18n_schema_is_empty=\u6578\u64DA\u5EAB Schema \u70BA\u7A7A
|
||||
\u7AD9\u5185\u6D88\u606F=\u7AD9\u5167\u6D88\u606F
|
||||
\u7AD9\u5185\u6D88\u606F=\u6D88\u606F\u4E2D\u5FC3
|
||||
\u6240\u6709\u6D88\u606F=\u6240\u6709\u6D88\u606F
|
||||
\u672A\u8BFB\u6D88\u606F=\u672A\u8B80\u6D88\u606F
|
||||
\u5DF2\u8BFB\u6D88\u606F=\u5DF2\u8B80\u6D88\u606F
|
||||
@ -215,5 +215,5 @@ I18N_USER_DONOT_EXIST=\u7528\u6236\u4E0D\u5B58\u5728
|
||||
I18N_USER_SOURCE_PWD_ERROR=\u539F\u59CB\u5BC6\u78BC\u932F\u8AA4
|
||||
I18N_USER_PWD_FORMAT_ERROR=\u5BC6\u78BC\u683C\u5F0F\u932F\u8AA4
|
||||
|
||||
I18N_DS_INVALID=數據源無效.
|
||||
I18N_DS_INVALID_TABLE=數據源中有無效的表
|
||||
I18N_DS_INVALID=\u6578\u64DA\u6E90\u7121\u6548.
|
||||
I18N_DS_INVALID_TABLE=\u6578\u64DA\u6E90\u4E2D\u6709\u7121\u6548\u7684\u8868
|
@ -2222,8 +2222,11 @@ export default {
|
||||
i18n_msg_type_dataset_sync_faild: 'Dataset synchronization failed',
|
||||
i18n_msg_type_all: 'All type',
|
||||
i18n_msg_type_ds_invalid: 'Datasource invalid',
|
||||
channel_inner_msg: 'On site news',
|
||||
channel_email_msg: 'Mail notification'
|
||||
channel_inner_msg: 'On site',
|
||||
channel_email_msg: 'Email',
|
||||
channel_wecom_msg: 'Wecom',
|
||||
channel_dingtalk_msg: 'Dingtalk',
|
||||
channel_lark_msg: 'Lark'
|
||||
},
|
||||
denumberrange: {
|
||||
label: 'Number range',
|
||||
|
@ -2224,7 +2224,10 @@ export default {
|
||||
i18n_msg_type_ds_invalid: '數據源失效',
|
||||
i18n_msg_type_all: '全部類型',
|
||||
channel_inner_msg: '站內消息',
|
||||
channel_email_msg: '郵件提醒'
|
||||
channel_email_msg: '郵件提醒',
|
||||
channel_wecom_msg: '企業微信',
|
||||
channel_dingtalk_msg: '釘釘提醒',
|
||||
channel_lark_msg: '飛書提醒'
|
||||
},
|
||||
denumberrange: {
|
||||
label: '數值區間',
|
||||
|
@ -2224,7 +2224,10 @@ export default {
|
||||
i18n_msg_type_ds_invalid: '数据源失效',
|
||||
i18n_msg_type_all: '全部类型',
|
||||
channel_inner_msg: '站内消息',
|
||||
channel_email_msg: '邮件提醒'
|
||||
channel_email_msg: '邮件提醒',
|
||||
channel_wecom_msg: '企业微信',
|
||||
channel_dingtalk_msg: '钉钉提醒',
|
||||
channel_lark_msg: '飞书提醒'
|
||||
},
|
||||
denumberrange: {
|
||||
label: '数值区间',
|
||||
|
Loading…
Reference in New Issue
Block a user