|
@@ -1,11 +1,16 @@
|
|
package cn.com.qmth.examcloud.service.core.api;
|
|
package cn.com.qmth.examcloud.service.core.api;
|
|
|
|
|
|
-import org.springframework.http.HttpStatus;
|
|
|
|
-import org.springframework.http.ResponseEntity;
|
|
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.data.domain.Sort;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
+import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
|
|
|
|
+import cn.com.qmth.examcloud.core.basic.dao.AppRepo;
|
|
|
|
+import cn.com.qmth.examcloud.core.basic.dao.entity.App;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -13,11 +18,15 @@ import io.swagger.annotations.ApiOperation;
|
|
*/
|
|
*/
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping("${app.api.root}/app")
|
|
@RequestMapping("${app.api.root}/app")
|
|
-public class AppApi {
|
|
|
|
|
|
+public class AppApi extends ControllerSupport {
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ AppRepo appRepo;
|
|
|
|
|
|
@ApiOperation(value = "查询所有应用")
|
|
@ApiOperation(value = "查询所有应用")
|
|
- @GetMapping
|
|
|
|
- public ResponseEntity getAllApp() {
|
|
|
|
- return new ResponseEntity(null, HttpStatus.OK);
|
|
|
|
|
|
+ @GetMapping("getAllApp")
|
|
|
|
+ public List<App> getAllApp() {
|
|
|
|
+ Sort sort = new Sort(Sort.Direction.ASC, "id");
|
|
|
|
+ return appRepo.findAll(sort);
|
|
}
|
|
}
|
|
}
|
|
}
|