优化
This commit is contained in:
+1
-1
@@ -21,7 +21,7 @@
|
||||
| 托盘 | `controller/PlatformPalletController.java`、`service/PalletApplicationService.java` |
|
||||
| 库位与分配 | `controller/PlatformLocationController.java`、`InternalPalletLocationController.java`、`service/PalletLocationAllocationService.java` |
|
||||
| 海外仓阶梯费用 | `controller/PlatformOverseasStorageFeeController.java`、`service/OverseasStorageFeeService.java` |
|
||||
| 平台公共供应商 | `controller/PlatformSupplierController.java`、`service/SupplierService.java`;契约见 `src/main/resources/openapi/supplier-v1.yaml` |
|
||||
| 平台公共供应商 | `controller/PlatformSupplierController.java`、`service/SupplierService.java`;契约见 `src/main/resources/openapi/supplier-v1.yaml` `controller/InternalSupplierController.java` 的 `/{supplierId}/trucking-contact` 为 Firstleg 提供平台 TRUCKING 邮箱资料,取消旧请求允许读取已停用车队邮箱,仍验证内部令牌及平台归属。 |
|
||||
| 国内整柜业务 | `domesticcontainer/controller/PlatformDomesticContainerController.java`、`domesticcontainer/service/DomesticContainerService.java`;契约见 `src/main/resources/openapi/domestic-container-v1.yaml` |
|
||||
| DTO/持久化 | `dto/`、`entity/`、`mapper/`、`repository/` |
|
||||
| SQL | `src/main/resources/db/`;存量统一 `../deploy/sql/头程数据库统一增量-MySQL8.sql` |
|
||||
|
||||
@@ -81,6 +81,29 @@ paths:
|
||||
parameters: [{ $ref: '#/components/parameters/RequiredTenantId' }]
|
||||
requestBody: { required: true, content: { application/json: { schema: { type: object, required: [status], properties: { status: { $ref: '#/components/schemas/Status' } } } } } }
|
||||
responses: { '200': { description: 成功 } }
|
||||
/internal/warehouse/v1/suppliers/{supplierId}/trucking-contact:
|
||||
get:
|
||||
summary: 内部查询码头车队收件资料
|
||||
description: 固定校验TRUCKING类别与平台归属;取消旧车队请求允许requireActive=false。
|
||||
security: [{internalServiceToken: []}]
|
||||
parameters:
|
||||
- {name: supplierId, in: path, required: true, schema: {type: integer, format: int64, minimum: 1}}
|
||||
- {name: requireActive, in: query, schema: {type: boolean, default: true}}
|
||||
responses:
|
||||
'200':
|
||||
description: 联系资料
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
code: {type: string}
|
||||
data:
|
||||
type: object
|
||||
properties:
|
||||
supplierId: {type: string}
|
||||
name: {type: string}
|
||||
email: {type: string, nullable: true}
|
||||
/internal/warehouse/v1/suppliers/{supplierId}:
|
||||
get:
|
||||
summary: 内部服务查询并校验供应商快照
|
||||
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.baiyue.warehouse.controller;
|
||||
|
||||
import com.baiyue.common.core.exception.BizException;
|
||||
import com.baiyue.warehouse.dto.SupplierDtos.SupplierResource;
|
||||
import com.baiyue.warehouse.service.SupplierService;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.test.util.ReflectionTestUtils;
|
||||
import static org.mockito.Mockito.*;
|
||||
import static org.assertj.core.api.Assertions.*;
|
||||
|
||||
class InternalSupplierContactTest {
|
||||
@Test void contactRequiresInternalTokenAndChecksTruckingCategory() {
|
||||
var service = mock(SupplierService.class);
|
||||
var controller = new InternalSupplierController();
|
||||
ReflectionTestUtils.setField(controller,"service",service);
|
||||
ReflectionTestUtils.setField(controller,"internalToken","test-token");
|
||||
controller.initializeToken();
|
||||
assertThatThrownBy(() -> controller.truckingContact("wrong",1L,true)).isInstanceOf(BizException.class);
|
||||
verifyNoInteractions(service);
|
||||
var supplier = mock(SupplierResource.class);
|
||||
when(supplier.name()).thenReturn("Fleet"); when(supplier.email()).thenReturn("fleet@example.com");
|
||||
when(service.detail(1L)).thenReturn(supplier);
|
||||
var result = controller.truckingContact("test-token",1L,false).data();
|
||||
assertThat(result.email()).isEqualTo("fleet@example.com");
|
||||
verify(service).internalSnapshot(1L,false,"TRUCKING");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user