This commit is contained in:
2026-08-30 18:49:15 +08:00
parent 5ddaa4d51f
commit a4429f95b7
19 changed files with 151 additions and 31 deletions
@@ -13,8 +13,8 @@ import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.http.HttpStatus;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.server.ResponseStatusException;
@@ -78,8 +78,8 @@ public class DeliveryTransferController {
@PreAuthorize("hasAuthority('" + OverseasPermissions.DELIVERY_LIST + "')")
public ApiResponse<DeliveryResponses.DeliveryDetail> deliveryDetail(
@AuthenticationPrincipal AuthenticatedUser user, @RequestParam(required = false) String customerId,
@PathVariable String deliveryNo, @Valid DeliveryRequests.PalletQuery query) {
return ApiResponse.success(service.deliveryDetail(scope(user, customerId), deliveryNo, query));
@PathVariable String deliveryNo) {
return ApiResponse.success(service.deliveryDetail(scope(user, customerId), deliveryNo));
}
private String scope(AuthenticatedUser user, String requestedCustomer) {
@@ -33,9 +33,8 @@ public class MerchantDeliveryController {
@GetMapping("/{deliveryNo}")
public ApiResponse<DeliveryResponses.DeliveryDetail> detail(@AuthenticationPrincipal AuthenticatedUser user,
@PathVariable String deliveryNo,
@Valid DeliveryRequests.PalletQuery query) {
return ApiResponse.success(service.deliveryDetail(customer(user), deliveryNo, query));
@PathVariable String deliveryNo) {
return ApiResponse.success(service.deliveryDetail(customer(user), deliveryNo));
}
private String customer(AuthenticatedUser user) {