예제 #1
0
        /// <summary>
        ///  BigMo转化为Mo
        ///    主要防止直接返回BigMo附带用户密码,来源渠道等字段
        /// </summary>
        /// <param name="io"></param>
        /// <returns></returns>
        public static UserInfoMo ConvertToMo(this UserInfoBigMo io)
        {
            var userInfo = new UserInfoMo
            {
                email     = io.email,
                nick_name = io.nick_name,
                head_img  = io.head_img,
                mobile    = io.mobile,
                id        = io.id,

                create_time = io.create_time,
                status      = io.status
            };

            return(userInfo);
        }
예제 #2
0
        /// <summary>
        /// 授权用户转化为系统用户信息
        /// </summary>
        /// <param name="io"></param>
        /// <returns></returns>
        public static UserInfoBigMo ConvertToBigMo(this OauthUserMo io)
        {
            var appInfo = MemberShiper.AppAuthorize;

            var user = new UserInfoBigMo
            {
                create_time = DateTime.Now.ToUtcSeconds(),
                app_source  = appInfo.AppSource,
                tenant_id   = appInfo.TenantId.ToInt64(),
                app_version = appInfo.AppVersion,
                head_img    = io.head_img,

                nick_name = io.nick_name
            };

            return(user);
        }