开始业务模块
This commit is contained in:
@@ -73,7 +73,7 @@ namespace Yi.Framework.Auth.JwtBearer.Authentication
|
|||||||
AuthenticateResult result = AuthenticateResult.Fail("未发现授权令牌");
|
AuthenticateResult result = AuthenticateResult.Fail("未发现授权令牌");
|
||||||
_context.Request.Headers.TryGetValue("Authorization", out StringValues values);
|
_context.Request.Headers.TryGetValue("Authorization", out StringValues values);
|
||||||
string valStr = values.ToString();
|
string valStr = values.ToString();
|
||||||
if (!string.IsNullOrWhiteSpace(valStr))
|
if (!string.IsNullOrWhiteSpace(valStr) && valStr.Length>10)
|
||||||
{
|
{
|
||||||
var tokenHeader = valStr.Substring(0, 6);
|
var tokenHeader = valStr.Substring(0, 6);
|
||||||
if (tokenHeader == "Bearer")
|
if (tokenHeader == "Bearer")
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ namespace Yi.Framework.Autofac.Extensions
|
|||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
services.AddAutoMapper(profileList.ToArray());
|
services.AddAutoMapper(profileList.ToArray());
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,11 @@ namespace Yi.Framework.Core.Sqlsugar.Repositories
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<bool> UpdateIgnoreNullAsync(T updateObj)
|
||||||
|
{
|
||||||
|
return await _Db.Updateable(updateObj).IgnoreColumns(true).ExecuteCommandAsync() > 0;
|
||||||
|
}
|
||||||
|
|
||||||
public override async Task<bool> DeleteAsync(T deleteObj)
|
public override async Task<bool> DeleteAsync(T deleteObj)
|
||||||
{
|
{
|
||||||
//逻辑删除
|
//逻辑删除
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace Yi.Framework.Core.Exceptions
|
|||||||
IHasErrorDetails,
|
IHasErrorDetails,
|
||||||
IHasLogLevel
|
IHasLogLevel
|
||||||
{
|
{
|
||||||
public ResultCodeEnum Code { get; set; }
|
public int Code { get; set; }
|
||||||
|
|
||||||
public string? Details { get; set; }
|
public string? Details { get; set; }
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ namespace Yi.Framework.Core.Exceptions
|
|||||||
LogLevel logLevel = LogLevel.Warning)
|
LogLevel logLevel = LogLevel.Warning)
|
||||||
: base(message, innerException)
|
: base(message, innerException)
|
||||||
{
|
{
|
||||||
Code = code;
|
Code =(int) code;
|
||||||
Details = details;
|
Details = details;
|
||||||
LogLevel = logLevel;
|
LogLevel = logLevel;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,14 +14,14 @@ namespace Yi.Framework.Core.Exceptions
|
|||||||
IHasErrorDetails,
|
IHasErrorDetails,
|
||||||
IHasLogLevel
|
IHasLogLevel
|
||||||
{
|
{
|
||||||
public ResultCodeEnum Code { get; set; }
|
public int Code { get; set; }
|
||||||
|
|
||||||
public string? Details { get; set; }
|
public string? Details { get; set; }
|
||||||
|
|
||||||
public LogLevel LogLevel { get; set; }
|
public LogLevel LogLevel { get; set; }
|
||||||
|
|
||||||
public BusinessException(
|
public BusinessException(
|
||||||
ResultCodeEnum code = ResultCodeEnum.NotSuccess,
|
int code = (int)ResultCodeEnum.NotSuccess,
|
||||||
string? message = null,
|
string? message = null,
|
||||||
string? details = null,
|
string? details = null,
|
||||||
Exception? innerException = null,
|
Exception? innerException = null,
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ public static class ExceptionExtensions
|
|||||||
/// <param name="exception"></param>
|
/// <param name="exception"></param>
|
||||||
/// <param name="defaultLevel"></param>
|
/// <param name="defaultLevel"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static ResultCodeEnum GetLogErrorCode(this Exception exception, ResultCodeEnum defaultCode = ResultCodeEnum.NotSuccess)
|
public static int GetLogErrorCode(this Exception exception, ResultCodeEnum defaultCode = ResultCodeEnum.NotSuccess)
|
||||||
{
|
{
|
||||||
return (exception as IHasErrorCode)?.Code ?? defaultCode;
|
return (exception as IHasErrorCode)?.Code ?? (int)defaultCode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,6 @@ namespace Yi.Framework.Core.Exceptions
|
|||||||
{
|
{
|
||||||
internal interface IHasErrorCode
|
internal interface IHasErrorCode
|
||||||
{
|
{
|
||||||
ResultCodeEnum Code { get; }
|
int Code { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,8 +9,24 @@ using Yi.Framework.Core.Enums;
|
|||||||
|
|
||||||
namespace Yi.Framework.Core.Exceptions
|
namespace Yi.Framework.Core.Exceptions
|
||||||
{
|
{
|
||||||
public class UserFriendlyException: BusinessException
|
public class UserFriendlyException : BusinessException
|
||||||
{
|
{
|
||||||
|
public UserFriendlyException(
|
||||||
|
string message,
|
||||||
|
int code = (int)ResultCodeEnum.NotSuccess,
|
||||||
|
string? details = null,
|
||||||
|
Exception? innerException = null,
|
||||||
|
LogLevel logLevel = LogLevel.Warning)
|
||||||
|
: base(
|
||||||
|
code,
|
||||||
|
message,
|
||||||
|
details,
|
||||||
|
innerException,
|
||||||
|
logLevel)
|
||||||
|
{
|
||||||
|
Details = details;
|
||||||
|
}
|
||||||
|
|
||||||
public UserFriendlyException(
|
public UserFriendlyException(
|
||||||
string message,
|
string message,
|
||||||
ResultCodeEnum code = ResultCodeEnum.NotSuccess,
|
ResultCodeEnum code = ResultCodeEnum.NotSuccess,
|
||||||
@@ -18,7 +34,7 @@ namespace Yi.Framework.Core.Exceptions
|
|||||||
Exception? innerException = null,
|
Exception? innerException = null,
|
||||||
LogLevel logLevel = LogLevel.Warning)
|
LogLevel logLevel = LogLevel.Warning)
|
||||||
: base(
|
: base(
|
||||||
code,
|
(int)code,
|
||||||
message,
|
message,
|
||||||
details,
|
details,
|
||||||
innerException,
|
innerException,
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace Yi.Framework.Ddd.Entities
|
|||||||
[Serializable]
|
[Serializable]
|
||||||
public abstract class Entity<TKey> : Entity, IEntity<TKey>, IEntity
|
public abstract class Entity<TKey> : Entity, IEntity<TKey>, IEntity
|
||||||
{
|
{
|
||||||
public virtual TKey Id { get; protected set; }
|
public virtual TKey Id { get; set; }
|
||||||
|
|
||||||
protected Entity()
|
protected Entity()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,6 +18,6 @@ namespace Yi.Framework.Ddd.Entities
|
|||||||
//
|
//
|
||||||
// 摘要:
|
// 摘要:
|
||||||
// Unique identifier for this entity.
|
// Unique identifier for this entity.
|
||||||
TKey Id { get;}
|
TKey Id { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ namespace Yi.Framework.Ddd.Repositories
|
|||||||
Task<bool> UpdateAsync(T updateObj);
|
Task<bool> UpdateAsync(T updateObj);
|
||||||
Task<bool> UpdateRangeAsync(List<T> updateObjs);
|
Task<bool> UpdateRangeAsync(List<T> updateObjs);
|
||||||
Task<bool> UpdateAsync(Expression<Func<T, T>> columns, Expression<Func<T, bool>> whereExpression);
|
Task<bool> UpdateAsync(Expression<Func<T, T>> columns, Expression<Func<T, bool>> whereExpression);
|
||||||
|
Task<bool> UpdateIgnoreNullAsync(T updateObj);
|
||||||
|
|
||||||
//删除
|
//删除
|
||||||
Task<bool> DeleteAsync(T deleteObj);
|
Task<bool> DeleteAsync(T deleteObj);
|
||||||
|
|||||||
@@ -82,6 +82,12 @@ namespace Yi.Framework.Ddd.Services
|
|||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected virtual Task<TEntity> MapToEntityAsync(TUpdateInput updateInput)
|
||||||
|
{
|
||||||
|
var entity = _mapper.Map<TEntity>(updateInput);
|
||||||
|
return Task.FromResult(entity);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 增
|
/// 增
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -125,12 +131,14 @@ namespace Yi.Framework.Ddd.Services
|
|||||||
{
|
{
|
||||||
throw new ArgumentNullException(nameof(id));
|
throw new ArgumentNullException(nameof(id));
|
||||||
}
|
}
|
||||||
var entity = await _repository.GetByIdAsync(id);
|
|
||||||
|
var entity = await MapToEntityAsync(input);
|
||||||
|
entity.Id = id;
|
||||||
|
await _repository.UpdateIgnoreNullAsync(entity);
|
||||||
|
|
||||||
await MapToEntityAsync(input, entity);
|
var newEntity = await _repository.GetByIdAsync(id);
|
||||||
await _repository.UpdateAsync(entity);
|
|
||||||
|
|
||||||
return await MapToGetOutputDtoAsync(entity);
|
return await MapToGetOutputDtoAsync(newEntity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ where TEntityDto : IEntityDto<TKey>
|
|||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="ArgumentNullException"></exception>
|
/// <exception cref="ArgumentNullException"></exception>
|
||||||
public async Task<TGetOutputDto> GetAsync(TKey id)
|
public virtual async Task<TGetOutputDto> GetAsync(TKey id)
|
||||||
{
|
{
|
||||||
if (id is null)
|
if (id is null)
|
||||||
{
|
{
|
||||||
@@ -79,7 +79,7 @@ where TEntityDto : IEntityDto<TKey>
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<PagedResultDto<TGetListOutputDto>> GetListAsync(TGetListInput input)
|
public virtual async Task<PagedResultDto<TGetListOutputDto>> GetListAsync(TGetListInput input)
|
||||||
{
|
{
|
||||||
|
|
||||||
var totalCount = await _repository.CountAsync(_ => true);
|
var totalCount = await _repository.CountAsync(_ => true);
|
||||||
|
|||||||
@@ -7,10 +7,20 @@ TemplateFactory templateFactory = new();
|
|||||||
|
|
||||||
//选择需要生成的模板提供者
|
//选择需要生成的模板提供者
|
||||||
|
|
||||||
|
//string modelName = "GlobalSetting";
|
||||||
|
//string nameSpaces = "Yi.BBS";
|
||||||
|
//List<string> entityNames = new() { "Setting" };
|
||||||
|
|
||||||
|
//string modelName = "Exhibition";
|
||||||
|
//string nameSpaces = "Yi.BBS";
|
||||||
|
//List<string> entityNames = new() { "Banner" };
|
||||||
string modelName = "Forum";
|
string modelName = "Forum";
|
||||||
string nameSpaces = "Yi.BBS";
|
string nameSpaces = "Yi.BBS";
|
||||||
List<string> entityNames = new() { "Plate" };
|
List<string> entityNames = new() { "Plate" };
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach (var entityName in entityNames)
|
foreach (var entityName in entityNames)
|
||||||
{
|
{
|
||||||
templateFactory.CreateTemplateProviders((option) =>
|
templateFactory.CreateTemplateProviders((option) =>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace Yi.Framework.Template.Provider.Server
|
|||||||
{
|
{
|
||||||
public CreateInputVoTemplateProvider(string modelName, string entityName, string nameSpaces) : base(modelName, entityName, nameSpaces)
|
public CreateInputVoTemplateProvider(string modelName, string entityName, string nameSpaces) : base(modelName, entityName, nameSpaces)
|
||||||
{
|
{
|
||||||
BuildPath = $@"{TemplateConst.BuildRootPath}\{nameSpaces}.Application.Contracts\{TemplateConst.ModelName}\Dtos\{TemplateConst.EntityName}CreateInputVo.cs";
|
BuildPath = $@"{TemplateConst.BuildRootPath}\{nameSpaces}.Application.Contracts\{TemplateConst.ModelName}\Dtos\{TemplateConst.EntityName}\{TemplateConst.EntityName}CreateInputVo.cs";
|
||||||
TemplatePath = $@"..\..\..\Template\Server\CreateInputVoTemplate.txt";
|
TemplatePath = $@"..\..\..\Template\Server\CreateInputVoTemplate.txt";
|
||||||
EntityPath = $@"{TemplateConst.BuildEntityPath}\{nameSpaces}.Domain\{TemplateConst.ModelName}\Entities\{TemplateConst.EntityName}Entity.cs";
|
EntityPath = $@"{TemplateConst.BuildEntityPath}\{nameSpaces}.Domain\{TemplateConst.ModelName}\Entities\{TemplateConst.EntityName}Entity.cs";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace Yi.Framework.Template.Provider.Server
|
|||||||
{
|
{
|
||||||
public GetListInputVoTemplateProvider(string modelName, string entityName, string nameSpaces) : base(modelName, entityName, nameSpaces)
|
public GetListInputVoTemplateProvider(string modelName, string entityName, string nameSpaces) : base(modelName, entityName, nameSpaces)
|
||||||
{
|
{
|
||||||
BuildPath = $@"{TemplateConst.BuildRootPath}\{nameSpaces}.Application.Contracts\{TemplateConst.ModelName}\Dtos\{TemplateConst.EntityName}GetListInputVo.cs";
|
BuildPath = $@"{TemplateConst.BuildRootPath}\{nameSpaces}.Application.Contracts\{TemplateConst.ModelName}\Dtos\{TemplateConst.EntityName}\{TemplateConst.EntityName}GetListInputVo.cs";
|
||||||
TemplatePath = $@"..\..\..\Template\Server\GetListInputVoTemplate.txt";
|
TemplatePath = $@"..\..\..\Template\Server\GetListInputVoTemplate.txt";
|
||||||
EntityPath = $@"{TemplateConst.BuildEntityPath}\{nameSpaces}.Domain\{TemplateConst.ModelName}\Entities\{TemplateConst.EntityName}Entity.cs";
|
EntityPath = $@"{TemplateConst.BuildEntityPath}\{nameSpaces}.Domain\{TemplateConst.ModelName}\Entities\{TemplateConst.EntityName}Entity.cs";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace Yi.Framework.Template.Provider.Server
|
|||||||
{
|
{
|
||||||
public GetListOutputDtoTemplateProvider(string modelName, string entityName, string nameSpaces) : base(modelName, entityName, nameSpaces)
|
public GetListOutputDtoTemplateProvider(string modelName, string entityName, string nameSpaces) : base(modelName, entityName, nameSpaces)
|
||||||
{
|
{
|
||||||
BuildPath = $@"{TemplateConst.BuildRootPath}\{nameSpaces}.Application.Contracts\{TemplateConst.ModelName}\Dtos\{TemplateConst.EntityName}GetListOutputDto.cs";
|
BuildPath = $@"{TemplateConst.BuildRootPath}\{nameSpaces}.Application.Contracts\{TemplateConst.ModelName}\Dtos\{TemplateConst.EntityName}\{TemplateConst.EntityName}GetListOutputDto.cs";
|
||||||
TemplatePath = $@"..\..\..\Template\Server\GetListOutputDtoTemplate.txt";
|
TemplatePath = $@"..\..\..\Template\Server\GetListOutputDtoTemplate.txt";
|
||||||
EntityPath = $@"{TemplateConst.BuildEntityPath}\{nameSpaces}.Domain\{TemplateConst.ModelName}\Entities\{TemplateConst.EntityName}Entity.cs";
|
EntityPath = $@"{TemplateConst.BuildEntityPath}\{nameSpaces}.Domain\{TemplateConst.ModelName}\Entities\{TemplateConst.EntityName}Entity.cs";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace Yi.Framework.Template.Provider.Server
|
|||||||
{
|
{
|
||||||
public UpdateInputVoTemplateProvider(string modelName, string entityName, string nameSpaces) : base(modelName, entityName, nameSpaces)
|
public UpdateInputVoTemplateProvider(string modelName, string entityName, string nameSpaces) : base(modelName, entityName, nameSpaces)
|
||||||
{
|
{
|
||||||
BuildPath = $@"{TemplateConst.BuildRootPath}\{nameSpaces}.Application.Contracts\{TemplateConst.ModelName}\Dtos\{TemplateConst.EntityName}UpdateInputVo.cs";
|
BuildPath = $@"{TemplateConst.BuildRootPath}\{nameSpaces}.Application.Contracts\{TemplateConst.ModelName}\Dtos\{TemplateConst.EntityName}\{TemplateConst.EntityName}UpdateInputVo.cs";
|
||||||
TemplatePath = $@"..\..\..\Template\Server\UpdateInputVoTemplate.txt";
|
TemplatePath = $@"..\..\..\Template\Server\UpdateInputVoTemplate.txt";
|
||||||
EntityPath = $@"{TemplateConst.BuildEntityPath}\{nameSpaces}.Domain\{TemplateConst.ModelName}\Entities\{TemplateConst.EntityName}Entity.cs";
|
EntityPath = $@"{TemplateConst.BuildEntityPath}\{nameSpaces}.Domain\{TemplateConst.ModelName}\Entities\{TemplateConst.EntityName}Entity.cs";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ using Yi.Framework.Ddd.Services.Abstract;
|
|||||||
namespace #NameSpaces#.Application.Contracts.#ModelName#
|
namespace #NameSpaces#.Application.Contracts.#ModelName#
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// #EntityName#<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
/// #EntityName#服务抽象
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface I#EntityName#Service : ICrudAppService<#EntityName#GetOutputDto, #EntityName#GetListOutputDto, long, #EntityName#GetListInputVo, #EntityName#CreateInputVo, #EntityName#UpdateInputVo>
|
public interface I#EntityName#Service : ICrudAppService<#EntityName#GetOutputDto, #EntityName#GetListOutputDto, long, #EntityName#GetListInputVo, #EntityName#CreateInputVo, #EntityName#UpdateInputVo>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
global using Yi.Framework.Core.Attributes;
|
global using Yi.Framework.Core.Attributes;
|
||||||
global using Yi.Framework.Core.Helper;
|
global using Yi.Framework.Core.Helper;
|
||||||
global using Yi.Framework.Core.Model;
|
global using Yi.Framework.Core.Model;
|
||||||
|
global using Yi.Framework.Core.Exceptions;
|
||||||
@@ -4,15 +4,46 @@
|
|||||||
<name>Yi.BBS.Application.Contracts</name>
|
<name>Yi.BBS.Application.Contracts</name>
|
||||||
</assembly>
|
</assembly>
|
||||||
<members>
|
<members>
|
||||||
<member name="T:Yi.BBS.Application.Contracts.Forum.Dtos.PlateCreateInputVo">
|
<member name="T:Yi.BBS.Application.Contracts.Exhibition.Dtos.Banner.BannerCreateInputVo">
|
||||||
|
<summary>
|
||||||
|
Banner输入创建对象
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="T:Yi.BBS.Application.Contracts.Exhibition.IBannerService">
|
||||||
|
<summary>
|
||||||
|
Banner抽象
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="T:Yi.BBS.Application.Contracts.Forum.Dtos.Discuss.DiscussCreateInputVo">
|
||||||
|
<summary>
|
||||||
|
Discuss输入创建对象
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="T:Yi.BBS.Application.Contracts.Forum.Dtos.Plate.PlateCreateInputVo">
|
||||||
<summary>
|
<summary>
|
||||||
Plate输入创建对象
|
Plate输入创建对象
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:Yi.BBS.Application.Contracts.Forum.IDiscussService">
|
||||||
|
<summary>
|
||||||
|
Discuss服务抽象
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:Yi.BBS.Application.Contracts.Forum.IPlateService">
|
<member name="T:Yi.BBS.Application.Contracts.Forum.IPlateService">
|
||||||
<summary>
|
<summary>
|
||||||
Plate<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
Plate服务抽象
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:Yi.BBS.Application.Contracts.GlobalSetting.ISettingService">
|
||||||
|
<summary>
|
||||||
|
Setting应用抽象
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:Yi.BBS.Application.Contracts.GlobalSetting.ISettingService.GetTitleAsync">
|
||||||
|
<summary>
|
||||||
|
获取配置标题
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
</members>
|
</members>
|
||||||
</doc>
|
</doc>
|
||||||
|
|||||||
@@ -4,10 +4,63 @@
|
|||||||
<name>Yi.BBS.Application</name>
|
<name>Yi.BBS.Application</name>
|
||||||
</assembly>
|
</assembly>
|
||||||
<members>
|
<members>
|
||||||
|
<member name="T:Yi.BBS.Application.Exhibition.BannerService">
|
||||||
|
<summary>
|
||||||
|
Banner服务实现
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="T:Yi.BBS.Application.Forum.DiscussService">
|
||||||
|
<summary>
|
||||||
|
Discuss服务实现
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:Yi.BBS.Application.Forum.PlateService">
|
<member name="T:Yi.BBS.Application.Forum.PlateService">
|
||||||
<summary>
|
<summary>
|
||||||
Plate服务实现
|
Plate服务实现
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:Yi.BBS.Application.GlobalSetting.SettingService">
|
||||||
|
<summary>
|
||||||
|
Setting服务实现
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:Yi.BBS.Application.GlobalSetting.SettingService.GetTitleAsync">
|
||||||
|
<summary>
|
||||||
|
获取配置标题
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
<exception cref="T:System.NotImplementedException"></exception>
|
||||||
|
</member>
|
||||||
|
<member name="T:Yi.BBS.Application.GlobalSetting.TempService">
|
||||||
|
<summary>
|
||||||
|
临时服务,之后用其他模块代替
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:Yi.BBS.Application.GlobalSetting.TempService.PostLoginAsync">
|
||||||
|
<summary>
|
||||||
|
登录
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
<exception cref="T:System.NotImplementedException"></exception>
|
||||||
|
</member>
|
||||||
|
<member name="M:Yi.BBS.Application.GlobalSetting.TempService.PostLogged">
|
||||||
|
<summary>
|
||||||
|
判断是否有登录
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:Yi.BBS.Application.GlobalSetting.TempService.PostlogOut">
|
||||||
|
<summary>
|
||||||
|
退出登录
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:Yi.BBS.Application.GlobalSetting.TempService.GetUserInfoByIdAsync(System.Int64)">
|
||||||
|
<summary>
|
||||||
|
获取用户信息
|
||||||
|
</summary>
|
||||||
|
<param name="id"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
</members>
|
</members>
|
||||||
</doc>
|
</doc>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"Yi.BBS.Web": {
|
"Yi.BBS.Web": {
|
||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
"dotnetRunMessages": true,
|
"dotnetRunMessages": true,
|
||||||
"launchBrowser": true,
|
"launchBrowser": false,
|
||||||
"launchUrl": "swagger",
|
"launchUrl": "swagger",
|
||||||
"applicationUrl": "http://localhost:19003",
|
"applicationUrl": "http://localhost:19003",
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
|
|||||||
Binary file not shown.
@@ -0,0 +1,18 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Yi.BBS.Application.Contracts.Exhibition.Dtos.Banner
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Banner输入创建对象
|
||||||
|
/// </summary>
|
||||||
|
public class BannerCreateInputVo
|
||||||
|
{
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string? Logo { get; set; }
|
||||||
|
public string? Color { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yi.Framework.Ddd.Dtos;
|
||||||
|
|
||||||
|
namespace Yi.BBS.Application.Contracts.Exhibition.Dtos.Banner
|
||||||
|
{
|
||||||
|
public class BannerGetListInputVo : PagedAndSortedResultRequestDto
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yi.Framework.Ddd.Dtos;
|
||||||
|
|
||||||
|
namespace Yi.BBS.Application.Contracts.Exhibition.Dtos.Banner
|
||||||
|
{
|
||||||
|
public class BannerGetListOutputDto : IEntityDto<long>
|
||||||
|
{
|
||||||
|
public long Id { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string? Logo { get; set; }
|
||||||
|
public string? Color { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yi.Framework.Ddd.Dtos;
|
||||||
|
|
||||||
|
namespace Yi.BBS.Application.Contracts.Exhibition.Dtos
|
||||||
|
{
|
||||||
|
public class BannerGetOutputDto : IEntityDto<long>
|
||||||
|
{
|
||||||
|
public long Id { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string? Logo { get; set; }
|
||||||
|
public string? Color { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Yi.BBS.Application.Contracts.Exhibition.Dtos.Banner
|
||||||
|
{
|
||||||
|
public class BannerUpdateInputVo
|
||||||
|
{
|
||||||
|
public string? Name { get; set; }
|
||||||
|
public string? Logo { get; set; }
|
||||||
|
public string? Color { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yi.BBS.Application.Contracts.Exhibition.Dtos;
|
||||||
|
using Yi.BBS.Application.Contracts.Exhibition.Dtos.Banner;
|
||||||
|
using Yi.Framework.Ddd.Services.Abstract;
|
||||||
|
|
||||||
|
namespace Yi.BBS.Application.Contracts.Exhibition
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Banner抽象
|
||||||
|
/// </summary>
|
||||||
|
public interface IBannerService : ICrudAppService<BannerGetOutputDto, BannerGetListOutputDto, long, BannerGetListInputVo, BannerCreateInputVo, BannerUpdateInputVo>
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,20 +4,21 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Yi.BBS.Application.Contracts.Forum.Dtos
|
namespace Yi.BBS.Application.Contracts.Forum.Dtos.Discuss
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Plate输入创建对象
|
/// Discuss输入创建对象
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class PlateCreateInputVo
|
public class DiscussCreateInputVo
|
||||||
{
|
{
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
public string PlateType { get; set; }
|
public string Types { get; set; }
|
||||||
public string Introduction { get; set; }
|
public string? Introduction { get; set; }
|
||||||
public DateTime? CreateTime { get; set; }
|
public DateTime? CreateTime { get; set; }
|
||||||
public int AgreeNum { get; set; }
|
public int AgreeNum { get; set; }
|
||||||
public int SeeNum { get; set; }
|
public int SeeNum { get; set; }
|
||||||
public string Content { get; set; }
|
public string Content { get; set; }
|
||||||
|
public string? Color { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yi.Framework.Ddd.Dtos;
|
||||||
|
|
||||||
|
namespace Yi.BBS.Application.Contracts.Forum.Dtos.Discuss
|
||||||
|
{
|
||||||
|
public class DiscussGetListInputVo : PagedAndSortedResultRequestDto
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,17 +5,18 @@ using System.Text;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Yi.Framework.Ddd.Dtos;
|
using Yi.Framework.Ddd.Dtos;
|
||||||
|
|
||||||
namespace Yi.BBS.Application.Contracts.Forum.Dtos
|
namespace Yi.BBS.Application.Contracts.Forum.Dtos.Discuss
|
||||||
{
|
{
|
||||||
public class PlateGetListOutputDto : IEntityDto<long>
|
public class DiscussGetListOutputDto : IEntityDto<long>
|
||||||
{
|
{
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
public string PlateType { get; set; }
|
public string Types { get; set; }
|
||||||
public string Introduction { get; set; }
|
public string? Introduction { get; set; }
|
||||||
public DateTime? CreateTime { get; set; }
|
public DateTime? CreateTime { get; set; }
|
||||||
public int AgreeNum { get; set; }
|
public int AgreeNum { get; set; }
|
||||||
public int SeeNum { get; set; }
|
public int SeeNum { get; set; }
|
||||||
public string Content { get; set; }
|
public string Content { get; set; }
|
||||||
|
public string? Color { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,15 +7,16 @@ using Yi.Framework.Ddd.Dtos;
|
|||||||
|
|
||||||
namespace Yi.BBS.Application.Contracts.Forum.Dtos
|
namespace Yi.BBS.Application.Contracts.Forum.Dtos
|
||||||
{
|
{
|
||||||
public class PlateGetListInputVo : PagedAndSortedResultRequestDto
|
public class DiscussGetOutputDto : IEntityDto<long>
|
||||||
{
|
{
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
public string PlateType { get; set; }
|
public string Types { get; set; }
|
||||||
public string Introduction { get; set; }
|
public string? Introduction { get; set; }
|
||||||
public DateTime? CreateTime { get; set; }
|
public DateTime? CreateTime { get; set; }
|
||||||
public int AgreeNum { get; set; }
|
public int AgreeNum { get; set; }
|
||||||
public int SeeNum { get; set; }
|
public int SeeNum { get; set; }
|
||||||
public string Content { get; set; }
|
public string Content { get; set; }
|
||||||
|
public string? Color { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,17 +4,17 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Yi.BBS.Application.Contracts.Forum.Dtos
|
namespace Yi.BBS.Application.Contracts.Forum.Dtos.Discuss
|
||||||
{
|
{
|
||||||
public class PlateUpdateInputVo
|
public class DiscussUpdateInputVo
|
||||||
{
|
{
|
||||||
public long Id { get; set; }
|
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
public string PlateType { get; set; }
|
public string Types { get; set; }
|
||||||
public string Introduction { get; set; }
|
public string? Introduction { get; set; }
|
||||||
public DateTime? CreateTime { get; set; }
|
public DateTime? CreateTime { get; set; }
|
||||||
public int AgreeNum { get; set; }
|
public int AgreeNum { get; set; }
|
||||||
public int SeeNum { get; set; }
|
public int SeeNum { get; set; }
|
||||||
public string Content { get; set; }
|
public string Content { get; set; }
|
||||||
|
public string? Color { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Yi.BBS.Application.Contracts.Forum.Dtos.Plate
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Plate输入创建对象
|
||||||
|
/// </summary>
|
||||||
|
public class PlateCreateInputVo
|
||||||
|
{
|
||||||
|
public long Id { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string? Logo { get; set; }
|
||||||
|
public string? Introduction { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yi.Framework.Ddd.Dtos;
|
||||||
|
|
||||||
|
namespace Yi.BBS.Application.Contracts.Forum.Dtos.Plate
|
||||||
|
{
|
||||||
|
public class PlateGetListInputVo : PagedAndSortedResultRequestDto
|
||||||
|
{
|
||||||
|
public long Id { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string? Logo { get; set; }
|
||||||
|
public string? Introduction { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yi.Framework.Ddd.Dtos;
|
||||||
|
|
||||||
|
namespace Yi.BBS.Application.Contracts.Forum.Dtos.Plate
|
||||||
|
{
|
||||||
|
public class PlateGetListOutputDto : IEntityDto<long>
|
||||||
|
{
|
||||||
|
public long Id { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string? Logo { get; set; }
|
||||||
|
public string? Introduction { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,12 +10,8 @@ namespace Yi.BBS.Application.Contracts.Forum.Dtos
|
|||||||
public class PlateGetOutputDto : IEntityDto<long>
|
public class PlateGetOutputDto : IEntityDto<long>
|
||||||
{
|
{
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
public string Title { get; set; }
|
public string Name { get; set; }
|
||||||
public string PlateType { get; set; }
|
public string? Logo { get; set; }
|
||||||
public string Introduction { get; set; }
|
public string? Introduction { get; set; }
|
||||||
public DateTime? CreateTime { get; set; }
|
|
||||||
public int AgreeNum { get; set; }
|
|
||||||
public int SeeNum { get; set; }
|
|
||||||
public string Content { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Yi.BBS.Application.Contracts.Forum.Dtos.Plate
|
||||||
|
{
|
||||||
|
public class PlateUpdateInputVo
|
||||||
|
{
|
||||||
|
public long Id { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string? Logo { get; set; }
|
||||||
|
public string? Introduction { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yi.BBS.Application.Contracts.Forum.Dtos;
|
||||||
|
using Yi.BBS.Application.Contracts.Forum.Dtos.Discuss;
|
||||||
|
using Yi.Framework.Ddd.Services.Abstract;
|
||||||
|
|
||||||
|
namespace Yi.BBS.Application.Contracts.Forum
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Discuss服务抽象
|
||||||
|
/// </summary>
|
||||||
|
public interface IDiscussService : ICrudAppService<DiscussGetOutputDto, DiscussGetListOutputDto, long, DiscussGetListInputVo, DiscussCreateInputVo, DiscussUpdateInputVo>
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,12 +4,13 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Yi.BBS.Application.Contracts.Forum.Dtos;
|
using Yi.BBS.Application.Contracts.Forum.Dtos;
|
||||||
|
using Yi.BBS.Application.Contracts.Forum.Dtos.Plate;
|
||||||
using Yi.Framework.Ddd.Services.Abstract;
|
using Yi.Framework.Ddd.Services.Abstract;
|
||||||
|
|
||||||
namespace Yi.BBS.Application.Contracts.Forum
|
namespace Yi.BBS.Application.Contracts.Forum
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Plate<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
/// Plate服务抽象
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IPlateService : ICrudAppService<PlateGetOutputDto, PlateGetListOutputDto, long, PlateGetListInputVo, PlateCreateInputVo, PlateUpdateInputVo>
|
public interface IPlateService : ICrudAppService<PlateGetOutputDto, PlateGetListOutputDto, long, PlateGetListInputVo, PlateCreateInputVo, PlateUpdateInputVo>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Yi.BBS.Application.Contracts.GlobalSetting.Dtos.Temp
|
||||||
|
{
|
||||||
|
public class ActionJwtDto
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string ActionName { get; set; }
|
||||||
|
public string Router { get; set; }
|
||||||
|
public string Icon { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Yi.BBS.Application.Contracts.GlobalSetting.Dtos.Temp
|
||||||
|
{
|
||||||
|
public class LoginDto
|
||||||
|
{
|
||||||
|
public LoginDto(string token)
|
||||||
|
{
|
||||||
|
Token = token;
|
||||||
|
}
|
||||||
|
public string Token { get; set; }
|
||||||
|
public LoginUserInfoDto User{get;set;}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class LoginUserInfoDto
|
||||||
|
{
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
public string UserName { get; set; }
|
||||||
|
|
||||||
|
public int Level { get; set; }
|
||||||
|
|
||||||
|
public string Icon { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yi.Framework.Ddd.Services.Abstract;
|
||||||
|
|
||||||
|
namespace Yi.BBS.Application.Contracts.GlobalSetting
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Setting应用抽象
|
||||||
|
/// </summary>
|
||||||
|
public interface ISettingService : IApplicationService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取配置标题
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<string> GetTitleAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using Yi.BBS.Application.Contracts.Exhibition;
|
||||||
|
using NET.AutoWebApi.Setting;
|
||||||
|
using Yi.BBS.Application.Contracts.Exhibition.Dtos;
|
||||||
|
using Yi.BBS.Domain.Exhibition.Entities;
|
||||||
|
using Yi.Framework.Ddd.Services;
|
||||||
|
using Yi.BBS.Application.Contracts.Exhibition.Dtos.Banner;
|
||||||
|
|
||||||
|
namespace Yi.BBS.Application.Exhibition
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Banner服务实现
|
||||||
|
/// </summary>
|
||||||
|
[AppService]
|
||||||
|
public class BannerService : CrudAppService<BannerEntity, BannerGetOutputDto, BannerGetListOutputDto, long, BannerGetListInputVo, BannerCreateInputVo, BannerUpdateInputVo>,
|
||||||
|
IBannerService, IAutoApiService
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yi.BBS.Application.Contracts.Exhibition.Dtos;
|
||||||
|
using Yi.BBS.Application.Contracts.Exhibition.Dtos.Banner;
|
||||||
|
using Yi.BBS.Domain.Exhibition.Entities;
|
||||||
|
|
||||||
|
namespace Yi.BBS.Application.Exhibition.MapperConfig
|
||||||
|
{
|
||||||
|
public class BannerProfile: Profile
|
||||||
|
{
|
||||||
|
public BannerProfile()
|
||||||
|
{
|
||||||
|
CreateMap<BannerGetListInputVo, BannerEntity>();
|
||||||
|
CreateMap<BannerCreateInputVo, BannerEntity>();
|
||||||
|
CreateMap<BannerUpdateInputVo, BannerEntity>();
|
||||||
|
CreateMap<BannerEntity, BannerGetListOutputDto>();
|
||||||
|
CreateMap<BannerEntity, BannerGetOutputDto>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
using Yi.BBS.Application.Contracts.Forum;
|
||||||
|
using NET.AutoWebApi.Setting;
|
||||||
|
using Yi.BBS.Application.Contracts.Forum.Dtos;
|
||||||
|
using Yi.BBS.Domain.Forum.Entities;
|
||||||
|
using Yi.Framework.Ddd.Services;
|
||||||
|
using Yi.BBS.Application.Contracts.Forum.Dtos.Discuss;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Yi.Framework.Ddd.Dtos;
|
||||||
|
|
||||||
|
namespace Yi.BBS.Application.Forum
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Discuss服务实现
|
||||||
|
/// </summary>
|
||||||
|
[AppService]
|
||||||
|
public class DiscussService : CrudAppService<DiscussEntity, DiscussGetOutputDto, DiscussGetListOutputDto, long, DiscussGetListInputVo, DiscussCreateInputVo, DiscussUpdateInputVo>,
|
||||||
|
IDiscussService, IAutoApiService
|
||||||
|
{
|
||||||
|
public async Task<PagedResultDto<DiscussGetListOutputDto>> GetPlateIdAsync([FromRoute] long plateId, [FromQuery] DiscussGetListInputVo input)
|
||||||
|
{
|
||||||
|
var entities = await _repository.GetPageListAsync(x => x.PlateId == plateId, input);
|
||||||
|
var items= await MapToGetListOutputDtosAsync(entities);
|
||||||
|
var total = await _repository.CountAsync(x=>x.IsDeleted==false);
|
||||||
|
return new PagedResultDto<DiscussGetListOutputDto>(total, items);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yi.BBS.Application.Contracts.Forum.Dtos;
|
||||||
|
using Yi.BBS.Application.Contracts.Forum.Dtos.Discuss;
|
||||||
|
using Yi.BBS.Domain.Forum.Entities;
|
||||||
|
|
||||||
|
namespace Yi.BBS.Application.Forum.MapperConfig
|
||||||
|
{
|
||||||
|
public class DiscussProfile: Profile
|
||||||
|
{
|
||||||
|
public DiscussProfile()
|
||||||
|
{
|
||||||
|
CreateMap<DiscussGetListInputVo, DiscussEntity>();
|
||||||
|
CreateMap<DiscussCreateInputVo, DiscussEntity>();
|
||||||
|
CreateMap<DiscussUpdateInputVo, DiscussEntity>();
|
||||||
|
CreateMap<DiscussEntity, DiscussGetListOutputDto>();
|
||||||
|
CreateMap<DiscussEntity, DiscussGetOutputDto>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Yi.BBS.Application.Contracts.Forum.Dtos;
|
using Yi.BBS.Application.Contracts.Forum.Dtos;
|
||||||
|
using Yi.BBS.Application.Contracts.Forum.Dtos.Plate;
|
||||||
using Yi.BBS.Domain.Forum.Entities;
|
using Yi.BBS.Domain.Forum.Entities;
|
||||||
|
|
||||||
namespace Yi.BBS.Application.Forum.MapperConfig
|
namespace Yi.BBS.Application.Forum.MapperConfig
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using NET.AutoWebApi.Setting;
|
|||||||
using Yi.BBS.Application.Contracts.Forum.Dtos;
|
using Yi.BBS.Application.Contracts.Forum.Dtos;
|
||||||
using Yi.BBS.Domain.Forum.Entities;
|
using Yi.BBS.Domain.Forum.Entities;
|
||||||
using Yi.Framework.Ddd.Services;
|
using Yi.Framework.Ddd.Services;
|
||||||
|
using Yi.BBS.Application.Contracts.Forum.Dtos.Plate;
|
||||||
|
|
||||||
namespace Yi.BBS.Application.Forum
|
namespace Yi.BBS.Application.Forum
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
using Yi.BBS.Application.Contracts.GlobalSetting;
|
||||||
|
using NET.AutoWebApi.Setting;
|
||||||
|
using Yi.BBS.Domain.GlobalSetting.Entities;
|
||||||
|
using Yi.Framework.Ddd.Services;
|
||||||
|
|
||||||
|
namespace Yi.BBS.Application.GlobalSetting
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Setting服务实现
|
||||||
|
/// </summary>
|
||||||
|
[AppService]
|
||||||
|
public class SettingService : ApplicationService,
|
||||||
|
ISettingService, IAutoApiService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取配置标题
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
|
public Task<string> GetTitleAsync()
|
||||||
|
{
|
||||||
|
return Task.FromResult("你好世界");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
using Yi.BBS.Application.Contracts.GlobalSetting;
|
||||||
|
using NET.AutoWebApi.Setting;
|
||||||
|
using Yi.BBS.Domain.GlobalSetting.Entities;
|
||||||
|
using Yi.Framework.Ddd.Services;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Yi.BBS.Application.Contracts.GlobalSetting.Dtos.Temp;
|
||||||
|
using Yi.BBS.Domain.Shared;
|
||||||
|
|
||||||
|
namespace Yi.BBS.Application.GlobalSetting
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///临时服务,之后用其他模块代替
|
||||||
|
/// </summary>
|
||||||
|
[AppService]
|
||||||
|
public class TempService : ApplicationService, IAutoApiService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 登录
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
|
[Route("/api/account/login")]
|
||||||
|
public Task<LoginDto> PostLoginAsync()
|
||||||
|
{
|
||||||
|
bool loginSucces = true;
|
||||||
|
if (!loginSucces)
|
||||||
|
{
|
||||||
|
throw new UserFriendlyException("登录失败", (int)BbsHttpStatusEnum.LoginFailed, "用户或者密码错误");
|
||||||
|
}
|
||||||
|
var dto = new LoginDto("token");
|
||||||
|
dto.User = new LoginUserInfoDto { Icon = "", Id = 0, Level = 1, UserName = "橙子" };
|
||||||
|
return Task.FromResult(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 判断是否有登录
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[Route("/api/account/logged")]
|
||||||
|
public Task<bool> PostLogged()
|
||||||
|
{
|
||||||
|
return Task.FromResult(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 退出登录
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[Route("/api/account/logout")]
|
||||||
|
public Task PostlogOut()
|
||||||
|
{
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取用户信息
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[Route("/api/account/user/{id}")]
|
||||||
|
public Task<List<ActionJwtDto>> GetUserInfoByIdAsync(long id)
|
||||||
|
{
|
||||||
|
var dto = new List<ActionJwtDto>();
|
||||||
|
dto.Add(new ActionJwtDto { Router = "/index", ActionName = "首页" });
|
||||||
|
//dto.Add(new ActionJwtDto { Router = "", ActionName = "" });
|
||||||
|
//dto.Add(new ActionJwtDto { Router = "", ActionName = "" });
|
||||||
|
//dto.Add(new ActionJwtDto { Router = "", ActionName = "" });
|
||||||
|
//dto.Add(new ActionJwtDto { Router = "", ActionName = "" });
|
||||||
|
//dto.Add(new ActionJwtDto { Router = "", ActionName = "" });
|
||||||
|
//dto.Add(new ActionJwtDto { Router = "", ActionName = "" });
|
||||||
|
//dto.Add(new ActionJwtDto { Router = "", ActionName = "" });
|
||||||
|
//dto.Add(new ActionJwtDto { Router = "", ActionName = "" });
|
||||||
|
return Task.FromResult(dto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Yi.BBS.Domain.Shared
|
||||||
|
{
|
||||||
|
public enum BbsHttpStatusEnum
|
||||||
|
{
|
||||||
|
LoginFailed=1900
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Yi.BBS.Domain.Shared.Exhibition.ConstClasses
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 常量定义
|
||||||
|
/// </summary>
|
||||||
|
|
||||||
|
public class BannerConst
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Yi.BBS.Domain.Shared.Forum.ConstClasses
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 常量定义
|
||||||
|
/// </summary>
|
||||||
|
|
||||||
|
public class DiscussConst
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yi.Framework.Data.Entities;
|
||||||
|
using Yi.Framework.Ddd.Entities;
|
||||||
|
|
||||||
|
namespace Yi.BBS.Domain.Exhibition.Entities
|
||||||
|
{
|
||||||
|
[SugarTable("Banner")]
|
||||||
|
public class BannerEntity : IEntity<long>, ISoftDelete
|
||||||
|
{
|
||||||
|
[SugarColumn(IsPrimaryKey = true)]
|
||||||
|
public long Id { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string? Logo { get; set; }
|
||||||
|
public string? Color { get; set; }
|
||||||
|
public bool IsDeleted { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Xml.Linq;
|
||||||
|
using Yi.Framework.Data.Entities;
|
||||||
|
using Yi.Framework.Ddd.Entities;
|
||||||
|
|
||||||
|
namespace Yi.BBS.Domain.Forum.Entities
|
||||||
|
{
|
||||||
|
[SugarTable("Discuss")]
|
||||||
|
public class DiscussEntity : IEntity<long>, ISoftDelete
|
||||||
|
{
|
||||||
|
public DiscussEntity(long plateId)
|
||||||
|
{
|
||||||
|
PlateId = plateId;
|
||||||
|
}
|
||||||
|
|
||||||
|
[SugarColumn(IsPrimaryKey = true)]
|
||||||
|
public long Id { get; set; }
|
||||||
|
public string Title { get; set; }
|
||||||
|
public string Types { get; set; }
|
||||||
|
public string? Introduction { get; set; }
|
||||||
|
public DateTime? CreateTime { get; set; }
|
||||||
|
public int AgreeNum { get; set; }
|
||||||
|
public int SeeNum { get; set; }
|
||||||
|
|
||||||
|
public string Content { get; set; }
|
||||||
|
|
||||||
|
public string? Color { get; set; }
|
||||||
|
|
||||||
|
public bool IsDeleted { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public long PlateId { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -14,14 +14,9 @@ namespace Yi.BBS.Domain.Forum.Entities
|
|||||||
{
|
{
|
||||||
[SugarColumn(IsPrimaryKey = true)]
|
[SugarColumn(IsPrimaryKey = true)]
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
public string Title { get; set; }
|
public string Name { get; set; }
|
||||||
public string PlateType { get; set; }
|
public string? Logo { get; set; }
|
||||||
public string Introduction { get; set; }
|
public string? Introduction { get; set; }
|
||||||
public DateTime? CreateTime { get; set; }
|
|
||||||
public int AgreeNum { get; set; }
|
|
||||||
public int SeeNum { get; set; }
|
|
||||||
|
|
||||||
public string Content { get; set; }
|
|
||||||
public bool IsDeleted { get; set; }
|
public bool IsDeleted { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yi.Framework.Data.Entities;
|
||||||
|
using Yi.Framework.Ddd.Entities;
|
||||||
|
|
||||||
|
namespace Yi.BBS.Domain.GlobalSetting.Entities
|
||||||
|
{
|
||||||
|
[SugarTable("Setting")]
|
||||||
|
public class SettingEntity : IEntity<long>
|
||||||
|
{
|
||||||
|
|
||||||
|
[SugarColumn(IsPrimaryKey = true)]
|
||||||
|
public long Id { get; set; }
|
||||||
|
public int CommentPage { get; set; }
|
||||||
|
public int DiscussPage { get; set; }
|
||||||
|
public int CommentExperience { get; set; }
|
||||||
|
public int DiscussExperience { get; set; }
|
||||||
|
public string Title { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user