/************************************************************************************************************
* file    :     PFGlobalParameter.cs
* author  : cbg
* function: 平台全局常用的参数,便于后期开发扩展
* history : created by CBG  20200204
************************************************************************************************************/
using RG3.PF.Abstractions.Attributes;
using RG3.PF.Abstractions.Enums;
using RG3.PF.Abstractions.Interfaces;
using System;
using System.Collections;
using System.Collections.Generic;

namespace RG3.PF.Abstractions.Entity
{
    /// <summary>
    ///  平台全局常用的参数,便于后期开发扩展    1个项目/所有者(ownerId)  拥有  多个系统(sysId)
    ///  通常解决多任务 异步调用导致配置获取错误的问题
    /// </summary>
    public class PFGlobalParameter : IEntity
    {


        /// <summary>
        /// 切片列
        /// </summary>
        public ShredConfig ShredConfig { get; set; }

        /// <summary>
        /// mysql批量插入是否配置本地
        /// </summary>
        public bool BulkLocal { get; set; }

        /// <summary>
        /// mysql批量插入是否配置本地
        /// </summary>
        public string BulkTempCsv { get; set; }

        /// <summary>
        /// mysql批量插入 执行方式   bulk(MySqlBulkLoader)/join(拼接sql)
        /// </summary>
        public string BulkDoMethod { get; set; }

        /// <summary>
        /// 缓存订阅类型,  bridge/mapper/dimdata/basis
        /// </summary>
        public string SubPullType { get; set; }

        /// <summary>
        /// 缓存来源   mapper/login/data/bridge
        /// </summary>
        public string CacheSource { get; set; } = "data";

        /// <summary>
        /// 传递的菜单ID
        /// </summary>
        public string MenuId { get; set; }
        /// <summary>
        /// 传递的用户ID
        /// </summary>
        public string UserId { get; set; }

        /// <summary>
        /// 传递的对象ID
        /// </summary>
        public string ObjectId { get; set; }


        /// <summary>
        /// 系统ID  RequestPFUtil.GetSysId(this.HttpContext),   对应header 里面 XsysId
        /// </summary>
        public string SysId { get; set; }

        /// <summary>
        /// 所有者ID/项目ID   RequestPFUtil.GetOwnerId(this.HttpContext),  对应 header 里面 XownerId
        /// </summary>
        [RequiredStringPF("ownerId")]
        public string OwnerId { get; set; }

        /// <summary>
        /// 请求模块
        /// </summary>
        //[RequiredMapperNamePF("mkey")]
        public string ModuleKey { get; set; }

        /// <summary>
        /// 响应字段
        /// </summary>
        //[RequiredMapperNamePF("resField")]
        public string ReponseField { get; set; }



        /// <summary>
        /// 函数名,用于 异常日志记录
        /// </summary>
        public string FunName { get; set; }


        /// <summary>
        /// 列字段 通过  _columnField  传递  通常用于维
        /// </summary>
        public string ColumnField { get; set; }

        /// <summary>
        /// 全局的 维key
        /// </summary>
        public string DimCacheKey { get; set; }


        /// <summary>
        /// 数据库类别
        /// </summary>
        public string DatabaseType { get; set; }

        /// <summary>
        /// Guid des-ecb加密  对应 header 里面 XverifyApi
        /// </summary>
        public string VerifyApi { get; set; }

        /// <summary>
        /// 全局的行政区过滤 编号
        /// </summary>
        public string XfilterAreaCode { get; set; }


        /// <summary>
        /// 全局的部门过滤 编号
        /// </summary>
        public string XfilterDepId { get; set; }


        /// <summary>
        /// 全局的角色过滤 编号
        /// </summary>
        public string XfilterRoleId { get; set; }

        /// <summary>
        /// 请求模块类别
        /// </summary>
        public RequestModuleType RequestModuleType { get; set; }


        /// <summary>
        /// 验证来源操作模块
        /// </summary>
        public RequestModuleType FromOpRmt { get; set; }

        /// <summary>
        /// 如果设置了桥   sql 条件不需要查询到数据
        /// </summary>
        public bool? Bridge { get; set; }


        /// <summary>
        /// mapper内部代码直接调用  比如登录时候自动添加,不需要添加必填验证
        /// </summary>
        public bool? NoValidate { get; set; }

        /// <summary>
        /// 客户端ip
        /// </summary>
        public string ClientUserIp { get; set; }

        /// <summary>
        /// 数据库连接名
        /// </summary>
        public string ConnName { get; set; }

        /// <summary>
        /// 来源登录  用于登录验证, 记录  错误次数等信息
        /// </summary>
        public bool? FromLogin { get; set; }


        /// <summary>
        /// 缓存key  用于告知相关缓存信息,数据有变更
        /// </summary>
        public string CacheKey
        {
            get
            {
                return $"{OwnerId}JJ{SysId}JJ{ModuleKey}";
            }
        }
        /// <summary>
        /// 订阅模块,数据更新后,更新哪些订阅模块
        /// </summary>
        public IEnumerable<SubModule> SubMkey { get; set; }



        /// <summary>
        /// 操作主键信息
        /// </summary>
        public object Ops { get; set; }



        /// <summary>
        /// 用户 显示名
        /// </summary>
        public string UserName { get; set; }



        /// <summary>
        /// 虚拟存储路径  ~/a/b.json
        /// </summary>
        public string VirPath { get; set; }



    }
}
文档更新时间: 2021-09-14 22:17   作者:admin