forked from AcaMate/AcaMate_API
64 lines
1.5 KiB
C#
64 lines
1.5 KiB
C#
|
|
using System.Text.Json;
|
|
using AcaMate.Common.Data;
|
|
using AcaMate.Common.Models;
|
|
using AcaMate.V1.Models;
|
|
using Microsoft.AspNetCore.Http.HttpResults;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace AcaMate.V1.Controllers;
|
|
|
|
[ApiController]
|
|
[Route("/api/v1/in/member")]
|
|
[ApiExplorerSettings(GroupName = "사업자 정보")]
|
|
public class MemberController: ControllerBase
|
|
{
|
|
private readonly AppDbContext _dbContext;
|
|
|
|
public MemberController(AppDbContext dbContext)
|
|
{
|
|
_dbContext = dbContext;
|
|
}
|
|
|
|
[HttpGet("business")]
|
|
public IActionResult GetBusinessData()
|
|
{
|
|
// return Ok("GOOD");
|
|
return Ok("DB 참조");
|
|
}
|
|
|
|
[HttpPost("academy")]
|
|
[CustomOperation("앱 버전 확인","앱 버전을 확인해서 업데이트 여부 판단", "시스템")]
|
|
public IActionResult ReadAcademyInfo([FromBody] RequestAcademy request)
|
|
{
|
|
if (request.bids == null || !request.bids.Any())
|
|
{
|
|
var response = DefaultResponse.InvalidInputError;
|
|
return Ok(response);
|
|
}
|
|
|
|
var academies = _dbContext
|
|
.Academy
|
|
.Where(a => request.bids.Contains(a.bid))
|
|
.Select(a => new AcademyName
|
|
{
|
|
bid = a.bid,
|
|
name = a.business_name
|
|
})
|
|
.ToList();
|
|
return Ok(academies);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// -- -- -- -- -- -- -- -- -- -- -- -- //
|
|
|
|
[HttpGet("/api/v1/out/member/business")]
|
|
public IActionResult SearchBusinessNo()
|
|
{
|
|
return Ok("외부 참조");
|
|
}
|
|
|
|
} |