package com.talentcard.server.business.portal;
|
|
import java.util.Map;
|
|
import com.talentcard.server.common.ApiResponse;
|
import jakarta.validation.Valid;
|
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.RequestParam;
|
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;
|
|
@RestController
|
@RequestMapping("/api/app/fuel-merchants")
|
public class FuelMerchantPortalController {
|
private final FuelMerchantPortalService service;
|
|
public FuelMerchantPortalController(FuelMerchantPortalService service) {
|
this.service = service;
|
}
|
|
@GetMapping("/{merchantId}")
|
public ApiResponse<Map<String, Object>> detail(
|
@PathVariable Long merchantId,
|
@RequestParam(required = false) Long talentCardId
|
) {
|
return ApiResponse.success(service.detail(merchantId, talentCardId));
|
}
|
|
@PostMapping("/{merchantId}/registrations")
|
public ApiResponse<Map<String, Object>> registerMobile(
|
@PathVariable Long merchantId,
|
@Valid @RequestBody FuelMobileRegistrationRequest request,
|
@RequestHeader(value = "X-Idempotency-Key", required = false) String idempotencyKey
|
) {
|
return ApiResponse.success(service.registerMobile(merchantId, request, idempotencyKey));
|
}
|
}
|