package com.tourguide.api.guide;
|
|
import com.tourguide.common.api.ApiResponse;
|
import com.tourguide.modules.guide.dto.GuideWorkbenchResponse;
|
import com.tourguide.modules.guide.service.GuideWorkbenchService;
|
import com.tourguide.security.AppUserPrincipal;
|
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
|
@RestController
|
@RequestMapping("/api/guide/workbench")
|
public class GuideWorkbenchController {
|
private final GuideWorkbenchService workbenchService;
|
|
public GuideWorkbenchController(GuideWorkbenchService workbenchService) {
|
this.workbenchService = workbenchService;
|
}
|
|
@GetMapping
|
public ApiResponse<GuideWorkbenchResponse> get(@AuthenticationPrincipal AppUserPrincipal principal) {
|
return ApiResponse.success(workbenchService.get(principal.getUserId()));
|
}
|
}
|