refactor(invoice): 移除 getCaseProduct 方法中未使用的参数

- 从 InvoiceProductRepoInterface 和 InvoiceProductRepo 中移除了 getCaseProduct 方法的 $uid 参数
- 更新了 QueryCaseInvoiceProductTest 中的测试用例,移除了 $uid 相关的代码- 调整了 API 请求的路径,从 "/rpc/v2/account/$uid/logs/points/$caseId/product" 改为 "/rpc/v2/invoice/$caseId/product"
This commit is contained in:
李东云
2025-08-29 11:28:43 +08:00
parent c8f3acd62b
commit c8681a6d54
3 changed files with 4 additions and 6 deletions

View File

@@ -14,9 +14,8 @@ use Singularity\HDK\Pay\Domain\Invoice\Aggregate\Invoice\InvoiceProduct;
interface InvoiceProductRepoInterface
{
/**
* @param string $uid
* @param string $caseId
* @return InvoiceProduct
*/
public function getCaseProduct(string $uid, string $caseId): InvoiceProduct;
public function getCaseProduct(string $caseId): InvoiceProduct;
}

View File

@@ -20,9 +20,9 @@ final class InvoiceProductRepo extends AbstractRepo implements InvoiceProductRep
/**
* @inheritDoc
*/
public function getCaseProduct(string $uid, string $caseId): InvoiceProduct
public function getCaseProduct(string $caseId): InvoiceProduct
{
$response = $this->requestService->requestGet("/rpc/v2/account/$uid/logs/points/$caseId/product");
$response = $this->requestService->requestGet("/rpc/v2/invoice/$caseId/product");
$content = $response->getBody()->getContents();
$result = Json::decode($content);

View File

@@ -17,10 +17,9 @@ use function Hyperf\Support\make;
it('should can query case invoice product', function () {
$invoiceProductRepo = make(InvoiceProductRepo::class);
$uid = '61dbe752d4caa';
$caseId = '68affb136c01d';
$result = $invoiceProductRepo->getCaseProduct(uid: $uid, caseId: $caseId);
$result = $invoiceProductRepo->getCaseProduct(caseId: $caseId);
expect($result)->toBeInstanceOf(InvoiceProduct::class);
});