main
wanggaofeng 1 year ago
parent f25a157e99
commit 103c3c8084

@ -0,0 +1,40 @@
using HttpClientStudy.Model;
namespace HttpClientStudy.Service
{
/// <summary>
/// 账号 服务类
/// </summary>
public class AccountService
{
public List<Account> GetAllAccounts()
{
List<Account> accounts = new List<Account>()
{
new Account() { Id=1, Name="管理员01", Password="123456", Role="Admin"},
new Account() { Id=2, Name="管理员02", Password="123456", Role="Admin"},
new Account() { Id=3, Name="管理员03", Password="123456", Role="Admin"},
new Account() { Id=4, Name="管理员04", Password="123456", Role="Admin"},
new Account() { Id=5, Name="管理员05", Password="123456", Role="Admin"},
new Account() { Id=6, Name="管理员06", Password="123456", Role="Admin"},
new Account() { Id=7, Name="管理员07", Password="123456", Role="Admin"},
new Account() { Id=8, Name="管理员08", Password="123456", Role="Admin"},
new Account() { Id=9, Name="管理员09", Password="123456", Role="Admin"},
new Account() { Id=10, Name="管理员10", Password="123456", Role="Admin"},
new Account() { Id=11, Name="开发01", Password="123456", Role="Dev"},
new Account() { Id=12, Name="管理员01", Password="123456", Role="Dev"},
new Account() { Id=13, Name="开发03", Password="123456", Role="Dev"},
new Account() { Id=14, Name="开发04", Password="123456", Role="Dev"},
new Account() { Id=15, Name="开发05", Password="123456", Role="Dev"},
new Account() { Id=16, Name="开发06", Password="123456", Role="Dev"},
new Account() { Id=17, Name="开发07", Password="123456", Role="Dev"},
new Account() { Id=18, Name="开发08", Password="123456", Role="Dev"},
new Account() { Id=19, Name="开发09", Password="123456", Role="Dev"},
new Account() { Id=20, Name="开发10", Password="123456", Role="Dev"},
};
return accounts;
}
}
}

@ -1,7 +0,0 @@
namespace HttpClientStudy.Service
{
public class Class1
{
}
}

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HttpClientStudy.UnitTest
{
/// <summary>
/// 基础HttpClient 测试
/// </summary>
public class NormalHttpClientTest
{
private readonly ITestOutputHelper _logger;
public NormalHttpClientTest(ITestOutputHelper outputHelper)
{
_logger = outputHelper;
}
[Fact]
public void Test()
{
}
}
}

@ -0,0 +1,34 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace HttpClientStudy.WebApp.Controllers
{
/// <summary>
/// 普通(简单) 控制器
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class NormalController : ControllerBase
{
private ILogger<SimpleController> _logger;
/// <summary>
/// 构造
/// </summary>
public NormalController(ILogger<SimpleController> logger)
{
_logger = logger;
}
/// <summary>
/// 获取账号
/// </summary>
/// <returns></returns>
[HttpGet]
public IActionResult GetAccount()
{
var reslut = BaseResultUtil.Success("操作成功");
return Ok(reslut);
}
}
}
Loading…
Cancel
Save