This commit is contained in:
2025-11-28 16:54:56 +09:00
parent 23176551b7
commit 8f18415f25
841 changed files with 67879 additions and 12265 deletions

View File

@@ -1,51 +0,0 @@
// using Microsoft.AspNetCore.Mvc;
//
// using Swashbuckle.AspNetCore.Annotations;
//
// using BrokerCore.ApiModels;
// using BrokerCore.Common;
//
// namespace BrokerApiServer.Controllers;
//
// using BrokerCore.Services;
//
// using Common;
//
// [Route("api/v1/account")]
// [ApiController, SwaggerTag("**PlanetUser 항목으로 이전 후 삭제 예정** (3월 말 예정)")]
// // 플래닛에서 b2b 유저 로그인하는 컨트롤러
// public class AccountController : PlanetAuthControllerBase
// {
// private readonly UserAuthService m_user_auth_service;
//
// public AccountController(UserAuthService userAuthService)
// {
// m_user_auth_service = userAuthService;
// }
//
// [SwaggerIgnore]
// [HttpPost, Route("login"), RequirePlanetAuth]
// [Produces("application/json")]
// [ProducesResponseType(typeof(LoginResponse), StatusCodes.Status200OK)]
// [ProducesResponseType(typeof(ApiErrorResponse), StatusCodes.Status400BadRequest)]
// [SwaggerOperation(Summary = "웹 포털 런처 토큰으로 칼리버스 유저 인증 처리 (삭제 예정 - 3월말 런칭에 불포함)",
// Description = "플래닛의 클라이언트 구동 시 항상 유저 인증 후 실행해야 함")]
// public async Task<IActionResult> login([FromBody] LoginRequest request)
// {
// Guard.Against.isNull(request, ServerErrorCode.InvalidRequest, "Request is empty");
// Guard.Against.isNullOrEmptyOrWhiteSpace(request.WebPortalToken, ServerErrorCode.InvalidRequest,
// "WebPortalToken does not exist");
//
// var result = await m_user_auth_service.authByWebPortalToken(request.WebPortalToken, this.PlanetId);
// Guard.Against.resultFail(result);
// return Ok(new LoginResponse { UserGuid = m_user_auth_service.UserGuid, Nickname = m_user_auth_service.Nickname, });
// }
//
// [SwaggerIgnore]
// [HttpPost, Route("dummy")]
// public async Task<IActionResult> dummy([FromBody] DummyRequest request)
// {
// await Task.CompletedTask;
// return Ok(new DummyResponse { Dummy = request.Dummy });
// }
// }

View File

@@ -1,13 +1,10 @@
using BrokerApiServer;
using BrokerApiCore;
using Microsoft.AspNetCore.Mvc;
using ServerBase;
using ServerCommon;
using Swashbuckle.AspNetCore.Annotations;
using BrokerApiCore;
namespace BrokerApiServer.Controllers;
[Route("api/v1/admin")]
[ApiController]
// 운영자만 접근 가능한 컨트롤러
@@ -118,4 +115,49 @@ public class AdminController : ControllerBase
});
return Ok(new PlanetItemExchangeOrderListResponse { Orders = order_dtos, TotalCount = total_count });
}
[HttpPost("planet_provider_create"), RequireAdminAuth]
[Produces("application/json")]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(AdminPlanetProviderInfoCreateResponse))]
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ApiErrorResponse))]
[SwaggerOperation(Summary = "서비스 제공자 생성 [Bearer 인증 필요]")]
public async Task<IActionResult> planetProviderCreate(AdminPlanetProviderInfoCreateRequest request)
{
await Task.CompletedTask;
return Ok(new { });
}
[HttpPost("planet_provider_delete"), RequireAdminAuth]
[Produces("application/json")]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(AdminPlanetProviderInfoDeleteResponse))]
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ApiErrorResponse))]
[SwaggerOperation(Summary = "서비스 제공자 삭제 [Bearer 인증 필요]")]
public async Task<IActionResult> planetProviderDelete(AdminPlanetProviderInfoDeleteRequest request)
{
await Task.CompletedTask;
return Ok(new { });
}
[HttpPost("planet_provider_get"), RequireAdminAuth]
[Produces("application/json")]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(AdminPlanetProviderInfoGetResponse))]
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ApiErrorResponse))]
[SwaggerOperation(Summary = "서비스 제공자 정보 조회 [Bearer 인증 필요]")]
public async Task<IActionResult> planetProviderRead(AdminPlanetProviderInfoGetRequest request)
{
await Task.CompletedTask;
return Ok(new { });
}
[HttpPost("planet_provider_update"), RequireAdminAuth]
[Produces("application/json")]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(AdminPlanetProviderInfoUpdateResponse))]
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ApiErrorResponse))]
[SwaggerOperation(Summary = "서비스 제공자 정보 수정 [Bearer 인증 필요]")]
public async Task<IActionResult> planetProviderUpdate(AdminPlanetProviderInfoUpdateRequest request)
{
await Task.CompletedTask;
return Ok(new { });
}
}

