diff --git a/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/ReportController.java b/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/ReportController.java new file mode 100644 index 00000000..b69e0c26 --- /dev/null +++ b/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/ReportController.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) 2022 aoshiguchen + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +package fun.asgc.neutrino.proxy.server.controller; + +import fun.asgc.neutrino.core.annotation.NonIntercept; +import fun.asgc.neutrino.core.web.annotation.GetMapping; +import fun.asgc.neutrino.core.web.annotation.RequestMapping; +import fun.asgc.neutrino.core.web.annotation.RestController; +import fun.asgc.neutrino.proxy.server.controller.res.ReportDataViewRes; + +/** + * 报表管理 + * @author: aoshiguchen + * @date: 2022/9/12 + */ +@NonIntercept +@RequestMapping("report") +@RestController +public class ReportController { + + @GetMapping("data-view") + public ReportDataViewRes dataView() { + return new ReportDataViewRes() + .setUserOnlineNumber(2).setEnableUserNumber(3).setUserNumber(5) + .setLicenseNumber(3).setEnableLicenseNumber(6).setLicenseNumber(6) + .setServerPortOnlineNumber(3).setEnableServerPortNumber(5).setServerPortNumber(6) + .setTotalUpstreamFlow("23K").setTotalDownwardFlow("47M") + ; + } +} diff --git a/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/res/ReportDataViewRes.java b/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/res/ReportDataViewRes.java new file mode 100644 index 00000000..442d5e4b --- /dev/null +++ b/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/res/ReportDataViewRes.java @@ -0,0 +1,57 @@ +package fun.asgc.neutrino.proxy.server.controller.res; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * @author: aoshiguchen + * @date: 2022/9/12 + */ +@Accessors(chain = true) +@Data +public class ReportDataViewRes { + /** + * 在线用户数 + */ + private Integer userOnlineNumber; + /** + * 启用用户数 + */ + private Integer enableUserNumber; + /** + * 用户总数 + */ + private Integer userNumber; + /** + * 在线license数 + */ + private Integer licenseOnlineNumber; + /** + * 启用license数 + */ + private Integer enableLicenseNumber; + /** + * license总数 + */ + private Integer licenseNumber; + /** + * 服务端口在线数 + */ + private Integer serverPortOnlineNumber; + /** + * 启用服务端口数 + */ + private Integer enableServerPortNumber; + /** + * 总的服务端口数 + */ + private Integer serverPortNumber; + /** + * 累计上行流量 + */ + private String totalUpstreamFlow; + /** + * 累计下行流量 + */ + private String totalDownwardFlow; +} diff --git a/neutrino-proxy-server/src/main/resources/sql/init-structure.sql b/neutrino-proxy-server/src/main/resources/sql/init-structure.sql index e83e5f96..e24d5c36 100644 --- a/neutrino-proxy-server/src/main/resources/sql/init-structure.sql +++ b/neutrino-proxy-server/src/main/resources/sql/init-structure.sql @@ -101,7 +101,7 @@ CREATE TABLE IF NOT EXISTS `user_connect_record` ( CREATE TABLE IF NOT EXISTS `job_info` ( `id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, `desc` VARCHAR(255) NOT NULL, - `handler` VARCHAR(255) DEFAULT NULL, + `handler` VARCHAR(255) NOT NULL, `cron` VARCHAR(128) NOT NULL , `param` VARCHAR(512) DEFAULT NULL, `alarm_email` VARCHAR(255) DEFAULT NULL,