code/Athena0.0.1/bll/UserInfo.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Athena.model;
using Athena.basedal;
using Athena.Idal;
//项目名称:Athena标准开发框架
//版本:0.0.1
//开发团队成员:周庆 王露 张婷婷 陈祚松 张梦丽 艾美珍 胡凯雨 陈兰兰 夏萍萍 康文洋 易传佳
//模块及代码页功能描述:用户获取动作、资源等信息
//最后修改时间:2018-01-11
//修改日志:
namespace Athena.bll
{
public class UserInfo
{
public static List<action> getUserAllAction(string username, string owner = "")//获取指定用户的特定类型和属主的动作列表,会含有重复项
{
List<action> rr = new List<action>();
List<role> rolelist = IocModule.GetEntity<IroleEx>().getUserRoles(username);
if (rolelist.Count > 0)
{
IroleActionEx _roleActionEx = IocModule.GetEntity<IroleActionEx>();
foreach (var e in rolelist)
{
rr.AddRange(_roleActionEx.getRoleAllAction(e.id, owner));
}
rr = rr.Where((x, i) => rr.FindIndex(z => z.id == x.id) == i).ToList();//Lambda表达式去重
}
return rr;
}
public static List<action> getUserAction(string username, int type, string owner = "")//获取指定用户的特定类型和属主的动作列表,会含有重复项
{
List<action> rr = new List<action>();
List<role> rolelist = IocModule.GetEntity<IuserRoleEx>().getRole(username);
if (rolelist.Count > 0)
{
IroleActionEx _roleActionEx= IocModule.GetEntity<IroleActionEx>();
foreach (var e in rolelist)
{
rr.AddRange(_roleActionEx.getRoleAction(e.id, type, owner));
}
rr = rr.Where((x, i) => rr.FindIndex(z => z.id == x.id) == i).ToList();//Lambda表达式去重
}
return rr;
}
public static List<resource> getUserResource(string username, int type, string owner = "")//获取指定用户的特定类型和属主的资源列表
{
List<resource> rr = new List<resource>();
List<role> rolelist = IocModule.GetEntity<IroleEx>().getUserRoles(username);
if (rolelist.Count > 0)
{
IroleResourceEx _roleResourceEx = IocModule.GetEntity<IroleResourceEx>();
foreach (var e in rolelist)
{
后面还有 23 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
