Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/resources/application-production.yml
master
zyy 5 years ago
commit 109508c53d

@ -237,4 +237,28 @@ public class CaseContentController {
}
return JSONObject.toJSONString(value);
}
/**
* id
* @param jsonObject
* @return
*/
@RequestMapping("/forward-content")
public AjaxResult forwardContent(@RequestBody JSONObject jsonObject) {
AjaxResult ajaxResult = new AjaxResult();
try {
Long contentId = jsonObject.getLong("contentId");
if (null == contentId){
ajaxResult.setRetcode(AjaxResult.FAILED);
ajaxResult.setRetmsg("文章id不可为空");
}else {
ajaxResult = caseContentService.forwardContent(contentId);
}
} catch (Exception e) {
e.printStackTrace();
ajaxResult.setRetmsg("操作失败:" + e.getMessage());
ajaxResult.setRetcode(AjaxResult.FAILED);
}
return ajaxResult;
}
}

@ -0,0 +1,9 @@
package com.bsd.cases.mapper;
import com.bsd.cases.model.CaseContentForward;
import com.bsd.cases.util.CommonMapper;
import org.springframework.stereotype.Repository;
@Repository
public interface CaseContentForwardMapper extends CommonMapper<CaseContentForward> {
}

@ -0,0 +1,12 @@
package com.bsd.cases.model;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("case_content_forward")
public class CaseContentForward extends BaseEntity{
private Long contentId;
}

@ -32,4 +32,9 @@ public interface CaseContentService<CaseContent> extends BaseService<CaseContent
PageAjax<CaseContentBakVo> searchBakContentByParam(String name, Long level1, Long level2, Long level3, Integer pageNum);
CaseContentDetailBakVo getCaseContentDetailBakVoByContentID(Long contentId) throws UnsupportedEncodingException;
/**
*
*/
AjaxResult forwardContent(Long contentId);
}

@ -48,6 +48,8 @@ public class CaseContentServiceImpl extends BaseServiceImpl<CaseContentMapper, C
private CaseContentCommentsMapper caseContentCommentsMapper;
@Resource
private CaseContentScoreMapper caseContentScoreMapper;
@Resource
private CaseContentForwardMapper caseContentForwardMapper;
/**
*
@ -388,4 +390,26 @@ public class CaseContentServiceImpl extends BaseServiceImpl<CaseContentMapper, C
return caseContentDetailBakVo;
}
@Override
public AjaxResult forwardContent(Long contentId) {
AjaxResult ajaxResult = new AjaxResult();
CaseUsers caseUsers = caseUsersService.currentUser();
CaseContentForward caseContentForward = new CaseContentForward();
caseContentForward.setContentId(contentId);
caseContentForward.setState(Constants.STATE_VALID);
caseContentForward.setCreateDateTime(new Date());
caseContentForward.setUpdateDateTime(new Date());
caseContentForward.setCreateBy(caseUsers.getId());
caseContentForward.setUpdateBy(caseUsers.getId());
int result = caseContentForwardMapper.insert(caseContentForward);
if (0 != result){
ajaxResult.setRetcode(AjaxResult.SUCCESS);
ajaxResult.setRetmsg("成功记录转发");
}else {
ajaxResult.setRetcode(AjaxResult.FAILED);
ajaxResult.setRetmsg("记录转发失败");
}
return ajaxResult;
}
}

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bsd.cases.mapper.CaseContentForwardMapper">
</mapper>
Loading…
Cancel
Save