package com.gs.dingtalk.controller;
|
|
|
import com.gs.dingtalk.config.ResultMessage;
|
import com.gs.dingtalk.service.SendDingtalkService;
|
import lombok.RequiredArgsConstructor;
|
import org.springframework.web.bind.annotation.CrossOrigin;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
|
@RestController
|
@RequestMapping("Numerical")
|
@RequiredArgsConstructor
|
@CrossOrigin(origins = "*") //跨域请求
|
public class KMController {
|
|
|
private final SendDingtalkService sendDingtalkService;
|
|
@PostMapping("/chatSendMessage")
|
public ResultMessage chatSendMessage() {
|
|
try {
|
sendDingtalkService.chatSendMessage();
|
return ResultMessage.ok();
|
} catch (Exception e) {
|
return ResultMessage.error(e);
|
}
|
}
|
|
@PostMapping("/getUserId")
|
public ResultMessage getUserId() {
|
|
try {
|
sendDingtalkService.getDingTalkUserId();
|
return ResultMessage.ok();
|
} catch (Exception e) {
|
return ResultMessage.error(e);
|
}
|
}
|
|
}
|