[✨] 아카데미 정보 API 기능 추가
This commit is contained in:
parent
9cdb486785
commit
41c8d94001
|
@ -108,8 +108,8 @@ else
|
||||||
}
|
}
|
||||||
|
|
||||||
// 로컬 테스트 위한 부분
|
// 로컬 테스트 위한 부분
|
||||||
|
|
||||||
// app.UseHttpsRedirection();
|
// app.UseHttpsRedirection();
|
||||||
|
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
// app.MapControllers();
|
// app.MapControllers();
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using AcaMate.Common.Data;
|
using AcaMate.Common.Data;
|
||||||
using AcaMate.Common.Models;
|
using AcaMate.Common.Models;
|
||||||
|
using AcaMate.V1.Models;
|
||||||
using Microsoft.AspNetCore.Http.HttpResults;
|
using Microsoft.AspNetCore.Http.HttpResults;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
@ -13,6 +13,13 @@ namespace AcaMate.V1.Controllers;
|
||||||
[ApiExplorerSettings(GroupName = "사업자 정보")]
|
[ApiExplorerSettings(GroupName = "사업자 정보")]
|
||||||
public class MemberController: ControllerBase
|
public class MemberController: ControllerBase
|
||||||
{
|
{
|
||||||
|
private readonly AppDbContext _dbContext;
|
||||||
|
|
||||||
|
public MemberController(AppDbContext dbContext)
|
||||||
|
{
|
||||||
|
_dbContext = dbContext;
|
||||||
|
}
|
||||||
|
|
||||||
[HttpGet("business")]
|
[HttpGet("business")]
|
||||||
public IActionResult GetBusinessData()
|
public IActionResult GetBusinessData()
|
||||||
{
|
{
|
||||||
|
@ -20,10 +27,38 @@ public class MemberController: ControllerBase
|
||||||
return Ok("DB 참조");
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
[HttpGet("/v1/out/member/business")]
|
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()
|
public IActionResult SearchBusinessNo()
|
||||||
{
|
{
|
||||||
return Ok("외부 참조");
|
return Ok("외부 참조");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -9,10 +9,21 @@ public class Academy
|
||||||
[Key]
|
[Key]
|
||||||
public string bid { get; set; }
|
public string bid { get; set; }
|
||||||
public string business_name { get; set; }
|
public string business_name { get; set; }
|
||||||
public string business_ownder { get; set; }
|
public string business_owner { get; set; }
|
||||||
public string business_number { get; set; }
|
public string business_number { get; set; }
|
||||||
public DateTime business_date { get; set; }
|
public DateTime business_date { get; set; }
|
||||||
public string business_address { get; set; }
|
public string business_address { get; set; }
|
||||||
public string business_contact { get; set; }
|
public string business_contact { get; set; }
|
||||||
public string uid { get; set; }
|
public string uid { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AcademyName
|
||||||
|
{
|
||||||
|
public string bid { get; set; }
|
||||||
|
public string name { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class RequestAcademy
|
||||||
|
{
|
||||||
|
public List<string> bids { get; set; }
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user