Explorar el Código

新增用户信息更新接口

woody hace 1 año
padre
commit
d58369a3a0

+ 3 - 6
src/main/java/com/chelvc/cloud/maintain/controller/UserController.java

@@ -1,5 +1,7 @@
 package com.chelvc.cloud.maintain.controller;
 
+import javax.validation.Valid;
+
 import com.chelvc.cloud.maintain.copier.UserCopier;
 import com.chelvc.cloud.maintain.vo.UserVO;
 import com.chelvc.cloud.uc.api.dto.UserDTO;
@@ -8,19 +10,14 @@ import com.chelvc.cloud.uc.api.service.UserService;
 import com.chelvc.framework.base.annotation.ResponseWrapping;
 import com.chelvc.framework.base.context.SessionContextHolder;
 import com.chelvc.framework.base.util.ResourceUtils;
-import com.chelvc.framework.common.util.ErrorUtils;
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.validation.Valid;
-import javax.validation.constraints.Min;
-
 /**
  * 用户接口
  *
@@ -49,7 +46,7 @@ public class UserController {
      */
     @GetMapping("/user/info")
     public UserVO getUserInfo() {
-        UserDTO user = this.userService.getUser();
+        UserDTO user = this.userService.getUser(SessionContextHolder.getId());
         ResourceUtils.required(user, "用户不存在");
         return UserCopier.INSTANCE.copying(user);
     }