Search in sources :

Example 1 with People

use of org.tech.domain.People in project tech by ffyyhh995511.

the class PeopleService method queryPage.

public OpenPage queryPage(Integer pageNum, Integer pageSize) {
    // 获取第1页,10条内容,默认查询总数count
    PageHelper.startPage(pageNum, pageSize);
    // 紧跟着的第一个select方法会被分页
    List<People> list = peopleMapper.queryAll();
    Page p = ((Page) list);
    return OpenPage.buildPage(p);
}
Also used : People(org.tech.domain.People) Page(com.github.pagehelper.Page) OpenPage(org.tech.commons.OpenPage)

Example 2 with People

use of org.tech.domain.People in project tech by ffyyhh995511.

the class MultipleController method testNullValue.

/**
 * 测试返回的数据有空字段时,过滤掉这些没用的空字段
 * @return
 */
@ResponseBody
@RequestMapping(value = "/testNullValue", method = RequestMethod.GET)
public Object testNullValue() {
    People p = new People();
    p.setAddress("address");
    p.setAge(20);
    return responseSuccess(null, p);
}
Also used : People(org.tech.domain.People) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 3 with People

use of org.tech.domain.People in project tech by ffyyhh995511.

the class PeopleServiceUnit method test.

@Test
public void test() {
    People people = new People();
    people.setName("t22");
    System.out.println(peopleService.add(people));
}
Also used : People(org.tech.domain.People) Test(org.junit.Test)

Example 4 with People

use of org.tech.domain.People in project tech by ffyyhh995511.

the class AllInOneThreadController method test1.

/**
 * 这个方法是为了测试controller-->service-->dao是否都是同一个线程
 * @return
 */
@ResponseBody
@RequestMapping(value = "/test1", method = RequestMethod.GET)
public Object test1() {
    logger.info("controller thread name:" + Thread.currentThread().getName());
    logger.info("controller thread id:" + Thread.currentThread().getId());
    logger.info("controller activeCount:" + Thread.activeCount());
    try {
        People people = new People();
        people.setId(UUIDUtil.getUUID());
        people.setName("test one thread");
        peopleService.addByTestOneThread(people);
    } catch (Exception e) {
        logger.error("这里报错了", e);
    }
    return responseSuccess("test one thread", new Date());
}
Also used : People(org.tech.domain.People) Date(java.util.Date) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

People (org.tech.domain.People)4 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)2 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)2 Page (com.github.pagehelper.Page)1 Date (java.util.Date)1 Test (org.junit.Test)1 OpenPage (org.tech.commons.OpenPage)1