Exemplo n.º 1
0
        public UserGetResponseModel Get(int id)
        {
            var command = new UserGetCommand(id);
            var result  = userApplicationService.Get(command);

            return(new UserGetResponseModel(result));
        }
Exemplo n.º 2
0
        public UserGetResponseModel Get(string id)
        {
            var command   = new UserGetCommand(id);
            var result    = userApplicationService.Get(command);
            var userModel = new UserResponseModel(result.User);

            return(new UserGetResponseModel(userModel));
        }
Exemplo n.º 3
0
        public UserGetResult Get(UserGetCommand command)
        {
            var id = new UserId(command.Id);
            var user = userRepository.Find(id);
            if (user == null)
            {
                throw new UserNotFoundException(id, "ユーザが見つかりませんでした。");
            }

            var data = new UserData(user);

            return new UserGetResult(data);
        }
Exemplo n.º 4
0
        public UserGetResult Get(UserGetCommand command)
        {
            var id   = new UserId(command.Id);
            var user = uow.UserRepository.Find(id);

            if (user == null)
            {
                throw new UserNotFoundException(id, "사용자를 찾지 못했음");
            }

            var data = new UserData(user);

            return(new UserGetResult(data));
        }
Exemplo n.º 5
0
        public CircleGetResponseModel Get(string id)
        {
            var getCircleCommand = new CircleGetCommand(id);
            var getCircleResult  = circleApplicationService.Get(getCircleCommand);

            var circle = new CircleResponseModel(getCircleResult.Circle);

            if (circle.OwnerId == null)
            {
                return(new CircleGetResponseModel(circle, new UserResponseModel("", "")));
            }

            var getOwnerCommand = new UserGetCommand(circle.OwnerId);
            var getOwnerResult  = userApplicationService.Get(getOwnerCommand);

            var owner = new UserResponseModel(getOwnerResult.User);

            return(new CircleGetResponseModel(circle, owner));
        }