xiongzhu 4 éve
szülő
commit
1edaf9620d

+ 2 - 2
src/main/java/com/izouma/nineth/web/CollectionController.java

@@ -46,8 +46,8 @@ public class CollectionController extends BaseController {
     }
 
     @GetMapping("/get/{id}")
-    public Collection get(@PathVariable Long id) {
-        return collectionRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+    public CollectionDTO get(@PathVariable Long id) {
+        return collectionService.toDTO(collectionRepo.findById(id).orElseThrow(new BusinessException("无记录")), true);
     }
 
     @PostMapping("/del/{id}")

+ 3 - 3
src/main/java/com/izouma/nineth/web/UserController.java

@@ -87,10 +87,10 @@ public class UserController extends BaseController {
         return userService.toDTO(userService.all(pageQuery));
     }
 
-//    @PreAuthorize("hasRole('ADMIN')")
+    //    @PreAuthorize("hasRole('ADMIN')")
     @GetMapping("/get/{id}")
-    public User get(@PathVariable Long id) {
-        return userRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+    public UserDTO get(@PathVariable Long id) {
+        return userService.toDTO(userRepo.findById(id).orElseThrow(new BusinessException("无记录")), true);
     }
 
     @PreAuthorize("hasRole('ADMIN')")