From 01a749d78a3f06d9b3f3bd58ef496fe4b195e353 Mon Sep 17 00:00:00 2001 From: xuxiaoqian <992789614@qq.com> Date: Sat, 6 Jun 2020 14:08:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=90=E6=99=93=E5=80=A9=E7=9A=84=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E6=AC=A1=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WebApi0001.sln" | 25 ++++++ .../WebApi0001/Controllers/TestController.cs" | 30 +++++++ .../Controllers/WeatherForecastController.cs" | 55 ++++++++++++ .../WebApi0001/Domain/Admin3200DbContext.cs" | 31 +++++++ .../WebApi0001/Domain/DbIntializer.cs" | 51 +++++++++++ .../WebApi0001/Domain/Entity/BaseEntity.cs" | 39 ++++++++ .../WebApi0001/Domain/Entity/Roles.cs" | 15 ++++ .../WebApi0001/Domain/Entity/Users.cs" | 22 +++++ .../WebApi0001/Helper/JsonHelper.cs" | 20 +++++ .../Implementation/EfRespository.cs" | 88 +++++++++++++++++++ .../WebApi0001/Interface/IRespository.cs" | 30 +++++++ .../WebApi0001/Program.cs" | 26 ++++++ .../Properties/launchSettings.json" | 30 +++++++ .../WebApi0001/Startup.cs" | 58 ++++++++++++ .../WebApi0001/WeatherForecast.cs" | 15 ++++ .../WebApi0001/WebApi0001.csproj" | 14 +++ .../WebApi0001/WebApi0001.sln" | 25 ++++++ .../WebApi0001/appsettings.Development.json" | 9 ++ .../WebApi0001/appsettings.json" | 10 +++ 19 files changed, 593 insertions(+) create mode 100644 "\345\276\220\346\231\223\345\200\251/WebApi0001.sln" create mode 100644 "\345\276\220\346\231\223\345\200\251/WebApi0001/Controllers/TestController.cs" create mode 100644 "\345\276\220\346\231\223\345\200\251/WebApi0001/Controllers/WeatherForecastController.cs" create mode 100644 "\345\276\220\346\231\223\345\200\251/WebApi0001/Domain/Admin3200DbContext.cs" create mode 100644 "\345\276\220\346\231\223\345\200\251/WebApi0001/Domain/DbIntializer.cs" create mode 100644 "\345\276\220\346\231\223\345\200\251/WebApi0001/Domain/Entity/BaseEntity.cs" create mode 100644 "\345\276\220\346\231\223\345\200\251/WebApi0001/Domain/Entity/Roles.cs" create mode 100644 "\345\276\220\346\231\223\345\200\251/WebApi0001/Domain/Entity/Users.cs" create mode 100644 "\345\276\220\346\231\223\345\200\251/WebApi0001/Helper/JsonHelper.cs" create mode 100644 "\345\276\220\346\231\223\345\200\251/WebApi0001/Implementation/EfRespository.cs" create mode 100644 "\345\276\220\346\231\223\345\200\251/WebApi0001/Interface/IRespository.cs" create mode 100644 "\345\276\220\346\231\223\345\200\251/WebApi0001/Program.cs" create mode 100644 "\345\276\220\346\231\223\345\200\251/WebApi0001/Properties/launchSettings.json" create mode 100644 "\345\276\220\346\231\223\345\200\251/WebApi0001/Startup.cs" create mode 100644 "\345\276\220\346\231\223\345\200\251/WebApi0001/WeatherForecast.cs" create mode 100644 "\345\276\220\346\231\223\345\200\251/WebApi0001/WebApi0001.csproj" create mode 100644 "\345\276\220\346\231\223\345\200\251/WebApi0001/WebApi0001.sln" create mode 100644 "\345\276\220\346\231\223\345\200\251/WebApi0001/appsettings.Development.json" create mode 100644 "\345\276\220\346\231\223\345\200\251/WebApi0001/appsettings.json" diff --git "a/\345\276\220\346\231\223\345\200\251/WebApi0001.sln" "b/\345\276\220\346\231\223\345\200\251/WebApi0001.sln" new file mode 100644 index 0000000..1ed6763 --- /dev/null +++ "b/\345\276\220\346\231\223\345\200\251/WebApi0001.sln" @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApi0001", "WebApi0001\WebApi0001.csproj", "{0903B2F4-A818-4AC8-819B-334547683B74}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0903B2F4-A818-4AC8-819B-334547683B74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0903B2F4-A818-4AC8-819B-334547683B74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0903B2F4-A818-4AC8-819B-334547683B74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0903B2F4-A818-4AC8-819B-334547683B74}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {46E06DD6-7B84-4C71-942A-FBF10FC5B006} + EndGlobalSection +EndGlobal diff --git "a/\345\276\220\346\231\223\345\200\251/WebApi0001/Controllers/TestController.cs" "b/\345\276\220\346\231\223\345\200\251/WebApi0001/Controllers/TestController.cs" new file mode 100644 index 0000000..176057a --- /dev/null +++ "b/\345\276\220\346\231\223\345\200\251/WebApi0001/Controllers/TestController.cs" @@ -0,0 +1,30 @@ +using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using WebApi0001.Domain.Entity; +using WebApi0001.Helper; +using WebApi0001.Interface; + +namespace WebApi0001.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class TestController :ControllerBase + { + + private readonly IRespository _userReapositoty; + + public TestController(IRespository userRespository) + { + _userReapositoty = userRespository; + } + + public string Get() + { + var list = _userReapositoty.Table.ToList(); + return JsonHelper.SerializeObject(list); + } + } +} diff --git "a/\345\276\220\346\231\223\345\200\251/WebApi0001/Controllers/WeatherForecastController.cs" "b/\345\276\220\346\231\223\345\200\251/WebApi0001/Controllers/WeatherForecastController.cs" new file mode 100644 index 0000000..13921f0 --- /dev/null +++ "b/\345\276\220\346\231\223\345\200\251/WebApi0001/Controllers/WeatherForecastController.cs" @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; +using WebApi0001.Domain; +using WebApi0001.Helper; +using WebApi0001.Domain.Entity; + +namespace WebApi0001.Controllers +{ + [ApiController] + [Route("[controller]")] + public class WeatherForecastController : ControllerBase + { + + private readonly Admin3200DbContext _db; + + private static readonly string[] Summaries = new[] + { + "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" + }; + + private readonly ILogger _logger; + + public WeatherForecastController(ILogger logger,Admin3200DbContext dbContext) + { + _logger = logger; + _db = dbContext; + } + + [HttpGet] + public string Get() + { + //var rng = new Random(); + //return Enumerable.Range(1, 5).Select(index => new WeatherForecast + //{ + // Date = DateTime.Now.AddDays(index), + // TemperatureC = rng.Next(-20, 55), + // Summary = Summaries[rng.Next(Summaries.Length)] + //}) + //.ToArray(); + + + //使数据排列整齐, + var res = _db.Users.Include(x => x.Roles).ToList(); + + return JsonHelper.SerializeObject(res); + + + } + } +} diff --git "a/\345\276\220\346\231\223\345\200\251/WebApi0001/Domain/Admin3200DbContext.cs" "b/\345\276\220\346\231\223\345\200\251/WebApi0001/Domain/Admin3200DbContext.cs" new file mode 100644 index 0000000..d110771 --- /dev/null +++ "b/\345\276\220\346\231\223\345\200\251/WebApi0001/Domain/Admin3200DbContext.cs" @@ -0,0 +1,31 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using WebApi0001.Domain.Entity; + +namespace WebApi0001.Domain +{ + public class Admin3200DbContext :DbContext + { + public Admin3200DbContext() + { + + } + + + //重新配置 + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + var connectionString = "server=.;database=Admin3200;uid=sa;pwd=123456"; + optionsBuilder.UseSqlServer(connectionString); + + } + + public DbSet Users { get; set; } + + public DbSet Roles { get; set; } + + } +} diff --git "a/\345\276\220\346\231\223\345\200\251/WebApi0001/Domain/DbIntializer.cs" "b/\345\276\220\346\231\223\345\200\251/WebApi0001/Domain/DbIntializer.cs" new file mode 100644 index 0000000..1d5b22e --- /dev/null +++ "b/\345\276\220\346\231\223\345\200\251/WebApi0001/Domain/DbIntializer.cs" @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using WebApi0001.Domain.Entity; + +namespace WebApi0001.Domain +{ + public class DbIntializer + { + public static void Seed() + { + using var db = new Admin3200DbContext(); + db.Database.EnsureCreated(); + + var hasUser = db.Users.Any(); + + if (!hasUser) + { + var role = new Roles + { + RoleName = "饲养员", + Description = "这是一个爱的饲养员" + + }; + db.Roles.Add(role); + db.SaveChanges(); + + db.Users.AddRange(new Users[] + { + new Users + { + UserName = "饲养员1号", + PassWord="admin", + RolesId=role.Id + }, + new Users + { + UserName = "饲养员2号", + PassWord="111111", + RolesId=role.Id + + } + + }) ; + + db.SaveChanges(); + } + } + } +} diff --git "a/\345\276\220\346\231\223\345\200\251/WebApi0001/Domain/Entity/BaseEntity.cs" "b/\345\276\220\346\231\223\345\200\251/WebApi0001/Domain/Entity/BaseEntity.cs" new file mode 100644 index 0000000..fd2e874 --- /dev/null +++ "b/\345\276\220\346\231\223\345\200\251/WebApi0001/Domain/Entity/BaseEntity.cs" @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace WebApi001.Domain +{ + public abstract class BaseEntity + { + + public BaseEntity() + { + IsActived = true; + IsDeleted = false; + + CreatedTime = DateTime.Now; + UpdateTime = DateTime.Now; + } + + public int Id { get; set; } + + public bool IsActived { get; set; } + + public bool IsDeleted { get; set; } + + + public DateTime CreatedTime { get; set; } + + public DateTime UpdateTime { get; set; } + + public int DispalyOrder { get; set; } + + + /// + ///简介 + /// + public string Remarks { get; set; } + } +} diff --git "a/\345\276\220\346\231\223\345\200\251/WebApi0001/Domain/Entity/Roles.cs" "b/\345\276\220\346\231\223\345\200\251/WebApi0001/Domain/Entity/Roles.cs" new file mode 100644 index 0000000..516a6e7 --- /dev/null +++ "b/\345\276\220\346\231\223\345\200\251/WebApi0001/Domain/Entity/Roles.cs" @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using WebApi001.Domain; + +namespace WebApi0001.Domain.Entity +{ + public class Roles :BaseEntity + { + + public string RoleName { get; set; } + + public string Description { set; get; } + + public IEnumerable Users { get; set; } + } +} \ No newline at end of file diff --git "a/\345\276\220\346\231\223\345\200\251/WebApi0001/Domain/Entity/Users.cs" "b/\345\276\220\346\231\223\345\200\251/WebApi0001/Domain/Entity/Users.cs" new file mode 100644 index 0000000..a85b00c --- /dev/null +++ "b/\345\276\220\346\231\223\345\200\251/WebApi0001/Domain/Entity/Users.cs" @@ -0,0 +1,22 @@ +using Microsoft.AspNetCore.Authorization.Infrastructure; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using WebApi001.Domain; + +namespace WebApi0001.Domain.Entity +{ + public class Users :BaseEntity + { + + public string UserName { get; set; } + + public string PassWord { get; set; } + + public int RolesId { get; set; } + public Roles Roles { get; set; } + + + } +} diff --git "a/\345\276\220\346\231\223\345\200\251/WebApi0001/Helper/JsonHelper.cs" "b/\345\276\220\346\231\223\345\200\251/WebApi0001/Helper/JsonHelper.cs" new file mode 100644 index 0000000..ad793c3 --- /dev/null +++ "b/\345\276\220\346\231\223\345\200\251/WebApi0001/Helper/JsonHelper.cs" @@ -0,0 +1,20 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace WebApi0001.Helper +{ + public class JsonHelper + { + public static string SerializeObject(object obj) + { + return JsonConvert.SerializeObject(obj, Formatting.Indented, new JsonSerializerSettings + { + ReferenceLoopHandling = ReferenceLoopHandling.Ignore, + DateFormatString = "yyyy-MM-dd HH:mm:ss"//改变了时间显示的样子 + }); + } + } +} diff --git "a/\345\276\220\346\231\223\345\200\251/WebApi0001/Implementation/EfRespository.cs" "b/\345\276\220\346\231\223\345\200\251/WebApi0001/Implementation/EfRespository.cs" new file mode 100644 index 0000000..19a775e --- /dev/null +++ "b/\345\276\220\346\231\223\345\200\251/WebApi0001/Implementation/EfRespository.cs" @@ -0,0 +1,88 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using WebApi0001.Domain; +using WebApi0001.Interface; +using WebApi001.Domain; + +namespace WebApi0001.Implementation +{ + public class EfRespository : IRespository where T : BaseEntity//实现接口 + { + private readonly Admin3200DbContext db; + + private DbSet _entity; + + protected DbSet Entity + { + get + { + + if (_entity == null) + { + _entity = db.Set(); + } + + return _entity; + } + } + + public IQueryable Table + { + get + { + return Entity; + } + } + + public EfRespository(Admin3200DbContext dbContext) + { + db = dbContext; + } + + + public void Delete(T entity) + { + this._entity.Remove(entity); + + db.SaveChanges();//保存修改 + } + + public void Delete(int id) + { + var row = Table.Where(x => x.Id == id).FirstOrDefault(); + //调用上面的函数 + Delete(row); + } + + //public IEnumerable GetAllEntity() + //{ + // throw new NotImplementedException(); + //} + + public T GetById(int id) + { + return _entity.Where(x => x.Id == id).FirstOrDefault(); + } + + public void Insert(T entity) + { + _entity.Add(entity); + db.SaveChanges(); + } + + public void InsertBulk(IEnumerable list) + { + _entity.AddRange(list); + db.SaveChanges(); + } + + public void Update(T entity) + { + _entity.Update(entity); + db.SaveChanges(); + } + } +} \ No newline at end of file diff --git "a/\345\276\220\346\231\223\345\200\251/WebApi0001/Interface/IRespository.cs" "b/\345\276\220\346\231\223\345\200\251/WebApi0001/Interface/IRespository.cs" new file mode 100644 index 0000000..0fed1f8 --- /dev/null +++ "b/\345\276\220\346\231\223\345\200\251/WebApi0001/Interface/IRespository.cs" @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace WebApi0001.Interface +{ + public interface IRespository + { + IQueryable Table { get; } + + T GetById(int id); + + + //添加 + void Insert(T entity); + + void InsertBulk(IEnumerable list); + + + //更新,修改 + void Update(T entity); + + void Delete(T entity); + + + //根据Id删除 + void Delete(int id); + } +} diff --git "a/\345\276\220\346\231\223\345\200\251/WebApi0001/Program.cs" "b/\345\276\220\346\231\223\345\200\251/WebApi0001/Program.cs" new file mode 100644 index 0000000..6c80ec6 --- /dev/null +++ "b/\345\276\220\346\231\223\345\200\251/WebApi0001/Program.cs" @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; + +namespace WebApi0001 +{ + public class Program + { + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + } +} diff --git "a/\345\276\220\346\231\223\345\200\251/WebApi0001/Properties/launchSettings.json" "b/\345\276\220\346\231\223\345\200\251/WebApi0001/Properties/launchSettings.json" new file mode 100644 index 0000000..ee929ce --- /dev/null +++ "b/\345\276\220\346\231\223\345\200\251/WebApi0001/Properties/launchSettings.json" @@ -0,0 +1,30 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:64691", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "weatherforecast", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "WebApi0001": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "weatherforecast", + "applicationUrl": "http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git "a/\345\276\220\346\231\223\345\200\251/WebApi0001/Startup.cs" "b/\345\276\220\346\231\223\345\200\251/WebApi0001/Startup.cs" new file mode 100644 index 0000000..a2f89b3 --- /dev/null +++ "b/\345\276\220\346\231\223\345\200\251/WebApi0001/Startup.cs" @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; +using WebApi0001.Domain; +using WebApi0001.Implementation; +using WebApi0001.Interface; + +namespace WebApi0001 +{ + public class Startup + { + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } + + public IConfiguration Configuration { get; } + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + services.AddDbContext(); + services.AddScoped(typeof(IRespository<>), typeof(EfRespository<>)); + + services.AddControllers(); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.UseRouting(); + + app.UseAuthorization(); + + app.UseEndpoints(endpoints => + { + endpoints.MapControllers(); + }); + + + + DbIntializer.Seed(); + } + } +} diff --git "a/\345\276\220\346\231\223\345\200\251/WebApi0001/WeatherForecast.cs" "b/\345\276\220\346\231\223\345\200\251/WebApi0001/WeatherForecast.cs" new file mode 100644 index 0000000..facbd42 --- /dev/null +++ "b/\345\276\220\346\231\223\345\200\251/WebApi0001/WeatherForecast.cs" @@ -0,0 +1,15 @@ +using System; + +namespace WebApi0001 +{ + public class WeatherForecast + { + public DateTime Date { get; set; } + + public int TemperatureC { get; set; } + + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); + + public string Summary { get; set; } + } +} diff --git "a/\345\276\220\346\231\223\345\200\251/WebApi0001/WebApi0001.csproj" "b/\345\276\220\346\231\223\345\200\251/WebApi0001/WebApi0001.csproj" new file mode 100644 index 0000000..da10d50 --- /dev/null +++ "b/\345\276\220\346\231\223\345\200\251/WebApi0001/WebApi0001.csproj" @@ -0,0 +1,14 @@ + + + + netcoreapp3.1 + + + + + + + + + + diff --git "a/\345\276\220\346\231\223\345\200\251/WebApi0001/WebApi0001.sln" "b/\345\276\220\346\231\223\345\200\251/WebApi0001/WebApi0001.sln" new file mode 100644 index 0000000..1ed6763 --- /dev/null +++ "b/\345\276\220\346\231\223\345\200\251/WebApi0001/WebApi0001.sln" @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApi0001", "WebApi0001\WebApi0001.csproj", "{0903B2F4-A818-4AC8-819B-334547683B74}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0903B2F4-A818-4AC8-819B-334547683B74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0903B2F4-A818-4AC8-819B-334547683B74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0903B2F4-A818-4AC8-819B-334547683B74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0903B2F4-A818-4AC8-819B-334547683B74}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {46E06DD6-7B84-4C71-942A-FBF10FC5B006} + EndGlobalSection +EndGlobal diff --git "a/\345\276\220\346\231\223\345\200\251/WebApi0001/appsettings.Development.json" "b/\345\276\220\346\231\223\345\200\251/WebApi0001/appsettings.Development.json" new file mode 100644 index 0000000..8983e0f --- /dev/null +++ "b/\345\276\220\346\231\223\345\200\251/WebApi0001/appsettings.Development.json" @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + } +} diff --git "a/\345\276\220\346\231\223\345\200\251/WebApi0001/appsettings.json" "b/\345\276\220\346\231\223\345\200\251/WebApi0001/appsettings.json" new file mode 100644 index 0000000..d9d9a9b --- /dev/null +++ "b/\345\276\220\346\231\223\345\200\251/WebApi0001/appsettings.json" @@ -0,0 +1,10 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "AllowedHosts": "*" +} -- Gitee