liujie
2026-08-21 a7c8a8f6055e1a03414f2227d12ff2e87ec52d41
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
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()));
    }
}