Compare commits
No commits in common. "74e5f85579296c746c1ca440247a5d481dffcea5" and "a0817081a84362bbcc6bb40e7f2618d5ea7572f3" have entirely different histories.
74e5f85579
...
a0817081a8
@ -272,25 +272,16 @@ public class PortfolioController : ControllerBase
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 创建交易(买入/卖出)
|
/// 创建交易(买入/卖出)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[HttpPost("transactions")]
|
[HttpPost("{id}/transactions")]
|
||||||
public async Task<ActionResult<ApiResponse<TransactionItem>>> CreateTransaction(
|
public async Task<ActionResult<ApiResponse<TransactionItem>>> CreateTransaction(
|
||||||
|
string id,
|
||||||
[FromBody] CreateTransactionRequest request)
|
[FromBody] CreateTransactionRequest request)
|
||||||
{
|
{
|
||||||
var userId = GetCurrentUserId();
|
var userId = GetCurrentUserId();
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(request.PortfolioId))
|
|
||||||
{
|
|
||||||
return BadRequest(new ApiResponse<TransactionItem>
|
|
||||||
{
|
|
||||||
code = Models.StatusCodes.BadRequest,
|
|
||||||
data = null,
|
|
||||||
message = "portfolioId 不能为空"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var transaction = await _portfolioFacade.CreateTransactionAsync(request.PortfolioId, request, userId);
|
var transaction = await _portfolioFacade.CreateTransactionAsync(id, request, userId);
|
||||||
return Ok(new ApiResponse<TransactionItem>
|
return Ok(new ApiResponse<TransactionItem>
|
||||||
{
|
{
|
||||||
code = Models.StatusCodes.Success,
|
code = Models.StatusCodes.Success,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user