use of com.github.lybgeek.mongodb.model.Address in project springboot-learning by lyb-geek.
the class MongodbApplicationTest method testList.
@Test
public void testList() {
Address address = Address.builder().detailAddr("test1").build();
User user = User.builder().userName("张三1").email("zhangsan1@qq.com").password("1234561").gender(Gender.MALE).address(address).build();
List<User> users = userDao.listUsers(user);
System.out.println(users);
}
use of com.github.lybgeek.mongodb.model.Address in project springboot-learning by lyb-geek.
the class MongodbApplicationTest method testAddUser.
@Test
public void testAddUser() {
Address address = Address.builder().province("北京").city("北京").detailAddr("test1").build();
UserDTO userDTO = UserDTO.builder().userName("张三1").realName("张三").email("zhangsan@qq.com").password("1234561").address(address).gender(1).build();
UserDTO dto = userService.saveUser(userDTO);
// User dto = userDao.saveUser(User.builder().userName("张三1").email("zhangsan1@qq.com").password("1234561").gender(
// Gender.MALE).address(address).build());
Assert.assertNotNull(dto);
System.out.println(dto);
}
Aggregations