blob: 52715acf99f6881765c7a170b1cd91bd98758f7d [file] [log] [blame]
223011028fd30b82025-06-05 18:02:21 +08001package com.pt.testResponse;
2
22301102f5670302025-06-08 14:10:02 +08003import com.pt.CustomResponse;
223011028fd30b82025-06-05 18:02:21 +08004import org.springframework.web.bind.annotation.CrossOrigin;
5import org.springframework.web.bind.annotation.GetMapping;
6import org.springframework.web.bind.annotation.RestController;
7
22301102f5670302025-06-08 14:10:02 +08008import java.util.Map;
9
223011028fd30b82025-06-05 18:02:21 +080010@RestController
11@CrossOrigin(origins = "*")
12public class TestController {
13
22301102b04a60d2025-06-05 18:02:21 +080014 @GetMapping("/api/test")
22301102f5670302025-06-08 14:10:02 +080015 public CustomResponse testResponse() {
16 return new CustomResponse(
17 1,
18 "This is a test response",
19 Map.of(
20 "key1", "value1",
21 "key2", "value2"
22 )
23 );
223011028fd30b82025-06-05 18:02:21 +080024 }
25}