Esempio n. 1
0
        public static UserExistResponse Unmarshall(UnmarshallerContext context)
        {
            UserExistResponse userExistResponse = new UserExistResponse();

            userExistResponse.HttpResponse = context.HttpResponse;
            userExistResponse.RequestId    = context.StringValue("UserExist.RequestId");
            userExistResponse.UserState    = context.IntegerValue("UserExist.UserState");

            return(userExistResponse);
        }
Esempio n. 2
0
        public async Task <Response <UserExistResponse> > GetByEmail(UserSearchByEmail request)
        {
            var user = await _uow.Users.GetUser(request.Email);

            var result = new UserExistResponse {
                UserExist = user != null,
                Email     = user?.Email,
            };

            return(new Response <UserExistResponse>(ResponseStatus.Ok, result));
        }
Esempio n. 3
0
        public UserExistResponse UserExist([FromBody] UserExistRequest req)
        {
            var rep = new UserExistResponse();

            if (req.Uid.IsEmpty())
            {
                rep.Error("请输入用户名");
                return(rep);
            }
            rep.Data = DefaultStorage.UserExist(req.Uid);

            return(rep);
        }
Esempio n. 4
0
        /// <summary>
        /// 验证客户登录名或手机号是否存在
        /// </summary>
        /// <param name="userNameOrPhone">登录名 或手机号</param>
        /// <returns></returns>
        public bool IsUserExist(string userNameOrPhone)
        {
            UserExistRequest request = new UserExistRequest()
            {
                userName = userNameOrPhone
            };
            string            postData = JsonHelper.GetJson(request);
            UserExistResponse response = client.Execute(request, isUserExist, postData);

            if (response.code == 0)
            {
                return(response.success);
            }
            return(false);
        }