|
|
@@ -3,12 +3,11 @@ package top.haijunit.train.controller;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
import top.haijunit.common.domain.ResultData;
|
|
|
-import top.haijunit.train.domain.entity.UserEntity;
|
|
|
-import top.haijunit.train.domain.repository.UserRepository;
|
|
|
+import top.haijunit.train.domain.entity.DeviceEntity;
|
|
|
+import top.haijunit.train.domain.repository.DeviceRepository;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
@@ -22,7 +21,7 @@ import java.util.List;
|
|
|
@RequiredArgsConstructor
|
|
|
public class DemoController {
|
|
|
|
|
|
- private final UserRepository userRepository;
|
|
|
+ private final DeviceRepository deviceRepository;
|
|
|
|
|
|
@GetMapping("")
|
|
|
public ResultData<String> demo() {
|
|
|
@@ -34,8 +33,8 @@ public class DemoController {
|
|
|
return new ModelAndView("webSocket");
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/user")
|
|
|
- public ResultData<List<UserEntity>> userList() {
|
|
|
- return ResultData.success(userRepository.findAll());
|
|
|
+ @GetMapping("/device")
|
|
|
+ public ResultData<List<DeviceEntity>> userList() {
|
|
|
+ return ResultData.success(deviceRepository.findAll());
|
|
|
}
|
|
|
}
|