啊鑫
2024-11-18 16bbd0a2e072bafea1dc254fbbcf86768fb3ea48
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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 setCode() {
 
        try {
            sendDingtalkService.chatSendMessage();
            return ResultMessage.ok();
        } catch (Exception e) {
            return ResultMessage.error(e);
        }
    }
 
}