feat: 数据库迁移

This commit is contained in:
橙子
2023-10-07 17:51:05 +08:00
parent ca5697fb9c
commit c271f3005a
68 changed files with 222 additions and 18 deletions

View File

@@ -554,6 +554,17 @@
</summary>
<returns></returns>
</member>
<member name="T:Yi.Framework.Module.WebFirstManager.Impl.WebFirstService">
<summary>
WebFirst
</summary>
</member>
<member name="M:Yi.Framework.Module.WebFirstManager.Impl.WebFirstService.GetTest2">
<summary>
测试
</summary>
<returns></returns>
</member>
<member name="M:Yi.Framework.Module.WebFirstManager.Impl.WebFirstService.PostWebBuildCodeAsync(System.Collections.Generic.List{System.Int64})">
<summary>
Web To Code

View File

@@ -0,0 +1,13 @@
using Yi.Framework.Infrastructure.Ddd.Services.Abstract;
using Yi.Furion.Core.App.Dtos.Trends;
namespace Yi.Furion.Application.App.Services
{
/// <summary>
/// Trends服务抽象
/// </summary>
public interface ITrendsService : ICrudAppService<TrendsGetOutputDto, TrendsGetListOutputDto, long, TrendsGetListInput, TrendsCreateInput, TrendsUpdateInputVo>
{
}
}

View File

@@ -0,0 +1,34 @@
using SqlSugar;
using Yi.Framework.Infrastructure.Ddd.Dtos;
using Yi.Framework.Infrastructure.Ddd.Services;
using Yi.Furion.Application.App.Services;
using Yi.Furion.Core.App.Dtos.Trends;
using Yi.Furion.Core.App.Entities;
namespace Yi.Furion.Application.App.Services.Impl
{
/// <summary>
/// Trends服务实现
/// </summary>
[ApiDescriptionSettings("App")]
public class TrendsService : CrudAppService<TrendsEntity, TrendsGetOutputDto, TrendsGetListOutputDto, long, TrendsGetListInput, TrendsCreateInput, TrendsUpdateInputVo>,
ITrendsService, IDynamicApiController, ITransient
{
/// <summary>
/// 多查
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public override async Task<PagedResultDto<TrendsGetListOutputDto>> GetListAsync(TrendsGetListInput input)
{
var entity = await MapToEntityAsync(input);
RefAsync<int> total = 0;
var entities = await _DbQueryable
.WhereIF(input.StartTime is not null && input.EndTime is not null, x => x.CreationTime >= input.StartTime && x.CreationTime <= input.EndTime)
.ToPageListAsync(input.PageNum, input.PageSize, total);
return new PagedResultDto<TrendsGetListOutputDto>(total, await MapToGetListOutputDtosAsync(entities));
}
}
}

View File

