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>
<ProjectReference Include="..\InterfaceForward.Application\InterfaceForward.Application.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.Console" Version="5.0.1" />
<PackageReference Include="Serilog.Sinks.Console" Version="5.1.0-dev-00943" />
</ItemGroup>
</Project>

View File

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

View File

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

View File

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

View File

@ -20,7 +20,7 @@
<PackageReference Include="FreeRedis" Version="1.2.15" />
<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>
</Project>

View File

@ -305,8 +305,7 @@ public class AppsService : ApplicationService
/// <summary>
/// 生成单个随机数字
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public int CreateNum()
private int CreateNum()
{
Random random = new Random();
int num = random.Next(10);
@ -316,8 +315,7 @@ public class AppsService : ApplicationService
/// <summary>
/// 生成单个大写随机字母
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public string CreateBigAbc()
private string CreateBigAbc()
{
//A-Z的 ASCII值为65-90
Random random = new Random();
@ -329,8 +327,7 @@ public class AppsService : ApplicationService
/// <summary>
/// 生成单个小写随机字母
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public string CreateSmallAbc()
private string CreateSmallAbc()
{
//a-z的 ASCII值为97-122
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 InterfaceForward.Application.Contracts.Dtos.ServiceProvider;
using InterfaceForward.Application.Helpers;
using InterfaceForward.Domain.Shared.Dtos;
using InterfaceForward.Domain.Shared.Enum;
using InterfaceForward.Repositories.ServiceProvider.Entitys;
using InterfaceForward.Repositories.ServiceProvider.Services;
@ -192,12 +191,12 @@ public class ServiceProviderAccountService : ApplicationService
/// <param name="pageSize">页大小</param>
/// <returns></returns>
[HttpGet("ServiceProviderAccount/GetAccountPageList")]
public async Task<PagedListDto<Dictionary<string, object>>> GetAccountPageListAsync(
public async Task<PagedListDto<Dictionary<string, object?>>> GetAccountPageListAsync(
[Required] int serviceProviderId
, int pageIndex = 1
, int pageSize = 50)
{
var res = new PagedListDto<Dictionary<string, object>>();
var res = new PagedListDto<Dictionary<string, object?>>();
// 获取账户列表分页数据
var data = await _serviceProviderAccountRepository.GetAccountPageListAsync(serviceProviderId, pageIndex,
@ -215,9 +214,9 @@ public class ServiceProviderAccountService : ApplicationService
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)

View File

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

View File

@ -11,7 +11,7 @@ public interface IBasicRepository<T>
/// </summary>
/// <param name="whereExpression"></param>
/// <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);

View File

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

View File

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