use of com.tvd12.example.lucky_wheel.entity.User in project ezyfox-server by youngmonkeys.
the class EzyRequestAppEventImplTest method test.
@Test
public void test() {
EzyUser user = newUser();
EzyArray data = newArrayBuilder().append(100).build();
EzyUserRequestAppEvent event = new EzySimpleUserRequestAppEvent(user, null, data);
assert event.getData() == data;
assert event.getUser() == user;
}
use of com.tvd12.example.lucky_wheel.entity.User in project ezyfox-examples by tvd12.
the class UserViewController method getUser.
@DoGet("/{username}")
public View getUser(@PathVariable("username") String username) {
User user = userService.getUser(username);
String msg = user != null ? "User " + username + " with info: " + user : "User " + username + " not found";
return View.builder().addVariable("message", msg).template("user-info").build();
}
use of com.tvd12.example.lucky_wheel.entity.User in project ezyfox-examples by tvd12.
the class ApiAddUserTest method main.
public static void main(String[] args) throws Exception {
HttpClient httpClient = HttpClient.builder().build();
User body = new User();
body.setUsername("tvd12");
body.setPassword("123456");
RequestEntity requestEntity = RequestEntity.body(body);
Request request = new PostRequest().setURL(API_URL + "add").setEntity(requestEntity).setResponseType(Boolean.class).setResponseType(StatusCodes.CONFLICT, String.class);
Boolean response = httpClient.call(request);
System.out.println("add user reponse: " + response);
}
use of com.tvd12.example.lucky_wheel.entity.User in project ezyfox-examples by tvd12.
the class ApiGetUserTest method main.
public static void main(String[] args) throws Exception {
HttpClientProxy httpClient = HttpClientProxy.builder().build();
httpClient.start();
RequestEntity entity = RequestEntity.builder().build();
Request helloRequest = new GetRequest().setURL(API_URL + "tvd12").setEntity(entity).setResponseType(String.class).setResponseType(StatusCodes.NOT_FOUND, String.class);
String response = httpClient.call(helloRequest, 10000);
System.out.println("get user response: " + response);
}
use of com.tvd12.example.lucky_wheel.entity.User in project ezyfox-server-android-client by youngmonkeys.
the class EzyLoginSuccessHandler method handle.
@Override
public void handle(EzyArray data) {
EzyData responseData = data.get(4, EzyData.class);
EzyUser user = newUser(data);
EzyZone zone = newZone(data);
((EzyMeAware) client).setMe(user);
((EzyZoneAware) client).setZone(zone);
handleLoginSuccess(responseData);
EzyLogger.debug("user: " + user + " logged in successfully");
}
Aggregations