You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.8 KiB
52 lines
1.8 KiB
using System;
|
|
|
|
namespace Operation
|
|
{
|
|
//请求关系映射
|
|
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false)]
|
|
class RequestMapping : Attribute
|
|
{
|
|
public string Url;
|
|
|
|
//权限,描述此协议的权限
|
|
public PermissionCode Permission;
|
|
|
|
//名称,用于描述此协议、权限,挂载菜单等
|
|
public String Name;
|
|
|
|
//是否为菜单连接,注意,当这个值设置为true 的时候,需要挂载父菜单(对应方法所在的class 需要有MenuMapping注解),否则编译失败
|
|
public bool isMenu;
|
|
|
|
public int Order; //当前仅当isMenu 为true 的时候,此字段才生效。
|
|
|
|
//操作是否记录日志
|
|
public bool toLog;
|
|
|
|
//是否需要登陆token 验证
|
|
public bool Ignored;
|
|
|
|
public RequestMapping(String name, PermissionCode permission = PermissionCode.SYSTEM_DEFAULT,
|
|
bool isMenu = false, int order = 0, bool toLog = false, bool ignored = false)
|
|
{
|
|
init("", name, permission, isMenu, order, toLog, ignored);
|
|
}
|
|
|
|
public RequestMapping(String url, String name, PermissionCode permission = PermissionCode.SYSTEM_DEFAULT,
|
|
bool isMenu = false, int order = 0, bool toLog = false, bool ignored = false)
|
|
{
|
|
init(url, name, permission, isMenu, order, toLog, ignored);
|
|
}
|
|
|
|
private void init(string url, String name, PermissionCode permission = PermissionCode.SYSTEM_DEFAULT,
|
|
bool isMenu = false, int order = 0, bool toLog = false, bool ignored = false)
|
|
{
|
|
this.Ignored = ignored;
|
|
this.Name = name;
|
|
this.Permission = permission;
|
|
this.isMenu = isMenu;
|
|
this.Order = order;
|
|
this.toLog = toLog;
|
|
this.Url = url;
|
|
}
|
|
}
|
|
}
|