refactor: 删除冗余的 /api/v1/portfolio/{id}/transactions 路由
保留 query parameter 方式: /api/v1/portfolio/transactions?portfolioId=xxx
This commit is contained in:
parent
7db098b5f9
commit
a0817081a8
@ -300,38 +300,6 @@ public class PortfolioController : ControllerBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取交易记录
|
|
||||||
/// </summary>
|
|
||||||
[HttpGet("{id}/transactions")]
|
|
||||||
public async Task<ActionResult<ApiResponse<GetTransactionsResponse>>> GetTransactions(
|
|
||||||
string id,
|
|
||||||
[FromQuery] int limit = 20,
|
|
||||||
[FromQuery] int offset = 0)
|
|
||||||
{
|
|
||||||
var userId = GetCurrentUserId();
|
|
||||||
|
|
||||||
var request = new GetTransactionsRequest
|
|
||||||
{
|
|
||||||
PortfolioId = id,
|
|
||||||
Limit = limit,
|
|
||||||
Offset = offset
|
|
||||||
};
|
|
||||||
|
|
||||||
var transactions = await _portfolioFacade.GetTransactionsAsync(id, request, userId);
|
|
||||||
|
|
||||||
return Ok(new ApiResponse<GetTransactionsResponse>
|
|
||||||
{
|
|
||||||
code = Models.StatusCodes.Success,
|
|
||||||
data = new GetTransactionsResponse
|
|
||||||
{
|
|
||||||
Items = transactions,
|
|
||||||
Total = transactions.Count
|
|
||||||
},
|
|
||||||
message = "success"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取策略信号
|
/// 获取策略信号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user