Example #1
0
        public async Task <User> CreateAsync(UserCreateApiModel created, int userId)
        {
            var user = _userRespository.GetByPhone(created.Phone);

            if (user != null)
            {
                throw new DefaultException("电话号码已经被占用.");
            }
            return(await _userRespository.CreateAsync(created, userId));
        }