mirror of
http://124.126.16.154:8888/singularity/hdk-pay.git
synced 2026-01-15 06:15:09 +08:00
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:
@@ -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;
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user