Search in sources :

Example 1 with QnAEntity

use of com.varsql.web.model.entity.app.QnAEntity in project varsql by varsqlinfo.

the class UserPreferencesServiceImpl method deleteQnaInfo.

/**
 * @Method Name  : deleteQnaInfo
 * @Method 설명 : qna 삭제.
 * @작성자   : ytkim
 * @작성일   : 2019. 1. 3.
 * @변경이력  :
 * @param paramMap
 * @return
 */
@Transactional(value = ResourceConfigConstants.APP_TRANSMANAGER, rollbackFor = Exception.class)
public ResponseResult deleteQnaInfo(String qnaid) {
    QnAEntity entity = qnaEntityRepository.findByQnaid(qnaid);
    if (entity.getAnswerId() == null) {
        qnaEntityRepository.delete(entity);
    }
    ResponseResult result = new ResponseResult();
    result.setMessageCode("answer.msg.notdelete");
    return result;
}
Also used : QnAEntity(com.varsql.web.model.entity.app.QnAEntity) ResponseResult(com.vartech.common.app.beans.ResponseResult) Transactional(org.springframework.transaction.annotation.Transactional)

Example 2 with QnAEntity

use of com.varsql.web.model.entity.app.QnAEntity in project varsql by varsqlinfo.

the class UserPreferencesServiceImpl method saveQnaInfo.

/**
 * @Method Name  : insertQnaInfo
 * @Method 설명 : qna 등록.
 * @작성자   : ytkim
 * @작성일   : 2017. 11. 29.
 * @변경이력  :
 * @param paramMap
 * @return
 */
public ResponseResult saveQnaInfo(QnARequesetDTO qnaInfo, boolean insFlag) {
    QnAEntity entity = qnaInfo.toEntity();
    qnaEntityRepository.save(entity);
    return VarsqlUtils.getResponseResultItemOne(1);
}
Also used : QnAEntity(com.varsql.web.model.entity.app.QnAEntity)

Example 3 with QnAEntity

use of com.varsql.web.model.entity.app.QnAEntity in project varsql by varsqlinfo.

the class QnaServiceImpl method updateQnaAnswerContent.

/**
 * @Method Name  : updateQnaAnswerContent
 * @Method 설명 : qna answer 업데이트.
 * @작성자   : ytkim
 * @작성일   : 2019. 1. 10.
 * @변경이력  :
 * @param qnaInfo
 * @return
 */
public ResponseResult updateQnaAnswerContent(QnARequesetDTO qnaInfo) {
    QnAEntity qnaEntity = qnaEntityRepository.findByQnaid(qnaInfo.getQnaid());
    qnaEntity.setAnswer(qnaInfo.getAnswer());
    qnaEntity.setAnswerId(SecurityUtil.userViewId());
    qnaEntity.setAnswerDt(DefaultValueUtils.currentTimestamp());
    qnaEntityRepository.save(qnaEntity);
    return VarsqlUtils.getResponseResultItemOne(1);
}
Also used : QnAEntity(com.varsql.web.model.entity.app.QnAEntity)

Aggregations

QnAEntity (com.varsql.web.model.entity.app.QnAEntity)3 ResponseResult (com.vartech.common.app.beans.ResponseResult)1 Transactional (org.springframework.transaction.annotation.Transactional)1