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

同步lab环境代码

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