use of io.nutz.cloud.demo.bean.User in project nutzcloud by nutzam.
the class UserServiceImpl method add.
public User add(@Param("name") String name, @Param("age") int age) {
User user = new User();
user.setName(name);
user.setAge(age);
return dao.insert(user);
}
use of io.nutz.cloud.demo.bean.User in project nutzcloud by nutzam.
the class UserModule method apitest.
/**
* 这是演示api调用的入口,会顺序调用一堆请求,请关注日志
*/
@Ok("raw")
@At
public String apitest() {
List<User> users = userService.list();
log.info("users=" + Json.toJson(users));
User haoqoo = userService.add("haoqoo", 19);
User wendal = userService.add("wendal", 28);
users = userService.list();
log.info("users=" + Json.toJson(users));
userService.delete(haoqoo.getId());
userService.delete(wendal.getId());
users = userService.list();
log.info("users=" + Json.toJson(users));
return "done";
}