This commit is contained in:
xiaolipro 2024-05-16 18:09:51 +08:00
parent 65cae5e177
commit 54f42ddb73
12 changed files with 22 additions and 36 deletions

View File

@ -16,11 +16,11 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\InterfaceForward.Application\InterfaceForward.Application.csproj" /> <ProjectReference Include="..\InterfaceForward.Application\InterfaceForward.Application.csproj" />
<ProjectReference Include="..\InterfaceForward.ServiceDefaults\InterfaceForward.ServiceDefaults.csproj"/> <ProjectReference Include="..\InterfaceForward.ServiceDefaults\InterfaceForward.ServiceDefaults.csproj"/>
<PackageReference Include="Fake.Autofac" Version="8.0.0-preview5" /> <PackageReference Include="Fake.Autofac" Version="8.0.0-preview6" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" /> <PackageReference Include="Serilog.AspNetCore" Version="8.0.2-dev-00338" />
<PackageReference Include="Serilog.Sinks.Elasticsearch" Version="10.0.0" /> <PackageReference Include="Serilog.Sinks.Elasticsearch" Version="10.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" /> <PackageReference Include="Serilog.Sinks.Console" Version="5.1.0-dev-00943" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -54,6 +54,8 @@ public class InterfaceForwardApiModule : FakeModule
{ {
var app = context.GetWebApplication(); var app = context.GetWebApplication();
app.MapControllers();
// Add Aspire default endpoints. // Add Aspire default endpoints.
app.MapDefaultEndpoints(); app.MapDefaultEndpoints();

View File

@ -13,6 +13,7 @@
"commandName": "Project", "commandName": "Project",
"dotnetRunMessages": true, "dotnetRunMessages": true,
"launchBrowser": true, "launchBrowser": true,
"launchUrl": "swagger/index.html",
"applicationUrl": "http://localhost:5145", "applicationUrl": "http://localhost:5145",
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Development"

View File

@ -1,5 +1,6 @@
// Global using directives // Global using directives
global using Fake; global using Fake;
global using Fake.DomainDrivenDesign.Application;
global using Fake.DomainDrivenDesign.Application.Dtos; global using Fake.DomainDrivenDesign.Application.Dtos;
global using InterfaceForward.Domain.Shared.Helpers; global using InterfaceForward.Domain.Shared.Helpers;

View File

@ -20,7 +20,7 @@
<PackageReference Include="FreeRedis" Version="1.2.15" /> <PackageReference Include="FreeRedis" Version="1.2.15" />
<PackageReference Include="Fake.AspNetCore.Mvc" Version="8.0.0-preview5" /> <PackageReference Include="Fake.AspNetCore.Mvc" Version="8.0.0-preview5" />
<PackageReference Include="Fake.ObjectMapping.AutoMapper" Version="8.0.0-preview5" /> <PackageReference Include="Fake.ObjectMapping.AutoMapper" Version="8.0.0-preview6" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -305,8 +305,7 @@ public class AppsService : ApplicationService
/// <summary> /// <summary>
/// 生成单个随机数字 /// 生成单个随机数字
/// </summary> /// </summary>
[ApiExplorerSettings(IgnoreApi = true)] private int CreateNum()
public int CreateNum()
{ {
Random random = new Random(); Random random = new Random();
int num = random.Next(10); int num = random.Next(10);
@ -316,8 +315,7 @@ public class AppsService : ApplicationService
/// <summary> /// <summary>
/// 生成单个大写随机字母 /// 生成单个大写随机字母
/// </summary> /// </summary>
[ApiExplorerSettings(IgnoreApi = true)] private string CreateBigAbc()
public string CreateBigAbc()
{ {
//A-Z的 ASCII值为65-90 //A-Z的 ASCII值为65-90
Random random = new Random(); Random random = new Random();
@ -329,8 +327,7 @@ public class AppsService : ApplicationService
/// <summary> /// <summary>
/// 生成单个小写随机字母 /// 生成单个小写随机字母
/// </summary> /// </summary>
[ApiExplorerSettings(IgnoreApi = true)] private string CreateSmallAbc()
public string CreateSmallAbc()
{ {
//a-z的 ASCII值为97-122 //a-z的 ASCII值为97-122
Random random = new Random(); Random random = new Random();

View File

@ -1,14 +0,0 @@
using Fake.DependencyInjection;
using Fake.ObjectMapping;
using Microsoft.Extensions.DependencyInjection;
namespace InterfaceForward.Application.Services;
public class ApplicationService:IRemoteService
{
public ILazyServiceProvider LazyServiceProvider { get; set; } = default!;
protected IObjectMapper ObjectMapper => LazyServiceProvider.GetService<IObjectMapper>(provider =>
provider.GetRequiredService<IObjectMapper>())!;
}

View File

@ -2,7 +2,6 @@
using System.Diagnostics; using System.Diagnostics;
using InterfaceForward.Application.Contracts.Dtos.ServiceProvider; using InterfaceForward.Application.Contracts.Dtos.ServiceProvider;
using InterfaceForward.Application.Helpers; using InterfaceForward.Application.Helpers;
using InterfaceForward.Domain.Shared.Dtos;
using InterfaceForward.Domain.Shared.Enum; using InterfaceForward.Domain.Shared.Enum;
using InterfaceForward.Repositories.ServiceProvider.Entitys; using InterfaceForward.Repositories.ServiceProvider.Entitys;
using InterfaceForward.Repositories.ServiceProvider.Services; using InterfaceForward.Repositories.ServiceProvider.Services;
@ -192,12 +191,12 @@ public class ServiceProviderAccountService : ApplicationService
/// <param name="pageSize">页大小</param> /// <param name="pageSize">页大小</param>
/// <returns></returns> /// <returns></returns>
[HttpGet("ServiceProviderAccount/GetAccountPageList")] [HttpGet("ServiceProviderAccount/GetAccountPageList")]
public async Task<PagedListDto<Dictionary<string, object>>> GetAccountPageListAsync( public async Task<PagedListDto<Dictionary<string, object?>>> GetAccountPageListAsync(
[Required] int serviceProviderId [Required] int serviceProviderId
, int pageIndex = 1 , int pageIndex = 1
, int pageSize = 50) , int pageSize = 50)
{ {
var res = new PagedListDto<Dictionary<string, object>>(); var res = new PagedListDto<Dictionary<string, object?>>();
// 获取账户列表分页数据 // 获取账户列表分页数据
var data = await _serviceProviderAccountRepository.GetAccountPageListAsync(serviceProviderId, pageIndex, var data = await _serviceProviderAccountRepository.GetAccountPageListAsync(serviceProviderId, pageIndex,
@ -215,9 +214,9 @@ public class ServiceProviderAccountService : ApplicationService
foreach (var item in data.Items) foreach (var item in data.Items)
{ {
// 一行数据 // 一行数据
var dic = new Dictionary<string, object>(); var dic = new Dictionary<string, object?>();
object updateTime = null; object? updateTime = null;
// 固定部分 // 固定部分
foreach (var propertyInfo in properties) foreach (var propertyInfo in properties)

View File

@ -5,12 +5,12 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.2"/> <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Serilog" Version="3.1.1"/> <PackageReference Include="Serilog" Version="4.0.0-dev-02167" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Fake.DomainDrivenDesign" Version="8.0.0-preview5" /> <PackageReference Include="Fake.DomainDrivenDesign" Version="8.0.0-preview6" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -11,7 +11,7 @@ public interface IBasicRepository<T>
/// </summary> /// </summary>
/// <param name="whereExpression"></param> /// <param name="whereExpression"></param>
/// <returns></returns> /// <returns></returns>
Task<T> GetFirstAsync(Expression<Func<T, bool>> whereExpression); Task<T?> GetFirstAsync(Expression<Func<T, bool>> whereExpression);
Task<TResult> GetFirstAsync<TResult>(Expression<Func<T, bool>> whereExpression,Expression<Func<T, TResult>> resultExpression); Task<TResult> GetFirstAsync<TResult>(Expression<Func<T, bool>> whereExpression,Expression<Func<T, TResult>> resultExpression);

View File

@ -7,8 +7,8 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Fake.DomainDrivenDesign" Version="8.0.0-preview5" /> <PackageReference Include="Fake.DomainDrivenDesign" Version="8.0.0-preview6" />
<PackageReference Include="Fake.SqlSugarCore" Version="8.0.0-preview5" /> <PackageReference Include="Fake.SqlSugarCore" Version="8.0.0-preview6" />
<PackageReference Include="NEST" Version="7.17.5" /> <PackageReference Include="NEST" Version="7.17.5" />
</ItemGroup> </ItemGroup>

View File

@ -15,5 +15,5 @@ public class ServiceProviderAccountFieldPageValueObject
/// <summary> /// <summary>
/// 字段值 /// 字段值
/// </summary> /// </summary>
public string FieldValue { get; set; } public string? FieldValue { get; set; }
} }