# powermonitor-admin **Repository Path**: terrason/powermonitor-admin ## Basic Information - **Project Name**: powermonitor-admin - **Description**: Spring Boot 示例 —— 设备监控管理平台 - **Primary Language**: Java - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2019-08-11 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README Spring Boot Boilerplate Project ===================== Spring Boot 示例 —— 设备监控管理平台 spring jpa 示例 ----------- 参考 com.ahncnk.powermonitor.admin.devices @EnableSpringDataWebSupport 允许你在`@RequestMapping`方法上使用`Pageable`参数 参考[spring-data-jpa Pageable and Sort](https://docs.spring.io/spring-data/jpa/docs/2.1.9.RELEASE/reference/html/#core.web.basic.paging-and-sorting) spring Configuration Properties 示例 ------------ @EnableConfigurationProperties 允许自动填充配置类,参考 com.ahncnk.powermonitor.admin.AppConfig spring jwt 示例 ------------ 参考 com.ahncnk.powermonitor.admin.auth 使用双cookie模式的jwt认证来抵御xss和csrf漏洞 配置项 `app.auth.allow-csrf=true` 可以让你在浏览器端模拟登录和调试API,生产环境务必设为`false`(或去掉该配置,默认为`false`)。 spring job 示例 ------------ 参考 com.ahncnk.powermonitor.admin.users.service.UserService @EnableScheduling 允许使用`@Scheduled`注解执行定时任务。 使用说明 ------- 1. 执行 `database/init.sql` 导入数据库 2. 启动项目 开发模式:`./mvnw spring-boot:run` 生产模式: ``` ./mvnw package java -server -jar target/powermonitor-admin-0.0.1-SNAPSHOT.jar ``` 3. 测试 模拟登录地址: ``` http://127.0.0.1:10001/login?username=admin&password=111111 ``` 设备列表: ``` http://127.0.0.1:10001/api/devices ``` 带查询条件的设备列表: ``` http://127.0.0.1:10001/api/devices?page=0&size=10&name=ic ```