Commit ec67d05e authored by 刘基明's avatar 刘基明

转发返回

parent 23f52828
...@@ -70,8 +70,7 @@ public class ThemeController { ...@@ -70,8 +70,7 @@ public class ThemeController {
@ResponseBody @ResponseBody
public CommonResp<CreateThemeResp> forwardTheme(@Validated @RequestBody ForwardThemeReq forwardThemeReq) { public CommonResp<CreateThemeResp> forwardTheme(@Validated @RequestBody ForwardThemeReq forwardThemeReq) {
String userId = userHolder.getUserId(); String userId = userHolder.getUserId();
themeManager.forward(forwardThemeReq, userId); return CommonResp.success(themeManager.forward(forwardThemeReq, userId));
return CommonResp.success();
} }
@AuthLogin @AuthLogin
......
...@@ -79,6 +79,7 @@ public class ThemeManager { ...@@ -79,6 +79,7 @@ public class ThemeManager {
} else { } else {
//修改 //修改
themeService.update(themeEntity, req.getEditThemeId()); themeService.update(themeEntity, req.getEditThemeId());
themeEntity.setThemeId(req.getEditThemeId());
} }
//保存附件表 //保存附件表
...@@ -211,7 +212,7 @@ public class ThemeManager { ...@@ -211,7 +212,7 @@ public class ThemeManager {
//转发 //转发
public CreateThemeResp forward(ForwardThemeReq req, String userId) { public CreateThemeResp forward(ForwardThemeReq req, String userId) {
ThemeEntity targetTheme = themeService.queryByThemeId(req.getFormerThemeId()); ThemeEntity targetTheme = themeService.queryByThemeId(req.getFormerThemeId());
ThemeEntity newTheme = ThemeEntity.builder() ThemeEntity themeEntity = ThemeEntity.builder()
.content(JsonUtil.toJson(req.getContent())) .content(JsonUtil.toJson(req.getContent()))
.topicId(req.getTopicId()) .topicId(req.getTopicId())
.formerThemeId(req.getFormerThemeId()) .formerThemeId(req.getFormerThemeId())
...@@ -221,12 +222,14 @@ public class ThemeManager { ...@@ -221,12 +222,14 @@ public class ThemeManager {
if (StringUtils.isEmpty(req.getEditThemeId()) || req.getEditThemeId() == req.getFormerThemeId()) { if (StringUtils.isEmpty(req.getEditThemeId()) || req.getEditThemeId() == req.getFormerThemeId()) {
//新建 //新建
themeService.insertTheme(newTheme); themeService.insertTheme(themeEntity);
} else { } else {
//修改 //修改
themeService.update(newTheme, req.getEditThemeId()); themeService.update(themeEntity, req.getEditThemeId());
themeEntity.setThemeId(req.getEditThemeId());
} }
return CreateThemeResp.builder().themeId(newTheme.getThemeId()).build(); return CreateThemeResp.builder().themeId(themeEntity.getThemeId()).build();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment