feat(device): add logging for device creation endpoint
- Added SLF4J logging annotation to DeviceController - Implemented info level logging for create device requests - Included request payload in log message for debugging purposes
This commit is contained in:
@@ -8,6 +8,7 @@ import cn.nopj.chaos_api.dto.response.DeviceResponse;
|
||||
import cn.nopj.chaos_api.model.ApiResult;
|
||||
import cn.nopj.chaos_api.service.DeviceService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -16,6 +17,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
/**
|
||||
* 设备管理
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/devices")
|
||||
public class DeviceController {
|
||||
@@ -43,6 +45,7 @@ public class DeviceController {
|
||||
*/
|
||||
@PostMapping
|
||||
public ApiResult<DeviceResponse> createDevice(@RequestBody @Validated CreateDeviceRequest createDeviceRequest){
|
||||
log.info("创建设备信息: {}", createDeviceRequest);
|
||||
return ApiResult.success(deviceService.createDevice(createDeviceRequest));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user