Search in sources :

Example 1 with StaffInfo

use of org.sagacity.sqltoy.demo.domain.StaffInfo in project sagacity-sqltoy by chenrenfei.

the class MapperUtilsTest method testVOToPO.

@Test
public void testVOToPO() {
    StaffInfoVO staffInfoVO = new StaffInfoVO();
    staffInfoVO.setStaffId("S2007");
    staffInfoVO.setStaffCode("S2007");
    staffInfoVO.setPostType("MASTER");
    staffInfoVO.setStaffName("测试员工9");
    staffInfoVO.setSexType("M");
    staffInfoVO.setEmail("test3@aliyun.com");
    staffInfoVO.setEntryDate(LocalDate.now());
    staffInfoVO.setStatus(1);
    staffInfoVO.setOrganId("100007");
    // staffInfoVO.setPhoto(FileUtil.readAsBytes("classpath:/mock/staff_photo.jpg"));
    staffInfoVO.setCountry("86");
    SqlToyContext context = new SqlToyContext();
    try {
        context.initialize();
        StaffInfo staffInfo = MapperUtils.map(context, staffInfoVO, StaffInfo.class);
        System.err.println(JSON.toJSONString(staffInfo));
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
Also used : StaffInfoVO(org.sagacity.sqltoy.demo.vo.StaffInfoVO) SqlToyContext(org.sagacity.sqltoy.SqlToyContext) StaffInfo(org.sagacity.sqltoy.demo.domain.StaffInfo) Test(org.junit.jupiter.api.Test)

Example 2 with StaffInfo

use of org.sagacity.sqltoy.demo.domain.StaffInfo in project sagacity-sqltoy by chenrenfei.

the class MapperUtilsTest method testPOTOVO.

@Test
public void testPOTOVO() {
    StaffInfo staffInfo = new StaffInfo();
    staffInfo.setStaffId("S2007");
    staffInfo.setStaffCode("S2007");
    staffInfo.setPost("MASTER");
    staffInfo.setStaffName("测试员工9");
    staffInfo.setSexType("M");
    staffInfo.setEmail("test3@aliyun.com");
    staffInfo.setEntryDate(LocalDate.now());
    staffInfo.setStatus(1);
    staffInfo.setOrganId("100007");
    // staffInfoVO.setPhoto(FileUtil.readAsBytes("classpath:/mock/staff_photo.jpg"));
    staffInfo.setCountry("86");
    SqlToyContext context = new SqlToyContext();
    try {
        context.initialize();
        StaffInfoVO staffInfoVO = MapperUtils.map(context, staffInfo, StaffInfoVO.class);
        System.err.println(JSON.toJSONString(staffInfoVO));
        StaffInfo staffInfo1 = MapperUtils.map(context, staffInfoVO, StaffInfo.class);
        System.err.println(JSON.toJSONString(staffInfo1));
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
Also used : StaffInfoVO(org.sagacity.sqltoy.demo.vo.StaffInfoVO) SqlToyContext(org.sagacity.sqltoy.SqlToyContext) StaffInfo(org.sagacity.sqltoy.demo.domain.StaffInfo) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)2 SqlToyContext (org.sagacity.sqltoy.SqlToyContext)2 StaffInfo (org.sagacity.sqltoy.demo.domain.StaffInfo)2 StaffInfoVO (org.sagacity.sqltoy.demo.vo.StaffInfoVO)2