63 lines
1.4 KiB
Java
63 lines
1.4 KiB
Java
package io.company.localhost.controller.common;
|
|
|
|
import io.company.localhost.common.annotation.Guest;
|
|
import io.company.localhost.common.annotation.ParameterCheck;
|
|
import io.company.localhost.common.annotation.ReqMap;
|
|
import io.company.localhost.common.dto.MapDto;
|
|
import io.company.localhost.common.response.ApiResponse;
|
|
import io.company.localhost.service.TestService;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
@Slf4j
|
|
@RequestMapping("/api/test/")
|
|
@RestController
|
|
@RequiredArgsConstructor
|
|
public class TestController {
|
|
|
|
private final TestService testService;
|
|
|
|
//annotation TEST
|
|
@ParameterCheck
|
|
@PostMapping("parameter")
|
|
public ApiResponse<String> parameter(@ReqMap MapDto map) {
|
|
return ApiResponse.ok("test");
|
|
}
|
|
|
|
|
|
|
|
//MyBatis TEST
|
|
@GetMapping("getCong")
|
|
public ApiResponse<?> getCong() {
|
|
return ApiResponse.ok(testService.getCong());
|
|
}
|
|
|
|
@Guest
|
|
@ParameterCheck
|
|
@GetMapping("reqTest1")
|
|
public ApiResponse<?> reqTest1(@ReqMap MapDto map) {
|
|
return ApiResponse.ok("OK");
|
|
}
|
|
|
|
@ParameterCheck
|
|
@PostMapping("reqTest1")
|
|
public ApiResponse<?> reqTest2(@ReqMap MapDto map) {
|
|
return ApiResponse.ok("OK");
|
|
}
|
|
|
|
@ParameterCheck
|
|
@PatchMapping("reqTest1")
|
|
public ApiResponse<?> reqTest3(@ReqMap MapDto map) {
|
|
return ApiResponse.ok("OK");
|
|
}
|
|
|
|
|
|
@ParameterCheck
|
|
@DeleteMapping("reqTest1")
|
|
public ApiResponse<?> reqTest4(@ReqMap MapDto map) {
|
|
return ApiResponse.ok("OK");
|
|
}
|
|
|
|
}
|