View File

@@ -1,166 +0,0 @@
// using Asp.Versioning;
//
// using BrokerCore.ApiModels;
// using BrokerCore.Common;
// using BrokerCore.Services;
// using BrokerCore.DbEntity;
//
// using Microsoft.AspNetCore.Mvc;
//
// using Swashbuckle.AspNetCore.Annotations;
//
// namespace BrokerApiServer.Controllers;
//
// using Common;
//
// [ApiVersion("1.0")]
// [Route("api/v1")]
// [ApiController, SwaggerTag("**PlanetUser 항목으로 이전 후 삭제 예정** (3월 말 예정)")]
// // 플래닛에서 b2b로 통신하는 컨트롤러
// public sealed class CurrencyController : PlanetAuthControllerBase
// {
// private readonly SapphireExchangeService m_exchange_service;
//
// public CurrencyController(
// SapphireExchangeService exchangeService)
// {
// m_exchange_service = exchangeService;
// }
//
// [SwaggerIgnore]
// [HttpPost("balance/sapphire"), RequirePlanetAuth]
// [Produces("application/json")]
// [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(SapphireResponse))]
// [ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ApiErrorResponse))]
// [SwaggerOperation(Summary = "사파이어 현재 수량 조회")]
// public async Task<IActionResult> getSapphireBalance(SapphireRequest request)
// {
// await m_exchange_service.authUser(request.UserGuid, this.PlanetId);
//
// var current_sapphire_amount = await m_exchange_service.getCurrentSapphire();
// return Ok(new SapphireResponse { Amount = current_sapphire_amount });
// }
//
// [SwaggerIgnore]
// [HttpPost("exchange/order/list"), RequirePlanetAuth]
// [Produces("application/json")]
// [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(ExchangeOrderListResponse))]
// [ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ApiErrorResponse))]
// [SwaggerOperation(Summary = "사파이어 교환 주문 목록 조회")]
// public async Task<IActionResult> getOrders(
// [SwaggerRequestBody] ExchangeOrderListRequest request,
// CancellationToken cancellationToken)
// {
// var planet_id = this.PlanetId;
// var user_guid = request.UserGuid;
// await m_exchange_service.authUser(user_guid, this.PlanetId);
//
// 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, "desc", 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 ExchangeOrderListResponse { Orders = mapped_orders });
// }
//
// // [HttpPost("exchange/order/list_for_user"), RequireUserJwtAuth]
// // [Produces("application/json")]
// // [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(ExchangeOrderListResponse))]
// // [ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ApiErrorResponse))]
// // [SwaggerOperation(Summary = "사파이어 교환 주문 목록 조회")]
// // public async Task<IActionResult> getOrdersForUser(
// // [SwaggerRequestBody] ExchangeOrderListRequest request,
// // CancellationToken cancellationToken)
// // {
// // var planet_id = this.PlanetId;
// // var user_guid = request.UserGuid;
// // await m_exchange_service.authUser(user_guid, planet_id);
// //
// // 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 ExchangeOrderListResponse { Orders = mapped_orders });
// // }
//
// [SwaggerIgnore]
// [HttpPost("exchange/order/create"), RequirePlanetAuth]
// [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(ExchangeOrderResponse))]
// [ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ApiErrorResponse))]
// [SwaggerOperation(Summary = "사파이어 교환 주문 체결 (사파이어 차감)")]
// public async Task<IActionResult> createOrder(
// ExchangeOrderRequest request,
// CancellationToken cancellationToken)
// {
// var user_guid = request.UserGuid;
// await m_exchange_service.authUser(user_guid, this.PlanetId);
// // 메타버스 클라이언트에서 정상적으로
// Guard.Against.isTrue(m_exchange_service.isUserLoggedIn(),
// ServerErrorCode.MetaverseClientOnConnected,
// "메타버스에 접속 중인 상태. 메타버스에서 정상적으로 로그아웃 한 후에 다시 시도 바람.");
//
// var (order, current_sapphire_balance) =
// await m_exchange_service.createOrder(this.PlanetId, this.PlanetServerType, request.Sapphire,
// request.Emerald);
//
// var response = new ExchangeOrderResponse
// {
// OrderId = order.OrderId,
// SapphireAmount = order.SapphireReducedDelta,
// EmeraldAmount = order.PlanetMoneyIncDelta,
// CurrentSapphireBalance = current_sapphire_balance,
// };
// return Ok(response);
// }
//
// [SwaggerIgnore]
// [HttpPost("exchange/order/complete"), RequirePlanetAuth]
// [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(ExchangeOrderCompleteResponse))]
// [ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ApiErrorResponse))]
// [SwaggerOperation(Summary = "사파이어 교환 완료 (완료된 이후에 에메랄드 지급")]
// public async Task<IActionResult> completeOrder(
// ExchangeOrderCompleteRequest request,
// CancellationToken cancellationToken)
// {
// await m_exchange_service.authUser(request.UserGuid, this.PlanetId);
//
// var order = await m_exchange_service.completeOrder(request.OrderId, cancellationToken);
// var response = new ExchangeOrderCompleteResponse
// {
// OrderId = order.OrderId,
// SapphireAmount = order.SapphireReducedDelta,
// EmeraldAmount = order.PlanetMoneyIncDelta,
// Status = order.OrderStatus,
// };
// return Ok(response);
// }
// }

