开始业务模块
This commit is contained in:
@@ -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.Threading.Tasks;
|
||||
using Yi.BBS.Application.Contracts.Forum.Dtos;
|
||||
using Yi.BBS.Application.Contracts.Forum.Dtos.Plate;
|
||||
using Yi.BBS.Domain.Forum.Entities;
|
||||
|
||||
namespace Yi.BBS.Application.Forum.MapperConfig
|
||||
|
||||
@@ -3,6 +3,7 @@ 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.Plate;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user