Esempio n. 1
0
        /// <summary>
        ///  从上下文中初始化基础信息
        /// </summary>
        /// <param name="t"></param>
        public static void InitialBaseFromContext(this BaseOwnerMo t)
        {
            if (string.IsNullOrEmpty(t.id))
            {
                t.id = NumHelper.SnowNum().ToString();
            }

            var appIdentity = AppReqContext.Identity;

            t.owner_uid = UserContext.Identity?.id;

            t.owner_tid   = appIdentity.tenant_id;
            t.add_time    = DateTime.Now.ToUtcSeconds();
            t.from_app_id = appIdentity.app_id;
        }
Esempio n. 2
0
        /// <summary>
        ///  从上下文中初始化基础信息
        /// </summary>
        /// <param name="t"></param>
        public static void InitialBaseFromContext(this BaseOwnerMo t)
        {
            if (t.id <= 0)
            {
                t.id = NumHelper.SmallSnowNum();
            }

            var appIdentity = AppReqContext.Identity;

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

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