View File

@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;
using BrokerApiCore;
using Microsoft.AspNetCore.Mvc;
using Swashbuckle.AspNetCore.Annotations;
using BrokerApiCore;
namespace BrokerApiServer.Controllers;

View File

@@ -1,9 +1,8 @@
using System.ComponentModel;
using BrokerApiCore;
using Microsoft.AspNetCore.Mvc;
using Swashbuckle.AspNetCore.Annotations;
using BrokerApiCore;
namespace BrokerApiServer;
[Route("api/v1/planet/user")]
@@ -34,6 +33,7 @@ public class PlanetUserController : PlanetAuthControllerBase
var result = await m_user_auth_service.authByWebPortalToken(request.WebPortalToken, this.PlanetId);
Guard.Against.resultFail(result);
return Ok(new LoginResponse
{
UserGuid = m_user_auth_service.UserGuid, Nickname = m_user_auth_service.Nickname,
@@ -54,21 +54,6 @@ public class PlanetUserController : PlanetAuthControllerBase
return Ok(new CurrencyBalanceResponse { CaliverseCurrencyType = request.CaliverseCurrencyType, Amount = current_sapphire_amount });
}
// [SwaggerIgnore]
// [HttpPost("sapphire"), RequirePlanetAuth]
// [Produces("application/json")]
// [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(CurrencyBalanceResponse))]
// [ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ApiErrorResponse))]
// [SwaggerOperation(Summary = "!! 삭제 예정 => 칼리버스 측 재화 현재 수량 조회로 대체 [Bearer 인증 필요]")]
// public async Task<IActionResult> getSapphireBalance(CurrencyBalanceRequest request)
// {
// var sso_account_id = string.Empty;
// await m_exchange_service.validateAndGetUser(sso_account_id, request.UserGuid, this.PlanetId);
//
// var current_sapphire_amount = await m_exchange_service.getCurrentSapphire();
// return Ok(new CurrencyBalanceResponse { Amount = current_sapphire_amount });
// }
[HttpPost("exchange/order/list"), RequirePlanetAuth]
[Produces("application/json")]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(PlanetItemExchangeOrderListResponse))]

View File

@@ -1,93 +0,0 @@
//
// 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 });
// }
// }