Commit 0a67e598 authored by 刘基明's avatar 刘基明

用户信息源修改

parent f78d54de
......@@ -3,12 +3,14 @@ package com.tanpu.community.controller;
import com.tanpu.common.api.CommonResp;
import com.tanpu.common.auth.UserHolder;
import com.tanpu.common.exception.BizException;
import com.tanpu.community.api.beans.qo.ThemeQo;
import com.tanpu.community.api.beans.req.theme.*;
import com.tanpu.community.manager.ThemeManager;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
......@@ -30,6 +32,9 @@ public class ThemeController {
@ResponseBody
public CommonResp<Void> publishTheme(@Validated @RequestBody CreateThemeReq req) {
String userId = userHolder.getUserId();
if(StringUtils.isEmpty(userId)){
throw new BizException("用户为空");
}
themeManager.publishTheme(req, userId);
return CommonResp.success();
}
......@@ -40,6 +45,9 @@ public class ThemeController {
@ResponseBody
public CommonResp<List<ThemeQo>> selectInterestList(@Validated @RequestBody ThemeListReq req) {
String userId = userHolder.getUserId();
if(StringUtils.isEmpty(userId)){
throw new BizException("用户为空");
}
List<ThemeQo> result = themeManager.queryThemes(req, userId);
return CommonResp.success(result);
}
......
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