添加项目文件。

This commit is contained in:
zgf committed 2023-07-25 19:20:18 +08:00
1 parent 05e131ca4e
commit 514d6f5255
1162 files changed
+81255

No files matched your search

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WalkingTec.Mvvm.Core.Support.Json
{
public class ApiListModel<T>
{
public List<T> Data { get; set; }
public int Count { get; set; }
public int Page { get; set; }
public int PageCount { get; set; }
}
}
@@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace WalkingTec.Mvvm.Core.Support.Json
{
public class SimpleAction
{
public Guid ID { get; set; }
public ActionDescriptionAttribute ActionDes { get; set; }
public string _name;
public string ActionName
{
get
{
if (ActionDes?._localizer != null && string.IsNullOrEmpty(ActionDes?.Description) == false)
{
return ActionDes._localizer[ActionDes.Description];
}
else
{
return _name ?? "";
}
}
set
{
_name = value;
}
}
public string MethodName { get; set; }
public Guid? ModuleId { get; set; }
public SimpleModule Module { get; set; }
public string Parameter { get; set; }
public List<string> ParasToRunTest { get; set; }
public bool IgnorePrivillege { get; set; }
public bool MainHostOnly { get; set; }
private string _url;
public string Url
{
get
{
if (_url == null)
{
if (this.Module.Area != null)
{
_url = "/" + this.Module.Area.Prefix + "/" + this.Module.ClassName + "/" + this.MethodName;
}
else
{
_url = "/" + this.Module.ClassName + "/" + this.MethodName;
}
}
return _url;
}
set
{
_url = value;
}
}
}
}
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace WalkingTec.Mvvm.Core.Support.Json
{
public class SimpleArea
{
public Guid ID { get; set; }
public string AreaName { get; set; }
public string Prefix { get; set; }
public List<SimpleModule> Modules { get; set; }
}
}
@@ -0,0 +1,19 @@
using System;
namespace WalkingTec.Mvvm.Core.Support.Json
{
[Serializable]
public class SimpleDataPri
{
public Guid ID { get; set; }
public string UserCode { get; set; }
public string GroupCode { get; set; }
public string TableName { get; set; }
public string RelateId { get; set; }
}
}
@@ -0,0 +1,18 @@
using System;
namespace WalkingTec.Mvvm.Core.Support.Json
{
[Serializable]
public class SimpleFunctionPri
{
public Guid ID { get; set; }
public string RoleCode{ get; set; }
public Guid MenuItemId { get; set; }
public string Url { get; set; }
public bool? Allowed { get; set; }
}
}
@@ -0,0 +1,15 @@
using System;
namespace WalkingTec.Mvvm.Core.Support.Json
{
[Serializable]
public class SimpleGroup
{
public Guid ID { get; set; }
public string GroupCode { get; set; }
public string GroupName { get; set; }
public string Manager { get; set; }
public Guid? ParentId { get; set; }
public string Tenant { get; set; }
}
}
@@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace WalkingTec.Mvvm.Core.Support.Json
{
public class SimpleLog
{
public ActionLog GetActionLog()
{
return new ActionLog
{
ActionName = this.ActionName,
ActionTime = this.ActionTime,
ActionUrl = this.ActionUrl,
CreateBy = this.CreateBy,
CreateTime = this.CreateTime,
Duration = this.Duration,
IP = this.IP,
ITCode = this.ITCode,
LogType = this.LogType,
ModuleName = this.ModuleName,
Remark = this.Remark,
UpdateBy = this.UpdateBy,
UpdateTime = this.UpdateTime,
};
}
public string ModuleName { get; set; }
public string ActionName { get; set; }
public string ITCode { get; set; }
public string ActionUrl { get; set; }
public DateTime ActionTime { get; set; }
public double Duration { get; set; }
public string Remark { get; set; }
public string IP { get; set; }
public ActionLogTypesEnum LogType { get; set; }
public DateTime? CreateTime { get; set; }
/// <summary>
/// CreateBy
/// </summary>
public string CreateBy { get; set; }
/// <summary>
/// UpdateTime
/// </summary>
public DateTime? UpdateTime { get; set; }
/// <summary>
/// UpdateBy
/// </summary>
public string UpdateBy { get; set; }
}
}
@@ -0,0 +1,134 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
namespace WalkingTec.Mvvm.Core.Support.Json
{
[Serializable]
public class SimpleMenu
{
public Guid ID { get; set; }
public Guid? ActionId { get; set; }
public bool? IsPublic { get; set; }
public string Url { get; set; }
public Guid? ParentId { get; set; }
public string PageName { get; set; }
public int? DisplayOrder { get; set; }
public string Icon { get; set; }
public bool ShowOnMenu { get; set; }
public bool? IsInside { get; set; }
public bool FolderOnly { get; set; }
public string MethodName { get; set; }
public bool? TenantAllowed { get; set; }
public bool IsParentShowOnMenu(List<SimpleMenu> all)
{
if(this.ParentId == null)
{
return ShowOnMenu;
}
else
{
var p = all.Where(x => x.ID == this.ParentId).FirstOrDefault();
if(p == null)
{
return false;
}
else
{
return p.IsParentShowOnMenu(all);
}
}
}
public int GetLevel(List<SimpleMenu> all)
{
int level = 0;
var self = this;
while (self.ParentId != null)
{
level++;
self = all.Where(x=>x.ID == self.ParentId).FirstOrDefault();
}
return level;
}
}
public class SimpleMenuApi
{
public string Id { get; set; }
public string ParentId { get; set; }
public string Text { get; set; }
public string Url { get; set; }
public string Icon { get; set; }
}
public class LayUIMenu
{
[JsonIgnore]
public Guid Id { get; set; }
/// <summary>
/// Name
/// 默认用不上name,但是 v1.2.1 有问题:“默认展开了所有节点,并将所有子节点标蓝”
/// </summary>
/// <value></value>
[JsonPropertyName("name")]
public string Name => Title;
/// <summary>
/// Title
/// </summary>
/// <value></value>
[JsonPropertyName("title")]
public string Title { get; set; }
/// <summary>
/// 图标
/// </summary>
/// <value></value>
[JsonPropertyName("icon")]
public string Icon { get; set; }
/// <summary>
/// 是否展开节点
/// </summary>
/// <value></value>
[JsonPropertyName("spread")]
public bool? Expand { get; set; }
/// <summary>
/// Url
/// </summary>
/// <value></value>
[JsonPropertyName("jump")]
public string Url { get; set; }
[JsonPropertyName("list")]
public List<LayUIMenu> Children { get; set; }
/// <summary>
/// order
/// </summary>
/// <value></value>
[JsonIgnore]
public int? Order { get; set; }
}
}
@@ -0,0 +1,60 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WalkingTec.Mvvm.Core.Support.Json
{
public class SimpleModule
{
public Guid ID { get; set; }
public ActionDescriptionAttribute ActionDes { get; set; }
public string _name;
public string ModuleName
{
get
{
if (_name == null)
{
if (ActionDes?._localizer != null && string.IsNullOrEmpty(ActionDes?.Description) == false)
{
_name= ActionDes._localizer[ActionDes.Description];
}
else
{
_name= _name ?? "";
}
}
return _name;
}
set
{
_name = value;
}
}
public string ClassName { get; set; }
public List<SimpleAction> Actions { get; set; }
public Guid? AreaId { get; set; }
public SimpleArea Area { get; set; }
public string NameSpace { get; set; }
public bool IgnorePrivillege { get; set; }
public bool MainHostOnly { get; set; }
public bool IsApi { get; set; }
public string FullName
{
get
{
return this.NameSpace + "," + this.ClassName;
}
}
}
}
@@ -0,0 +1,14 @@
using System;
namespace WalkingTec.Mvvm.Core.Support.Json
{
[Serializable]
public class SimpleRole
{
public Guid ID { get; set; }
public string RoleCode { get; set; }
public string RoleName { get; set; }
public string Tenant { get; set; }
}
}
@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
namespace WalkingTec.Mvvm.Core.Support.Json
{
public class SimpleUserInfo
{
public Guid Id { get; set; }
/// <summary>
/// 登录用户
/// </summary>
public string ITCode { get; set; }
public string Name { get; set; }
public string Memo { get; set; }
public List<SimpleRole> Roles { get; set; }
/// <summary>
/// 用户的页面权限列表
/// </summary>
public List<SimpleFunctionPri> FunctionPrivileges { get; set; }
public List<SimpleDataPri> DataPrivileges { get; set; }
}
}
@@ -0,0 +1,20 @@
using System.Text.Json.Serialization;
namespace WalkingTec.Mvvm.Core.Support.Json
{
public class Token
{
[JsonPropertyName("access_token")]
public string AccessToken { get; set; }
[JsonPropertyName("expires_in")]
public int ExpiresIn { get; set; }
[JsonPropertyName("token_type")]
public string TokenType { get; set; }
[JsonPropertyName("refresh_token")]
public string RefreshToken { get; set; }
}
}