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

转发返回

parent 23f52828
......@@ -70,8 +70,7 @@ public class ThemeController {
@ResponseBody
public CommonResp<CreateThemeResp> forwardTheme(@Validated @RequestBody ForwardThemeReq forwardThemeReq) {
String userId = userHolder.getUserId();
themeManager.forward(forwardThemeReq, userId);
return CommonResp.success();
return CommonResp.success(themeManager.forward(forwardThemeReq, userId));
}
@AuthLogin
......
......@@ -79,6 +79,7 @@ public class ThemeManager {
} else {
//修改
themeService.update(themeEntity, req.getEditThemeId());
themeEntity.setThemeId(req.getEditThemeId());
}
//保存附件表
......@@ -211,7 +212,7 @@ public class ThemeManager {
//转发
public CreateThemeResp forward(ForwardThemeReq req, String userId) {
ThemeEntity targetTheme = themeService.queryByThemeId(req.getFormerThemeId());
ThemeEntity newTheme = ThemeEntity.builder()
ThemeEntity themeEntity = ThemeEntity.builder()
.content(JsonUtil.toJson(req.getContent()))
.topicId(req.getTopicId())
.formerThemeId(req.getFormerThemeId())
......@@ -221,12 +222,14 @@ public class ThemeManager {
if (StringUtils.isEmpty(req.getEditThemeId()) || req.getEditThemeId() == req.getFormerThemeId()) {
//新建
themeService.insertTheme(newTheme);
themeService.insertTheme(themeEntity);
} 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