초기커밋
This commit is contained in:
93
BrokerApiServer/Controllers/UserController.cs
Normal file
93
BrokerApiServer/Controllers/UserController.cs
Normal file
@@ -0,0 +1,93 @@
|
||||
//
|
||||
// using Asp.Versioning;
|
||||
//
|
||||
// using BrokerCore.ApiModels;
|
||||
// using BrokerCore.Common;
|
||||
// using BrokerCore.DbEntity;
|
||||
// using BrokerCore.Services;
|
||||
//
|
||||
// using Microsoft.AspNetCore.Mvc;
|
||||
//
|
||||
// using ServerCommon;
|
||||
//
|
||||
// using Swashbuckle.AspNetCore.Annotations;
|
||||
//
|
||||
// namespace BrokerApiServer.Controllers;
|
||||
//
|
||||
// [ApiVersion("1.0")]
|
||||
// [Route("api/v1/user")]
|
||||
// [ApiController, SwaggerTag("**PlanetUser 항목으로 이전 후 삭제 예정** (3월 말 예정)")]
|
||||
// // 특별한 인증 없이 런처 토큰만으로도 사용 가능한 컨트롤러
|
||||
// public class UserController : ControllerBase
|
||||
// {
|
||||
// private readonly SapphireExchangeService m_exchange_service;
|
||||
// private readonly IServerLogic m_server_logic;
|
||||
//
|
||||
// public UserController(
|
||||
// IServerLogic serverLogic,
|
||||
// SapphireExchangeService exchangeService)
|
||||
// {
|
||||
// m_server_logic = serverLogic;
|
||||
// m_exchange_service = exchangeService;
|
||||
// }
|
||||
//
|
||||
// [SwaggerIgnore]
|
||||
// [HttpPost("balance/sapphire"), RequireUserJwtAuth]
|
||||
// [Produces("application/json")]
|
||||
// [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(UserSapphireResponse))]
|
||||
// [ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ApiErrorResponse))]
|
||||
// [SwaggerOperation(Summary = "유저 사파이어 현재 수량 조회 (유저 sso jwt bearer header 필요)",
|
||||
// Description = "웹 런처에서 발급한 토큰을 header의 authorization에 bearer 형식으로 넣어주세요.")]
|
||||
// public async Task<IActionResult> getSapphireBalance(UserSapphireRequest _)
|
||||
// {
|
||||
// var dynamo_db_client = m_server_logic.getDynamoDbClient();
|
||||
// var user_guid = this.HttpContext.Items["user_guid"] as string ?? string.Empty;
|
||||
// CurrencyControlHelper.setDbConnector(dynamo_db_client);
|
||||
// var (result, current_sapphire_amount_double) =
|
||||
// await CurrencyControlHelper.getMoneyByUserGuid(user_guid, CurrencyType.Sapphire);
|
||||
// Guard.Against.resultFail(result);
|
||||
//
|
||||
// var current_sapphire_amount = Convert.ToInt64(current_sapphire_amount_double);
|
||||
// return Ok(new UserSapphireResponse { SapphireAmount = current_sapphire_amount });
|
||||
// }
|
||||
//
|
||||
// [SwaggerIgnore]
|
||||
// [HttpPost("exchange/order/list"), RequireUserJwtAuth]
|
||||
// [Produces("application/json")]
|
||||
// [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(UserExchangeOrderListResponse))]
|
||||
// [ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ApiErrorResponse))]
|
||||
// [SwaggerOperation(Summary = "유저 사파이어 교환 주문 목록 조회 (유저 sso jwt bearer header 필요)",
|
||||
// Description = "웹 런처에서 발급한 토큰을 header의 authorization에 bearer 형식으로 넣어주세요.\n 이기몹의 PlanetId는 igm26_iggymob 입니다.")]
|
||||
// public async Task<IActionResult> getOrdersForUser(
|
||||
// [SwaggerRequestBody] UserExchangeOrderListRequest request,
|
||||
// CancellationToken cancellationToken)
|
||||
// {
|
||||
// var planet_id = request.PlanetId;
|
||||
// var user_guid = this.HttpContext.Items["user_guid"]?.ToString() ?? string.Empty;
|
||||
// Guard.Against.isNullOrEmptyOrWhiteSpace(user_guid,
|
||||
// ServerErrorCode.AccountNotFound, "해당 유저를 찾을 수 없음");
|
||||
// await m_exchange_service.authUser(user_guid, string.Empty);
|
||||
//
|
||||
// ExchangeOrderStatus? order_status = request switch
|
||||
// {
|
||||
// { Option: FindOption.Completed } => ExchangeOrderStatus.Completed,
|
||||
// { Option: FindOption.Pending } => ExchangeOrderStatus.Pending,
|
||||
// _ => null // 전체 조회
|
||||
// };
|
||||
// var orders =
|
||||
// await m_exchange_service.findOrderList(planet_id, user_guid, order_status,
|
||||
// request.PageIndex, request.PageSize, request.SortOrder,
|
||||
// cancellationToken);
|
||||
// var mapped_orders = orders.Select(x => new ExchangeOrder
|
||||
// {
|
||||
// OrderId = x.OrderId,
|
||||
// SapphireAmount = x.SapphireReducedDelta,
|
||||
// SapphireReduceAmount = x.SapphireReducedDelta,
|
||||
// EmeraldAmount = x.PlanetMoneyIncDelta,
|
||||
// CreatedAt = x.CreatedAt,
|
||||
// CompletedAt = x.CompletedAt,
|
||||
// Status = x.OrderStatus
|
||||
// });
|
||||
// return Ok(new UserExchangeOrderListResponse { Orders = mapped_orders });
|
||||
// }
|
||||
// }
|
||||
Reference in New Issue
Block a user