Просмотр исходного кода

新增获取用户信息的接口

master
三只松鼠 4 лет назад
Родитель
Сommit
990657b91d
1 измененных файлов: 6 добавлений и 0 удалений
  1. +6
    -0
      src/main/java/com/taauav/app/controller/HomeController.java

+ 6
- 0
src/main/java/com/taauav/app/controller/HomeController.java Просмотреть файл

@@ -8,6 +8,7 @@ import com.taauav.front.entity.UserNotice;
import com.taauav.front.service.IUserAdminService;
import com.taauav.front.vo.UserAdminVo;
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.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -30,6 +31,8 @@ public class HomeController {

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

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


Загрузка…
Отмена
Сохранить