Search in sources :

Example 1 with User

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);
}
Also used : User(io.nutz.cloud.demo.bean.User)

Example 2 with 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";
}
Also used : User(io.nutz.cloud.demo.bean.User) At(org.nutz.mvc.annotation.At) Ok(org.nutz.mvc.annotation.Ok)

Aggregations

User (io.nutz.cloud.demo.bean.User)2 At (org.nutz.mvc.annotation.At)1 Ok (org.nutz.mvc.annotation.Ok)1