You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.0 KiB
C#

9 months ago
using HttpClientStudy.Service;
using Microsoft.AspNetCore.Http;
9 months ago
using Microsoft.AspNetCore.Mvc;
namespace HttpClientStudy.WebApp.Controllers
{
/// <summary>
/// 普通(简单) 控制器
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class NormalController : ControllerBase
{
private ILogger<SimpleController> _logger;
9 months ago
private AccountService _accountService;
9 months ago
/// <summary>
/// 构造
/// </summary>
9 months ago
public NormalController(ILogger<SimpleController> logger, AccountService accountService)
9 months ago
{
_logger = logger;
9 months ago
_accountService = accountService;
9 months ago
}
/// <summary>
/// 获取账号
/// </summary>
/// <returns></returns>
[HttpGet]
9 months ago
public IActionResult GetAllAccounts()
9 months ago
{
9 months ago
var accounts = _accountService.GetAllAccounts();
var reslut = BaseResultUtil.Success(accounts);
9 months ago
return Ok(reslut);
}
}
}