添加项目文件。
This commit is contained in:
1 parent
6a017c9547
commit
58abbb5b4f
86 files changed
+8729
No files matched your search
@@ -0,0 +1,26 @@
|
||||
using Asp.Versioning;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using StoreHub.Framework.Commons;
|
||||
using StoreHub.KJDWebService.Services;
|
||||
|
||||
namespace StoreHub.KJDWebService.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[ApiVersion("1.0")]
|
||||
[Route("api/v{version:apiVersion}/[controller]/[action]")]
|
||||
public class Login : ControllerBase
|
||||
{
|
||||
private readonly DemoService _userService;
|
||||
|
||||
public Login(DemoService userService)
|
||||
{
|
||||
_userService = userService;
|
||||
}
|
||||
[HttpGet]
|
||||
public ApiResult<bool> Loinout()
|
||||
{
|
||||
_userService.Login();
|
||||
return ApiResult.Success(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"profiles": {
|
||||
"KJD_WebService": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "https://localhost:57509;http://localhost:57510"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using FreeSql;
|
||||
using MAX.Core.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using StoreHub.Framework.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StoreHub.Framework.Repositorys
|
||||
{
|
||||
|
||||
public class SqlRepository : IScopedDependency
|
||||
{
|
||||
public IAdo Ado { get; }
|
||||
public SqlRepository([FromKeyedServices("KJDDB")] IFreeSql fsql)
|
||||
{
|
||||
Ado = fsql.Ado;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using MAX.Core.DependencyInjection;
|
||||
using StoreHub.Framework.Repositorys;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StoreHub.KJDWebService.Services
|
||||
{
|
||||
public class DemoService : ITransientDependency
|
||||
{
|
||||
private readonly SqlRepository _sqlRepository;
|
||||
|
||||
public DemoService(SqlRepository sqlRepository)
|
||||
{
|
||||
_sqlRepository = sqlRepository;
|
||||
}
|
||||
public bool Test()
|
||||
{
|
||||
_sqlRepository.Ado.ExecuteDataTable("select * from user");
|
||||
return true;
|
||||
}
|
||||
public bool Test2()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using MAX.Core.DependencyInjection;
|
||||
using MAX.Core.Infrastructure;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StoreHub.KJDWebService
|
||||
{
|
||||
internal class Startup : MAX.Core.Infrastructure.IStartup
|
||||
{
|
||||
public int Priority => 0;
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Register(IServiceRegistrar registrar)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\StoreHub.Framework\StoreHub.Framework.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Models\" />
|
||||
<Folder Include="Dtos\" />
|
||||
<Folder Include="Commons\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in new issue
Block a user