Search in sources :

Example 1 with TestCaseComments

use of com.ngtesting.platform.entity.TestCaseComments in project ngtesting-platform by aaronchen2k.

the class CaseCommentsServiceImpl method save.

@Override
public TestCaseCommentsVo save(JSONObject json, UserVo userVo) {
    TestCaseCommentsVo vo = JSON.parseObject(JSON.toJSONString(json), TestCaseCommentsVo.class);
    TestCaseComments po = new TestCaseComments();
    if (vo.getId() != null) {
        po = (TestCaseComments) get(TestCaseComments.class, vo.getId());
    } else {
        po.setId(null);
    }
    po.setSummary(vo.getSummary());
    po.setContent(vo.getContent());
    po.setTestCaseId(vo.getTestCaseId());
    po.setUserId(userVo.getId());
    po.setChangeTime(new Date());
    saveOrUpdate(po);
    return genVo(po);
}
Also used : TestCaseComments(com.ngtesting.platform.entity.TestCaseComments) TestCaseCommentsVo(com.ngtesting.platform.vo.TestCaseCommentsVo) Date(java.util.Date)

Example 2 with TestCaseComments

use of com.ngtesting.platform.entity.TestCaseComments in project ngtesting-platform by aaronchen2k.

the class CaseCommentsServiceImpl method delete.

@Override
public boolean delete(Long id, Long userId) {
    TestCaseComments po = (TestCaseComments) get(TestCaseComments.class, id);
    po.setDeleted(true);
    saveOrUpdate(po);
    return true;
}
Also used : TestCaseComments(com.ngtesting.platform.entity.TestCaseComments)

Aggregations

TestCaseComments (com.ngtesting.platform.entity.TestCaseComments)2 TestCaseCommentsVo (com.ngtesting.platform.vo.TestCaseCommentsVo)1 Date (java.util.Date)1