@@ -12,16 +12,16 @@ using Microsoft.Extensions.Options;
using Yi.Framework.Infrastructure.Extensions;
using Yi.Framework.Infrastructure.Helper;
namespace Yi.Furion.Application.Rbac.Services
namespace Yi.Furion.Application.Rbac.Services.Impl
{
[ApiDescriptionSettings("RBAC")]
public class MonitorServerService: IMonitorServerService,IDynamicApiController, ITransient
public class MonitorServerService : IMonitorServerService, IDynamicApiController, ITransient
{
private IWebHostEnvironment _hostEnvironment;
private IHttpContextAccessor _httpContextAccessor;
public MonitorServerService(IWebHostEnvironment hostEnvironment, IHttpContextAccessor httpContextAccessor)
{
this._hostEnvironment = hostEnvironment;
_hostEnvironment = hostEnvironment;
_httpContextAccessor = httpContextAccessor;
}
[HttpGet("info")]

View File

@@ -4,6 +4,23 @@
<name>Yi.Furion.Application</name>
</assembly>
<members>
<member name="T:Yi.Furion.Application.App.Services.Impl.TrendsService">
<summary>
Trends服务实现
</summary>
</member>
<member name="M:Yi.Furion.Application.App.Services.Impl.TrendsService.GetListAsync(Yi.Furion.Core.App.Dtos.Trends.TrendsGetListInput)">
<summary>
多查
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="T:Yi.Furion.Application.App.Services.ITrendsService">
<summary>
Trends服务抽象
</summary>
</member>
<member name="T:Yi.Furion.Application.Bbs.Domain.ForumManager">
<summary>
论坛模块的领域服务

View File

@@ -0,0 +1,14 @@
namespace Yi.Furion.Core.App.Dtos.Trends
{
/// <summary>
/// Trends输入创建对象
/// </summary>
public class TrendsCreateInput
{
public string Title { get; set; }
public string Content { get; set; }
public string? Remark { get; set; }
public List<long>? Images { get; set; }
}
}

View File

@@ -0,0 +1,12 @@
using Yi.Framework.Infrastructure.Ddd.Dtos;
namespace Yi.Furion.Core.App.Dtos.Trends
{
/// <summary>
/// 查询参数
/// </summary>
public class TrendsGetListInput : PagedAllResultRequestDto
{
}
}

View File

@@ -0,0 +1,20 @@
using Yi.Framework.Infrastructure.Ddd.Dtos.Abstract;
namespace Yi.Furion.Core.App.Dtos.Trends
{
public class TrendsGetListOutputDto : IEntityDto<long>
{
public long Id { get; set; }
public string Title { get; set; }
public string Content { get; set; }
public long UserId { get; set; }
public bool IsDeleted { get; set; }
public string? Remark { get; set; }
public List<long>? Images { get; set; }
public DateTime CreationTime { get; set; }
public long? CreatorId { get; set; }
public long? LastModifierId { get; set; }
public DateTime? LastModificationTime { get; set; }
}
}

View File

@@ -0,0 +1,21 @@
using Yi.Framework.Infrastructure.Ddd.Dtos.Abstract;
namespace Yi.Furion.Core.App.Dtos.Trends
{
public class TrendsGetOutputDto : IEntityDto<long>
{
public long Id { get; set; }
public string Title { get; set; }
public string Content { get; set; }
public long UserId { get; set; }
public bool IsDeleted { get; set; }
public string? Remark { get; set; }
public List<long>? Images { get; set; }
public DateTime CreationTime { get; set; }
public long? CreatorId { get; set; }
public long? LastModifierId { get; set; }
public DateTime? LastModificationTime { get; set; }
}
}

View File

@@ -0,0 +1,10 @@
namespace Yi.Furion.Core.App.Dtos.Trends
{
public class TrendsUpdateInputVo
{
public string? Title { get; set; }
public string? Content { get; set; }
public string? Remark { get; set; }
public List<long>? Images { get; set; }
}
}

View File

@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;
using Yi.Framework.Infrastructure.Data.Auditing;
using Yi.Framework.Infrastructure.Data.Entities;
using Yi.Framework.Infrastructure.Ddd.Entities;
using Yi.Framework.Infrastructure.Helper;
namespace Yi.Furion.Core.App.Entities
{
/// <summary>
/// 动态
/// </summary>
[SugarTable("Trends")]
public class TrendsEntity : AuditedObject, IEntity<long>, ISoftDelete
{
[SugarColumn(IsPrimaryKey = true)]
public long Id { get; set; }
public string Title { get; set; }
[SugarColumn(Length = 99999)]
public string Content { get; set; }
public bool IsDeleted { get; set; }
public string? Remark { get; set; }
[SugarColumn(IsJson = true, Length = 99999)]
public List<long> Images { get; set; }
}
}

View File

@@ -4,6 +4,21 @@
<name>Yi.Furion.Core</name>
</assembly>
<members>
<member name="T:Yi.Furion.Core.App.Dtos.Trends.TrendsCreateInput">
<summary>
Trends输入创建对象
</summary>
</member>
<member name="T:Yi.Furion.Core.App.Dtos.Trends.TrendsGetListInput">
<summary>
查询参数
</summary>
</member>
<member name="T:Yi.Furion.Core.App.Entities.TrendsEntity">
<summary>
动态
</summary>
</member>
<member name="T:Yi.Furion.Core.Bbs.Consts.ArticleConst">
<summary>
常量定义

View File

@@ -1,4 +1,5 @@
using System;
using System.Text;
using Furion;
using Furion.Schedule;
using Furion.TimeCrontab;
@@ -38,7 +39,7 @@ public class Startup : AppStartup
{
// 注册作业,并配置作业触发器
//options.AddJob<TestJob>(Triggers.Period(10000));
//options.AddJob<SystemDataJob>(Triggers.Period(10000));
//options.AddJob<SystemDataJob>(Triggers.Period(10000));
options.AddJob<SystemDataJob>(Triggers.Cron("0 0 0,12 ? * ?", CronStringFormat.WithSeconds)); // 表示每天凌晨与12点
});
services.AddFileLogging("log/application-{0:yyyy}-{0:MM}-{0:dd}.log", options =>
@@ -72,7 +73,19 @@ public class Startup : AppStartup
app.UseAuthorization();
app.UseInject(string.Empty);
}
private string ConverStr(string utf8mb3String)
{
// 将 utf8mb3String 转换为 UTF-8mb3 编码的字节数组
byte[] utf8mb3Bytes = Encoding.UTF8.GetBytes(utf8mb3String);
// 将 UTF-8mb3 编码的字节数组转换为 UTF-8mb4 编码的字节数组
byte[] utf8mb4Bytes = Encoding.Convert(Encoding.UTF8, new UTF8Encoding(true), utf8mb3Bytes);
// 将 UTF-8mb4 编码的字节数组转换为字符串
string utf8mb4String = Encoding.UTF8.GetString(utf8mb4Bytes);
return utf8mb4String;
}
}