提交 fb5969af 编写于 作者: zhouweidong's avatar zhouweidong

钉钉待办集成

上级 263a308e
......@@ -114,8 +114,14 @@ public class DevBootSecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers("/"+downloadpath+"/**").permitAll()
.antMatchers("/"+uploadpath).permitAll()
.antMatchers("/"+previewpath+"/**").permitAll()
//消息发送请求
.antMatchers("/SendMsg").permitAll()
.antMatchers("/createMsgTemplate").permitAll()
.antMatchers("/trade/pagepay").permitAll()
.antMatchers("/dingtalk/sendlinkmsg").permitAll()
.antMatchers("/dingtalk/createworkrecord").permitAll()
.antMatchers("/dingtalk/finishworkrecord").permitAll()
.anyRequest().authenticated()
// 防止iframe 造成跨域
.and().headers().frameOptions().disable();
......
package cn.ibizlab.core.extensions.domain;
import lombok.Builder;
import lombok.Data;
import javax.validation.constraints.NotBlank;
......@@ -12,6 +13,7 @@ import java.util.Map;
* 其余类型消息则以模板内容为准。
*/
@Data
@Builder
public class Msg {
/**
......@@ -41,6 +43,10 @@ public class Msg {
* 消息链接
*/
private String url;
/**
* 待办标识
*/
private String recordid;
/**
* 消息模板参数
*/
......
......@@ -119,8 +119,13 @@ public class apiSecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers("/"+downloadpath+"/**").permitAll()
.antMatchers("/"+uploadpath).permitAll()
.antMatchers("/"+previewpath+"/**").permitAll()
//消息发送请求
.antMatchers("/SendMsg").permitAll()
.antMatchers("/createMsgTemplate").permitAll()
.antMatchers("/trade/pagepay").permitAll()
.antMatchers("/dingtalk/sendlinkmsg").permitAll()
.antMatchers("/dingtalk/createworkrecord").permitAll()
.antMatchers("/dingtalk/finishworkrecord").permitAll()
// 所有请求都需要认证
.anyRequest().authenticated()
// 防止iframe 造成跨域
......
......@@ -15,13 +15,50 @@ public class NotifyCoreResource {
@Autowired
NotifyCoreService notifyCoreService;
/**
* 发送工作流消息
* @param msg
* @return
*/
@RequestMapping(method = RequestMethod.POST,value = "/SendMsg")
public ResponseEntity<Boolean> SendMsg(@Validated @RequestBody Msg msg){
return ResponseEntity.status(HttpStatus.OK).body(notifyCoreService.sendMsg(msg));
}
/**
* 建立消息模板
* @param template
* @return
*/
@RequestMapping(method = RequestMethod.POST,value = "/createMsgTemplate")
public ResponseEntity<Boolean> createMsgTemplate(@Validated @RequestBody Template template){
return ResponseEntity.status(HttpStatus.OK).body(notifyCoreService.createMsgTemplate(template));
}
/**
* 发送钉钉链接消息
* @param msg
* @return
*/
@RequestMapping(method = RequestMethod.POST,value = "/dingtalk/sendlinkmsg")
public ResponseEntity<Long> sendDingTalkLinkMsg(@RequestBody Msg msg){
return ResponseEntity.status(HttpStatus.OK).body(notifyCoreService.sendLinkMsg(msg));
}
/**
* 创建钉钉待办
* @param msg
* @return
*/
@RequestMapping(method = RequestMethod.POST,value = "/dingtalk/createworkrecord")
public ResponseEntity<String> createDingTalkWorkRecord(@RequestBody Msg msg){
return ResponseEntity.status(HttpStatus.OK).body(notifyCoreService.createWorkRecord(msg));
}
/**
* 完成钉钉待办
* @param msg
* @return
*/
@RequestMapping(method = RequestMethod.POST,value = "/dingtalk/finishworkrecord")
public ResponseEntity<Boolean> finishDingTalkWorkRecord(@RequestBody Msg msg){
return ResponseEntity.status(HttpStatus.OK).body(notifyCoreService.finishWorkRecord(msg));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册