mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-08 18:36:51 +08:00
添加一个查询用户主页信息的接口
This commit is contained in:
@@ -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<Map<String,Object>> home(String aid) {
|
||||
|
||||
if(StringUtils.isBlank(aid)) {
|
||||
aid=getCurrent().getAccountId();
|
||||
}
|
||||
|
||||
if(StringUtils.isBlank(aid)) {
|
||||
return badRequest("无查询参数");
|
||||
}
|
||||
Map<String,Object> map=new HashMap<String,Object>();
|
||||
//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<List<User>> findByNameOrCode(String word) {
|
||||
if(StringUtils.isBlank(word)) {
|
||||
|
||||
Reference in New Issue
Block a user