Example #1
0
        public async Task <ServiceResult> EditUserName(UserNameRequest request)
        {
            var model = request.MapTo <UpdateUserNameRequest>();

            model.CompanyId = CurrentUserData.CompanyId;
            var result = await _iUser.EditUserName(model);

            if (result.Success)
            {
                return(ServiceResult.IsSuccess("修改成功"));
            }
            return(ServiceResult.IsFailed(result.Message));
        }
Example #2
0
        public override Task <UserNameResponse> GetUserName(UserNameRequest request, ServerCallContext context)
        {
            var res = new UserNameResponse()
            {
                UserName = "******",
            };

            res.Samples.Add(10);
            res.Samples.Add(20);
            var byteString = ByteString.CopyFrom(Encoding.UTF8.GetBytes("Hello"));

            res.Images.Add(byteString);
            return(Task.FromResult(res));
        }
Example #3
0
        public async Task <ActionResult <UserDTOs> > SearchUserByUserName(UserNameRequest UserName)
        {
            var command  = new SearchUserByUserNameCommand(UserName.UserName);
            var response = await _mediator.Send(command);

            if (response.UserName != "")
            {
                return(response);
            }
            else
            {
                return(NotFound());
            }
        }
Example #4
0
        public async Task <IActionResult> GetUserByUserName([FromBody] UserNameRequest request)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            User user = await _userHelper.GetUserAsync(request.userName);

            if (user == null)
            {
                return(NotFound("Error001"));
            }

            return(Ok(user));
        }
Example #5
0
    void Start()
    {
        SoundSetup();
        userNameRequest = GetComponent <UserNameRequest>();
        userNameRequest.DefaltRequest();
        userNameSet            = GetComponent <UserNameSetRequest>();
        roomCreateRequest      = GetComponent <RoomCreateRequest>();
        refreshRoomListRequest = GetComponent <RefreshRoomListRequest>();
        syncPlayerRequest      = GetComponent <SyncPlayerRequest>();

        mainUI   = GetComponent <UIPanel>().ui;
        list     = UIPackage.CreateObject("Lobby", "List").asCom;
        list_sub = UIPackage.CreateObject("Lobby", "List_sub").asCom;
        sub      = list_sub.GetChild("n0").asList;
        Alert    = UIPackage.CreateObject("Lobby", "Alert").asCom;
        roomList = UIPackage.CreateObject("Lobby", "RoomList").asCom;
        //监听按钮
        mainUI.GetChild("mainButton").onClick.Set(() =>
        {
            mainUI.GetChild("mainButton").visible = false;
            OpenList();
        });
        mainUI.GetChild("n3").onClick.Set(() => { CloseList(); });
    }
Example #6
0
 public Task <DelegateResponse> GetByUserNameAsync(UserNameRequest Request)
 => GetSimpleJsonAsync <DelegateResponse, UserNameRequest>(Request, Api.GetDelegate);
Example #7
0
 public DelegateResponse GetByUserName(UserNameRequest Request)
 => GetByUserNameAsync(Request).GetAwaiter().GetResult();