Sfoglia il codice sorgente

新增获取用户信息的接口

master
三只松鼠 4 anni fa
parent
commit
990657b91d
1 ha cambiato i file con 6 aggiunte e 0 eliminazioni
  1. +6
    -0
      src/main/java/com/taauav/app/controller/HomeController.java

+ 6
- 0
src/main/java/com/taauav/app/controller/HomeController.java Vedi File

import com.taauav.front.service.IUserAdminService; import com.taauav.front.service.IUserAdminService;
import com.taauav.front.vo.UserAdminVo; import com.taauav.front.vo.UserAdminVo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;


@Autowired @Autowired
private Response response; private Response response;
@Value("${server.IMAGE_URL}")
private String uploadUrl;


/** /**
* 获取APP首页数据 * 获取APP首页数据
@GetMapping("/userInfo/{userId}") @GetMapping("/userInfo/{userId}")
public Response userInfo(@PathVariable("userId") Integer userId) { public Response userInfo(@PathVariable("userId") Integer userId) {
UserAdminVo info = adminService.getAdminInfo(userId); UserAdminVo info = adminService.getAdminInfo(userId);
if (info != null) {
info.setAvatar(uploadUrl + info.getAvatar());
}
return response.success(info); return response.success(info);
} }



Loading…
Annulla
Salva