refactor: 移除 calculateDailyNav 接口
前端暂不需要,后续有需求再加
This commit is contained in:
parent
f7d346c0ae
commit
74e5f85579
@ -269,35 +269,6 @@ public class PortfolioController : ControllerBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 计算投资组合当日净值
|
|
||||||
/// </summary>
|
|
||||||
[HttpPost("{id}/nav-history/calculate")]
|
|
||||||
public async Task<ActionResult<ApiResponse<object>>> CalculateDailyNav(string id)
|
|
||||||
{
|
|
||||||
var userId = GetCurrentUserId();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var success = await _portfolioFacade.CalculateDailyNavAsync(id);
|
|
||||||
return Ok(new ApiResponse<object>
|
|
||||||
{
|
|
||||||
code = Models.StatusCodes.Success,
|
|
||||||
data = new { portfolioId = id, calculated = success },
|
|
||||||
message = success ? "净值计算成功" : "净值计算失败"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
return BadRequest(new ApiResponse<object>
|
|
||||||
{
|
|
||||||
code = Models.StatusCodes.BadRequest,
|
|
||||||
data = null,
|
|
||||||
message = ex.Message
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 创建交易(买入/卖出)
|
/// 创建交易(买入/卖出)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -61,9 +61,4 @@ public interface IPortfolioFacade
|
|||||||
/// 获取用户总资产
|
/// 获取用户总资产
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<TotalAssetsResponse> GetTotalAssetsAsync(string userId);
|
Task<TotalAssetsResponse> GetTotalAssetsAsync(string userId);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 计算投资组合当日净值
|
|
||||||
/// </summary>
|
|
||||||
Task<bool> CalculateDailyNavAsync(string portfolioId);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -195,13 +195,4 @@ public class PortfolioFacade : IPortfolioFacade
|
|||||||
_logger.LogInformation("获取用户总资产: {UserId}", userId);
|
_logger.LogInformation("获取用户总资产: {UserId}", userId);
|
||||||
return await _portfolioService.GetTotalAssetsAsync(userId);
|
return await _portfolioService.GetTotalAssetsAsync(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 计算投资组合当日净值
|
|
||||||
/// </summary>
|
|
||||||
public async Task<bool> CalculateDailyNavAsync(string portfolioId)
|
|
||||||
{
|
|
||||||
_logger.LogInformation("计算投资组合当日净值: {PortfolioId}", portfolioId);
|
|
||||||
return await _navService.CalculateAndSaveDailyNavAsync(portfolioId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user