From 51241e6347296655d34e90ea1d2b352d484090ad Mon Sep 17 00:00:00 2001 From: daihh Date: Fri, 28 Oct 2022 17:07:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=B8=AA=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E7=94=A8=E6=88=B7=E4=B8=BB=E9=A1=B5=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xboe/system/user/api/UserApi.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/servers/boe-server-all/src/main/java/com/xboe/system/user/api/UserApi.java b/servers/boe-server-all/src/main/java/com/xboe/system/user/api/UserApi.java index 60db877b..937b4f68 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/system/user/api/UserApi.java +++ b/servers/boe-server-all/src/main/java/com/xboe/system/user/api/UserApi.java @@ -86,6 +86,37 @@ public class UserApi extends ApiBaseController { return success(page); } + /** + * 用户主页信息 + * @param aid + * @return + */ + @RequestMapping(value="/home",method = {RequestMethod.POST,RequestMethod.GET}) + public JsonResponse> home(String aid) { + + if(StringUtils.isBlank(aid)) { + aid=getCurrent().getAccountId(); + } + + if(StringUtils.isBlank(aid)) { + return badRequest("无查询参数"); + } + Map map=new HashMap(); + //map.put("aid", aid); + try { + User u = userService.get(aid); + if(u!=null) { + map.put("showHome",u.getShowHome()==null ? true: u.getShowHome()); + }else { + return badRequest("用户不存在"); + } + return success(map); + }catch(Exception e) { + log.error("查询用户错误",e); + return error("查询用户失败",e.getMessage()); + } + } + @RequestMapping(value="/find",method = {RequestMethod.POST,RequestMethod.GET}) public JsonResponse> findByNameOrCode(String word) { if(StringUtils.isBlank(word)) {