leutu
2024-06-03 3ef35e6cd16bbfa206b26bb3271eac40ad020bcb
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
33
package com.fastbee.iot.oauth.api;
 
import com.alibaba.fastjson2.JSONObject;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
 
/**
 * kerwincui
 */
@RestController
public class SpeakerController {
    @GetMapping("/oauth/speaker/get")
    public JSONObject getSpeaker() {
//        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        JSONObject Json = new JSONObject();
        Json.put("1", "1");
        Json.put("2", "2");
        Json.put("3", "3");
        System.out.println("调用了接口get");
        return Json;
    }
    @PostMapping("/oauth/speaker/post")
    public JSONObject postSpeaker() {
//        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        JSONObject bookJson = new JSONObject();
        bookJson.put("1", "1");
        System.out.println("调用了接口post");
        return bookJson;
    }
}