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

同步lab环境代码

上级 4535a485
......@@ -115,12 +115,7 @@ public class DevBootSecurityConfig extends WebSecurityConfigurerAdapter {
.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()
.antMatchers("/notify/**").permitAll()
.anyRequest().authenticated()
// 防止iframe 造成跨域
......
......@@ -120,12 +120,7 @@ public class apiSecurityConfig extends WebSecurityConfigurerAdapter {
.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()
.antMatchers("/notify/**").permitAll()
// 所有请求都需要认证
.anyRequest().authenticated()
// 防止iframe 造成跨域
......
package cn.ibizlab.api.rest.extensions;
import cn.ibizlab.core.extensions.domain.Msg;
import cn.ibizlab.api.dto.MsgBodyDTO;
import cn.ibizlab.api.mapping.MsgBodyMapping;
import cn.ibizlab.core.extensions.domain.Template;
import cn.ibizlab.core.extensions.service.NotifyCoreService;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -15,50 +16,53 @@ public class NotifyCoreResource {
@Autowired
NotifyCoreService notifyCoreService;
@Autowired
MsgBodyMapping mapping;
/**
* 发送工作流消息
* @param msg
* @param dto
* @return
*/
@RequestMapping(method = RequestMethod.POST,value = "/SendMsg")
public ResponseEntity<Boolean> SendMsg(@Validated @RequestBody Msg msg){
return ResponseEntity.status(HttpStatus.OK).body(notifyCoreService.sendMsg(msg));
@RequestMapping(method = RequestMethod.POST,value = "/notify/sendmsg")
public ResponseEntity<Boolean> sendMsg(@Validated @RequestBody MsgBodyDTO dto){
return ResponseEntity.status(HttpStatus.OK).body(notifyCoreService.sendMsg(mapping.toDomain(dto)));
}
/**
* 建立消息模板
* @param template
* @return
*/
@RequestMapping(method = RequestMethod.POST,value = "/createMsgTemplate")
@RequestMapping(method = RequestMethod.POST,value = "/notify/createmsgtempl")
public ResponseEntity<Boolean> createMsgTemplate(@Validated @RequestBody Template template){
return ResponseEntity.status(HttpStatus.OK).body(notifyCoreService.createMsgTemplate(template));
}
/**
* 发送钉钉链接消息
* @param msg
* @param dto
* @return
*/
@RequestMapping(method = RequestMethod.POST,value = "/dingtalk/sendlinkmsg")
public ResponseEntity<Long> sendDingTalkLinkMsg(@RequestBody Msg msg){
return ResponseEntity.status(HttpStatus.OK).body(notifyCoreService.sendLinkMsg(msg));
@RequestMapping(method = RequestMethod.POST,value = "/notify/dingtalk/sendlinkmsg")
public ResponseEntity<Boolean> sendDingTalkLinkMsg(@RequestBody MsgBodyDTO dto){
return ResponseEntity.status(HttpStatus.OK).body(notifyCoreService.sendDingTalkLinkMsg(mapping.toDomain(dto)));
}
/**
* 创建钉钉待办
* @param msg
* @param dto
* @return
*/
@RequestMapping(method = RequestMethod.POST,value = "/dingtalk/createworkrecord")
public ResponseEntity<Boolean> createDingTalkWorkRecord(@RequestBody Msg msg){
return ResponseEntity.status(HttpStatus.OK).body(notifyCoreService.createWorkRecord(msg));
@RequestMapping(method = RequestMethod.POST,value = "/notify/dingtalk/createworkrecord")
public ResponseEntity<String> createDingTalkWorkRecord(@RequestBody MsgBodyDTO dto){
return ResponseEntity.status(HttpStatus.OK).body(notifyCoreService.createDingTalkWorkRecord(mapping.toDomain(dto)));
}
/**
* 完成钉钉待办
* @param msg
* @param
* @return
*/
@RequestMapping(method = RequestMethod.POST,value = "/dingtalk/finishworkrecord")
public ResponseEntity<Boolean> finishDingTalkWorkRecord(@RequestBody Msg msg){
return ResponseEntity.status(HttpStatus.OK).body(notifyCoreService.finishWorkRecord(msg));
@RequestMapping(method = RequestMethod.POST,value = "/notify/dingtalk/finishworkrecord/{msgid}")
public ResponseEntity<Boolean> finishDingTalkWorkRecord(@PathVariable("msgid") String msgId){
return ResponseEntity.status(HttpStatus.OK).body(notifyCoreService.finishDingTalkWorkRecord(msgId));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册