shinnosuke
2026-09-25 66c0d9abbcb9f7b4407784ba4c886ce94a8b55dc
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package com.talentcard.server.business.portal;
 
import java.util.Map;
 
import com.talentcard.server.business.PageResult;
import com.talentcard.server.common.ApiResponse;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
@Tag(name = "App-停车服务商", description = "停车服务商详情、停车场和车牌登记接口")
@RestController
@RequestMapping("/api/app/parking-merchants")
public class ParkingMerchantPortalController {
    private final ParkingMerchantPortalService service;
 
    public ParkingMerchantPortalController(ParkingMerchantPortalService service) {
        this.service = service;
    }
 
    @Operation(summary = "停车服务商详情", description = "返回停车服务商基础信息、停车场位置和人才权益配置")
    @GetMapping("/{merchantId}")
    public ApiResponse<Map<String, Object>> detail(
            @Parameter(description = "停车服务商ID") @PathVariable Long merchantId,
            @Parameter(description = "人才卡ID;用于匹配对应人才卡等级的权益配置") @RequestParam(required = false) Long talentCardId
    ) {
        return ApiResponse.success(service.detail(merchantId, talentCardId));
    }
 
    @GetMapping("/{merchantId}/parking-lots")
    public ApiResponse<PageResult<Map<String, Object>>> parkingLots(
            @PathVariable Long merchantId,
            @org.springframework.web.bind.annotation.RequestParam(required = false) String keyword,
            @org.springframework.web.bind.annotation.RequestParam(defaultValue = "1") int page,
            @org.springframework.web.bind.annotation.RequestParam(defaultValue = "10") int size
    ) {
        return ApiResponse.success(service.parkingLots(merchantId, keyword, page, size));
    }
 
    @PostMapping("/{merchantId}/registrations")
    public ApiResponse<Map<String, Object>> registerPlate(
            @PathVariable Long merchantId,
            @Valid @RequestBody ParkingPlateRegistrationRequest request,
            @RequestHeader(value = "X-Idempotency-Key", required = false) String idempotencyKey
    ) {
        return ApiResponse.success(service.registerPlate(merchantId, request, idempotencyKey));
    }
}