mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2026-03-24 18:07:20 +08:00
添加项目文件。
This commit is contained in:
39
CoreCms.Net.Services/System/SysDictionaryDataServices.cs
Normal file
39
CoreCms.Net.Services/System/SysDictionaryDataServices.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/1/31 21:45:10
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据字典项表 接口实现
|
||||
/// </summary>
|
||||
public class SysDictionaryDataServices : BaseServices<SysDictionaryData>, ISysDictionaryDataServices
|
||||
{
|
||||
private readonly ISysDictionaryDataRepository _dal;
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
public SysDictionaryDataServices(IUnitOfWork unitOfWork, ISysDictionaryDataRepository dal)
|
||||
{
|
||||
this._dal = dal;
|
||||
base.BaseDal = dal;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
39
CoreCms.Net.Services/System/SysDictionaryServices.cs
Normal file
39
CoreCms.Net.Services/System/SysDictionaryServices.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/1/31 21:45:10
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据字典表 接口实现
|
||||
/// </summary>
|
||||
public class SysDictionaryServices : BaseServices<SysDictionary>, ISysDictionaryServices
|
||||
{
|
||||
private readonly ISysDictionaryRepository _dal;
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
public SysDictionaryServices(IUnitOfWork unitOfWork, ISysDictionaryRepository dal)
|
||||
{
|
||||
this._dal = dal;
|
||||
base.BaseDal = dal;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
40
CoreCms.Net.Services/System/SysLoginRecordServices.cs
Normal file
40
CoreCms.Net.Services/System/SysLoginRecordServices.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/1/31 21:45:10
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 登录日志表 接口实现
|
||||
/// </summary>
|
||||
public class SysLoginRecordServices : BaseServices<SysLoginRecord>, ISysLoginRecordServices
|
||||
{
|
||||
private readonly ISysLoginRecordRepository _dal;
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
public SysLoginRecordServices(IUnitOfWork unitOfWork, ISysLoginRecordRepository dal)
|
||||
{
|
||||
this._dal = dal;
|
||||
base.BaseDal = dal;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
108
CoreCms.Net.Services/System/SysMenuServices.cs
Normal file
108
CoreCms.Net.Services/System/SysMenuServices.cs
Normal file
@@ -0,0 +1,108 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/1/31 21:45:10
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 菜单表 接口实现
|
||||
/// </summary>
|
||||
public class SysMenuServices : BaseServices<SysMenu>, ISysMenuServices
|
||||
{
|
||||
private readonly ISysMenuRepository _dal;
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
|
||||
public SysMenuServices(IUnitOfWork unitOfWork, ISysMenuRepository dal)
|
||||
{
|
||||
this._dal = dal;
|
||||
base.BaseDal = dal;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region 实现重写增删改查操作==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(SysMenu entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(SysMenu entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<SysMenu> entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<AdminUiCallBack> DeleteByIdAsync(int id)
|
||||
{
|
||||
return await _dal.DeleteByIdAsync(id);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 获取缓存的所有数据==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 获取缓存的所有数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<SysMenu>> GetCaChe()
|
||||
{
|
||||
return await _dal.GetCaChe();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新cache
|
||||
/// </summary>
|
||||
public async Task<List<SysMenu>> UpdateCaChe()
|
||||
{
|
||||
return await _dal.UpdateCaChe();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
39
CoreCms.Net.Services/System/SysNLogRecordsServices.cs
Normal file
39
CoreCms.Net.Services/System/SysNLogRecordsServices.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/1/31 21:45:10
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// Nlog记录表 接口实现
|
||||
/// </summary>
|
||||
public class SysNLogRecordsServices : BaseServices<SysNLogRecords>, ISysNLogRecordsServices
|
||||
{
|
||||
private readonly ISysNLogRecordsRepository _dal;
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
public SysNLogRecordsServices(IUnitOfWork unitOfWork, ISysNLogRecordsRepository dal)
|
||||
{
|
||||
this._dal = dal;
|
||||
base.BaseDal = dal;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
33
CoreCms.Net.Services/System/SysOperRecordServices.cs
Normal file
33
CoreCms.Net.Services/System/SysOperRecordServices.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/1/31 21:45:10
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 操作日志表 接口实现
|
||||
/// </summary>
|
||||
public class SysOperRecordServices : BaseServices<SysOperRecord>, ISysOperRecordServices
|
||||
{
|
||||
private readonly ISysOperRecordRepository _dal;
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
|
||||
public SysOperRecordServices(IUnitOfWork unitOfWork, ISysOperRecordRepository dal)
|
||||
{
|
||||
_dal = dal;
|
||||
BaseDal = dal;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
}
|
||||
}
|
||||
33
CoreCms.Net.Services/System/SysOrganizationServices.cs
Normal file
33
CoreCms.Net.Services/System/SysOrganizationServices.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/1/31 21:45:10
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 组织机构表 接口实现
|
||||
/// </summary>
|
||||
public class SysOrganizationServices : BaseServices<SysOrganization>, ISysOrganizationServices
|
||||
{
|
||||
private readonly ISysOrganizationRepository _dal;
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
|
||||
public SysOrganizationServices(IUnitOfWork unitOfWork, ISysOrganizationRepository dal)
|
||||
{
|
||||
_dal = dal;
|
||||
BaseDal = dal;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
}
|
||||
}
|
||||
46
CoreCms.Net.Services/System/SysRoleMenuServices.cs
Normal file
46
CoreCms.Net.Services/System/SysRoleMenuServices.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/1/31 21:45:10
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 角色菜单关联表 接口实现
|
||||
/// </summary>
|
||||
public class SysRoleMenuServices : BaseServices<SysRoleMenu>, ISysRoleMenuServices
|
||||
{
|
||||
private readonly ISysRoleMenuRepository _dal;
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
|
||||
public SysRoleMenuServices(IUnitOfWork unitOfWork, ISysRoleMenuRepository dal)
|
||||
{
|
||||
_dal = dal;
|
||||
BaseDal = dal;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 角色权限Map
|
||||
/// RoleModulePermission, Module, Role 三表联合
|
||||
/// 第四个类型 RoleModulePermission 是返回值
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<SysRoleMenu>> RoleModuleMaps()
|
||||
{
|
||||
return await _dal.RoleModuleMaps();
|
||||
}
|
||||
}
|
||||
}
|
||||
33
CoreCms.Net.Services/System/SysRoleServices.cs
Normal file
33
CoreCms.Net.Services/System/SysRoleServices.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/1/31 21:45:10
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 角色表 接口实现
|
||||
/// </summary>
|
||||
public class SysRoleServices : BaseServices<SysRole>, ISysRoleServices
|
||||
{
|
||||
private readonly ISysRoleRepository _dal;
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
|
||||
public SysRoleServices(IUnitOfWork unitOfWork, ISysRoleRepository dal)
|
||||
{
|
||||
_dal = dal;
|
||||
BaseDal = dal;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
}
|
||||
}
|
||||
33
CoreCms.Net.Services/System/SysTaskLogServices.cs
Normal file
33
CoreCms.Net.Services/System/SysTaskLogServices.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/1/31 21:45:10
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 定时任务日志 接口实现
|
||||
/// </summary>
|
||||
public class SysTaskLogServices : BaseServices<SysTaskLog>, ISysTaskLogServices
|
||||
{
|
||||
private readonly ISysTaskLogRepository _dal;
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
|
||||
public SysTaskLogServices(IUnitOfWork unitOfWork, ISysTaskLogRepository dal)
|
||||
{
|
||||
_dal = dal;
|
||||
BaseDal = dal;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
}
|
||||
}
|
||||
33
CoreCms.Net.Services/System/SysUserRoleServices.cs
Normal file
33
CoreCms.Net.Services/System/SysUserRoleServices.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/1/31 21:45:10
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户角色关联表 接口实现
|
||||
/// </summary>
|
||||
public class SysUserRoleServices : BaseServices<SysUserRole>, ISysUserRoleServices
|
||||
{
|
||||
private readonly ISysUserRoleRepository _dal;
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
|
||||
public SysUserRoleServices(IUnitOfWork unitOfWork, ISysUserRoleRepository dal)
|
||||
{
|
||||
_dal = dal;
|
||||
BaseDal = dal;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
}
|
||||
}
|
||||
66
CoreCms.Net.Services/System/SysUserServices.cs
Normal file
66
CoreCms.Net.Services/System/SysUserServices.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/1/31 21:45:10
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户表 接口实现
|
||||
/// </summary>
|
||||
public class SysUserServices : BaseServices<SysUser>, ISysUserServices
|
||||
{
|
||||
private readonly ISysUserRepository _dal;
|
||||
private readonly ISysRoleRepository _sysRoleRepository;
|
||||
private readonly ISysUserRoleRepository _sysUserRoleRepository;
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
|
||||
public SysUserServices(IUnitOfWork unitOfWork, ISysUserRepository dal, ISysRoleRepository sysRoleRepository,
|
||||
ISysUserRoleRepository sysUserRoleRepository)
|
||||
{
|
||||
_dal = dal;
|
||||
BaseDal = dal;
|
||||
_unitOfWork = unitOfWork;
|
||||
_sysRoleRepository = sysRoleRepository;
|
||||
_sysUserRoleRepository = sysUserRoleRepository;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <param name="loginName"></param>
|
||||
/// <param name="loginPwd"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<string> GetUserRoleNameStr(string loginName, string loginPwd)
|
||||
{
|
||||
var roleName = "";
|
||||
var user = await QueryByClauseAsync(a => a.userName == loginName && a.passWord == loginPwd);
|
||||
var roleList = await _sysRoleRepository.QueryListByClauseAsync(a => a.deleted == false);
|
||||
if (user != null)
|
||||
{
|
||||
var userRoles = await _sysUserRoleRepository.QueryListByClauseAsync(ur => ur.userId == user.id);
|
||||
if (userRoles.Count > 0)
|
||||
{
|
||||
var arr = userRoles.Select(ur => ur.roleId).ToList();
|
||||
var roles = roleList.Where(d => arr.Contains(d.id));
|
||||
|
||||
roleName = string.Join(',', roles.Select(r => r.roleCode).ToArray());
|
||||
}
|
||||
}
|
||||
|
||||
return roleName;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user