예제 #1
0
파일: BaseMo.cs 프로젝트: KevinWG/OSS.Core
        /// <summary>
        ///  从上下文中初始化基础信息
        /// </summary>
        /// <param name="t"></param>
        public static void InitialBaseFromContext(this BaseOwnerMo t)
        {
            if (t.id <= 0)
            {
                t.id = NumHelper.SmallSnowNum();
            }

            var appIdentity = CoreAppContext.Identity;

            t.owner_uid = CoreUserContext.Identity?.id.ToInt64() ?? 0;

            //t.owner_tid   = appIdentity.tenant_id.ToInt64();
            t.add_time = DateTime.Now.ToUtcSeconds();
            //t.from_app_id = appIdentity.app_id;
        }