From 3ccca8a39997e4abe8d33b26ca8944f04bdb0fcf Mon Sep 17 00:00:00 2001 From: mzhifa Date: Sat, 6 Apr 2024 18:11:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=8B=E8=AF=95=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E6=8E=A5=E5=8F=A3=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Txgy.RBS.DTO/GlobalConfigDTO.cs | 60 ++++++ Txgy.RBS.DTO/ProjectInfoDTO.cs | 184 +++++++++++++++++ Txgy.RBS.DTO/Reception/JWTTokenOptions.cs | 6 +- Txgy.RBS.DTO/ResultDTO.cs | 109 ++++++++++ Txgy.RBS.DTO/StationFileDTO.cs | 39 ++++ Txgy.RBS.DTO/StationNumVpnDTO.cs | 32 +++ Txgy.RBS.DTO/StationsDTO.cs | 95 +++++++++ Txgy.RBS.DTO/TimeTabDTO.cs | 46 +++++ Txgy.RBS.DbModel/CurrentMonitoring.cs | 15 -- Txgy.RBS.DbModel/CurrentWorkarea.cs | 14 -- Txgy.RBS.DbModel/Models/current_project.cs | 25 +++ Txgy.RBS.DbModel/Models/global_config.cs | 60 ++++++ Txgy.RBS.DbModel/Models/project_info.cs | 188 ++++++++++++++++++ Txgy.RBS.DbModel/Models/result.cs | 111 +++++++++++ Txgy.RBS.DbModel/Models/result_json.cs | 41 ++++ Txgy.RBS.DbModel/Models/station_file.cs | 41 ++++ Txgy.RBS.DbModel/Models/station_num_vpn.cs | 32 +++ Txgy.RBS.DbModel/Models/stations.cs | 97 +++++++++ Txgy.RBS.DbModel/Models/time_tab.cs | 48 +++++ Txgy.RBS.DbModel/MonitoringInfo.cs | 22 -- Txgy.RBS.DbModel/Result.cs | 39 ---- Txgy.RBS.DbModel/ResultJson.cs | 19 -- Txgy.RBS.DbModel/Workarea.cs | 59 ------ Txgy.RBS.Framework/CustomEnum/UserTypeEnum.cs | 26 --- Txgy.RBS.IServices/AutoMapObject.cs | 8 +- Txgy.RBS.IServices/IDataAccessService.cs | 28 --- Txgy.RBS.IServices/IGlobalConfigService.cs | 23 +++ Txgy.RBS.IServices/ILoginDal.cs | 10 - Txgy.RBS.IServices/IProjectInfoService.cs | 27 +++ Txgy.RBS.IServices/IResultInfoService.cs | 26 +++ Txgy.RBS.IServices/IStationsService.cs | 25 +++ Txgy.RBS.IServices/ITimeTabService.cs | 24 +++ Txgy.RBS.IServices/Setting.cs | 24 --- .../ProgramMigration.cs | 39 ++++ .../Txgy.RBS.Server.SqlSugarMigration.csproj | 14 ++ .../myModels/current_project.cs | 24 +++ .../myModels/global_config.cs | 59 ++++++ .../myModels/project_info.cs | 185 +++++++++++++++++ .../myModels/result.cs | 108 ++++++++++ .../myModels/result_json.cs | 38 ++++ .../myModels/station_file.cs | 38 ++++ .../myModels/station_num_vpn.cs | 31 +++ .../myModels/stations.cs | 94 +++++++++ .../myModels/time_tab.cs | 45 +++++ .../rbs_server_db.db | Bin 0 -> 77824 bytes Txgy.RBS.Server.WebApi.sln | 8 +- .../Controllers/GlobalConfigController.cs | 47 +++++ .../Controllers/ProjectInfoController.cs | 65 ++++++ .../Controllers/ResultInfoController.cs | 51 +++++ .../Controllers/StationsController.cs | 51 +++++ .../Controllers/TimeTabController.cs | 50 +++++ .../Controllers/WeatherForecastController.cs | 7 +- Txgy.RBS.Server.WebApi/Program.cs | 21 +- .../Register/HostBuilderExtend.cs | 2 +- Txgy.RBS.Server.WebApi/rbs_server_db.db | Bin 77824 -> 77824 bytes Txgy.RBS.Services/DataAccessService.cs | 43 ---- Txgy.RBS.Services/GlobalConfigService.cs | 59 ++++++ Txgy.RBS.Services/LoginService.cs | 14 -- Txgy.RBS.Services/ProjectInfoService.cs | 78 ++++++++ Txgy.RBS.Services/ResultInfoService.cs | 72 +++++++ Txgy.RBS.Services/StationsService.cs | 71 +++++++ Txgy.RBS.Services/TimeTabService.cs | 71 +++++++ 62 files changed, 2639 insertions(+), 349 deletions(-) create mode 100644 Txgy.RBS.DTO/GlobalConfigDTO.cs create mode 100644 Txgy.RBS.DTO/ProjectInfoDTO.cs create mode 100644 Txgy.RBS.DTO/ResultDTO.cs create mode 100644 Txgy.RBS.DTO/StationFileDTO.cs create mode 100644 Txgy.RBS.DTO/StationNumVpnDTO.cs create mode 100644 Txgy.RBS.DTO/StationsDTO.cs create mode 100644 Txgy.RBS.DTO/TimeTabDTO.cs delete mode 100644 Txgy.RBS.DbModel/CurrentMonitoring.cs delete mode 100644 Txgy.RBS.DbModel/CurrentWorkarea.cs create mode 100644 Txgy.RBS.DbModel/Models/current_project.cs create mode 100644 Txgy.RBS.DbModel/Models/global_config.cs create mode 100644 Txgy.RBS.DbModel/Models/project_info.cs create mode 100644 Txgy.RBS.DbModel/Models/result.cs create mode 100644 Txgy.RBS.DbModel/Models/result_json.cs create mode 100644 Txgy.RBS.DbModel/Models/station_file.cs create mode 100644 Txgy.RBS.DbModel/Models/station_num_vpn.cs create mode 100644 Txgy.RBS.DbModel/Models/stations.cs create mode 100644 Txgy.RBS.DbModel/Models/time_tab.cs delete mode 100644 Txgy.RBS.DbModel/MonitoringInfo.cs delete mode 100644 Txgy.RBS.DbModel/Result.cs delete mode 100644 Txgy.RBS.DbModel/ResultJson.cs delete mode 100644 Txgy.RBS.DbModel/Workarea.cs delete mode 100644 Txgy.RBS.Framework/CustomEnum/UserTypeEnum.cs delete mode 100644 Txgy.RBS.IServices/IDataAccessService.cs create mode 100644 Txgy.RBS.IServices/IGlobalConfigService.cs delete mode 100644 Txgy.RBS.IServices/ILoginDal.cs create mode 100644 Txgy.RBS.IServices/IProjectInfoService.cs create mode 100644 Txgy.RBS.IServices/IResultInfoService.cs create mode 100644 Txgy.RBS.IServices/IStationsService.cs create mode 100644 Txgy.RBS.IServices/ITimeTabService.cs delete mode 100644 Txgy.RBS.IServices/Setting.cs create mode 100644 Txgy.RBS.Server.SqlSugarMigration/ProgramMigration.cs create mode 100644 Txgy.RBS.Server.SqlSugarMigration/Txgy.RBS.Server.SqlSugarMigration.csproj create mode 100644 Txgy.RBS.Server.SqlSugarMigration/myModels/current_project.cs create mode 100644 Txgy.RBS.Server.SqlSugarMigration/myModels/global_config.cs create mode 100644 Txgy.RBS.Server.SqlSugarMigration/myModels/project_info.cs create mode 100644 Txgy.RBS.Server.SqlSugarMigration/myModels/result.cs create mode 100644 Txgy.RBS.Server.SqlSugarMigration/myModels/result_json.cs create mode 100644 Txgy.RBS.Server.SqlSugarMigration/myModels/station_file.cs create mode 100644 Txgy.RBS.Server.SqlSugarMigration/myModels/station_num_vpn.cs create mode 100644 Txgy.RBS.Server.SqlSugarMigration/myModels/stations.cs create mode 100644 Txgy.RBS.Server.SqlSugarMigration/myModels/time_tab.cs create mode 100644 Txgy.RBS.Server.SqlSugarMigration/rbs_server_db.db create mode 100644 Txgy.RBS.Server.WebApi/Controllers/GlobalConfigController.cs create mode 100644 Txgy.RBS.Server.WebApi/Controllers/ProjectInfoController.cs create mode 100644 Txgy.RBS.Server.WebApi/Controllers/ResultInfoController.cs create mode 100644 Txgy.RBS.Server.WebApi/Controllers/StationsController.cs create mode 100644 Txgy.RBS.Server.WebApi/Controllers/TimeTabController.cs delete mode 100644 Txgy.RBS.Services/DataAccessService.cs create mode 100644 Txgy.RBS.Services/GlobalConfigService.cs delete mode 100644 Txgy.RBS.Services/LoginService.cs create mode 100644 Txgy.RBS.Services/ProjectInfoService.cs create mode 100644 Txgy.RBS.Services/ResultInfoService.cs create mode 100644 Txgy.RBS.Services/StationsService.cs create mode 100644 Txgy.RBS.Services/TimeTabService.cs diff --git a/Txgy.RBS.DTO/GlobalConfigDTO.cs b/Txgy.RBS.DTO/GlobalConfigDTO.cs new file mode 100644 index 0000000..15770b8 --- /dev/null +++ b/Txgy.RBS.DTO/GlobalConfigDTO.cs @@ -0,0 +1,60 @@ +using System; +using System.Linq; +using System.Text; + +namespace Txgy.RBS.DbModel.Models +{ + /// + /// + /// + public partial class GlobalConfigDTO + { + public GlobalConfigDTO() + { + + + } + /// + /// Desc: + /// Default:"c:\\project" + /// Nullable:False + /// + public string base_path { get; set; } + + /// + /// Desc: + /// Default:"https://www.txgy.xyz/api/index/push" + /// Nullable:False + /// + public string push_wx_url { get; set; } + + /// + /// Desc: + /// Default:2 + /// Nullable:False + /// + public int push_wx_company_id { get; set; } + + /// + /// Desc: + /// Default:1 + /// Nullable:False + /// + public int push_wx_message_id { get; set; } + + /// + /// Desc: + /// Default:事件通知 + /// Nullable:False + /// + public string push_wx_content { get; set; } + + /// + /// Desc: + /// Default:Y3qYFBQPMbfTt6m + /// Nullable:False + /// + public string push_wx_key { get; set; } + + } +} diff --git a/Txgy.RBS.DTO/ProjectInfoDTO.cs b/Txgy.RBS.DTO/ProjectInfoDTO.cs new file mode 100644 index 0000000..66b6134 --- /dev/null +++ b/Txgy.RBS.DTO/ProjectInfoDTO.cs @@ -0,0 +1,184 @@ +using System; +using System.Linq; +using System.Text; + +namespace Txgy.RBS.DbModel.Models +{ + /// + /// + /// + public class ProjectInfoDTO + { + public ProjectInfoDTO() + { + } + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int id { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public string project_name { get; set; } + + /// + /// Desc: + /// Default:1 + /// Nullable:False + /// + public int moni_layer { get; set; } + + /// + /// Desc: + /// Default:1 + /// Nullable:False + /// + public int moni_num { get; set; } + + /// + /// Desc: + /// Default:"2024-04-01" + /// Nullable:False + /// + public string moni_date { get; set; } + + /// + /// Desc: + /// Default:YA + /// Nullable:False + /// + public string network { get; set; } + + /// + /// Desc: + /// Default:"06" + /// Nullable:False + /// + public string location { get; set; } + + /// + /// Desc: + /// Default:"SHZ:SHN:SHE" + /// Nullable:False + /// + public string channels { get; set; } + + /// + /// Desc: + /// Default:3837 + /// Nullable:False + /// + public double xmin { get; set; } + + /// + /// Desc: + /// Default:3838 + /// Nullable:False + /// + public double xmax { get; set; } + + /// + /// Desc: + /// Default:402 + /// Nullable:False + /// + public double ymin { get; set; } + + /// + /// Desc: + /// Default:403 + /// Nullable:False + /// + public double ymax { get; set; } + + /// + /// Desc: + /// Default:200 + /// Nullable:False + /// + public double zmin { get; set; } + + /// + /// Desc: + /// Default:900 + /// Nullable:False + /// + public double zmax { get; set; } + + /// + /// Desc: + /// Default:0 + /// Nullable:False + /// + public int local_save_result { get; set; } + + /// + /// Desc: + /// Default:result + /// Nullable:False + /// + public string save_result_path { get; set; } + + /// + /// Desc: + /// Default:0 + /// Nullable:False + /// + public int local_save_waves { get; set; } + + /// + /// Desc: + /// Default:wavesdata + /// Nullable:False + /// + public string save_waves_path { get; set; } + + /// + /// Desc: + /// Default:1 + /// Nullable:False + /// + public int send_redis { get; set; } + + /// + /// Desc: + /// Default:"127.0.0.1:1883" + /// Nullable:False + /// + public string mqtt_server { get; set; } + + /// + /// Desc: + /// Default:0 + /// Nullable:False + /// + public int push_wx { get; set; } + + /// + /// Desc: + /// Default:- 1.0 + /// Nullable:False + /// + public double push_wx_value { get; set; } + + /// + /// Desc: + /// Default:8 + /// Nullable:False + /// + public int push_wx_area_id { get; set; } + + /// + /// Desc: + /// Default:2 + /// Nullable:False + /// + public int push_wx_company_id { get; set; } + + } +} diff --git a/Txgy.RBS.DTO/Reception/JWTTokenOptions.cs b/Txgy.RBS.DTO/Reception/JWTTokenOptions.cs index 9bec159..a2bbdc6 100644 --- a/Txgy.RBS.DTO/Reception/JWTTokenOptions.cs +++ b/Txgy.RBS.DTO/Reception/JWTTokenOptions.cs @@ -17,11 +17,7 @@ namespace Txgy.RBS.DTO.Reception get; set; } - //public SigningCredentials Credentials - //{ - // get; - // set; - //} + public string? Issuer { get; diff --git a/Txgy.RBS.DTO/ResultDTO.cs b/Txgy.RBS.DTO/ResultDTO.cs new file mode 100644 index 0000000..3471bf9 --- /dev/null +++ b/Txgy.RBS.DTO/ResultDTO.cs @@ -0,0 +1,109 @@ +using System; +using System.Linq; +using System.Text; + +namespace Txgy.RBS.DbModel.Models +{ + /// + /// + /// + public partial class ResultDTO + { + public ResultDTO() + { + + + } + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public int id { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? project_id { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string otime { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? e { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? n { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? depth { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? ml { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? energy { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? rms { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? phases_count { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? amps_count { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string seismic_source { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? seismic_direction { get; set; } + + } +} diff --git a/Txgy.RBS.DTO/StationFileDTO.cs b/Txgy.RBS.DTO/StationFileDTO.cs new file mode 100644 index 0000000..c9fe958 --- /dev/null +++ b/Txgy.RBS.DTO/StationFileDTO.cs @@ -0,0 +1,39 @@ +using System; +using System.Linq; +using System.Text; + +namespace Txgy.RBS.DbModel.Models +{ + /// + /// + /// + public partial class StationFileDTO + { + public StationFileDTO() + { + + + } + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? id { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public int project_id { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string file_name { get; set; } + + } +} diff --git a/Txgy.RBS.DTO/StationNumVpnDTO.cs b/Txgy.RBS.DTO/StationNumVpnDTO.cs new file mode 100644 index 0000000..443c247 --- /dev/null +++ b/Txgy.RBS.DTO/StationNumVpnDTO.cs @@ -0,0 +1,32 @@ +using System; +using System.Linq; +using System.Text; + +namespace Txgy.RBS.DbModel.Models +{ + /// + /// + /// + public partial class StationNumVpnDTO + { + public StationNumVpnDTO() + { + + + } + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string num { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string vpn_name { get; set; } + + } +} diff --git a/Txgy.RBS.DTO/StationsDTO.cs b/Txgy.RBS.DTO/StationsDTO.cs new file mode 100644 index 0000000..e2fa898 --- /dev/null +++ b/Txgy.RBS.DTO/StationsDTO.cs @@ -0,0 +1,95 @@ +using System; +using System.Linq; +using System.Text; + +namespace Txgy.RBS.DbModel.Models +{ + /// + /// + /// + public partial class StationsDTO + { + public StationsDTO() + { + + + } + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int id { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public int project_id { get; set; } + + /// + /// Desc: + /// Default:YA + /// Nullable:False + /// + public string network { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public string num { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public double coord_e { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public double coord_n { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public double altitude { get; set; } + + /// + /// Desc: + /// Default:3200000000 + /// Nullable:False + /// + public int sens { get; set; } + + /// + /// Desc: + /// Default:"2023-01-01T00:00:00.000" + /// Nullable:False + /// + public string begin_time { get; set; } + + /// + /// Desc: + /// Default:"2026-12-31T23:59:59.000" + /// Nullable:False + /// + public string end_time { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public string site_number { get; set; } + + } +} diff --git a/Txgy.RBS.DTO/TimeTabDTO.cs b/Txgy.RBS.DTO/TimeTabDTO.cs new file mode 100644 index 0000000..2415b32 --- /dev/null +++ b/Txgy.RBS.DTO/TimeTabDTO.cs @@ -0,0 +1,46 @@ +using System; +using System.Linq; +using System.Text; + +namespace Txgy.RBS.DbModel.Models +{ + /// + /// + /// + public partial class TimeTabDTO + { + public TimeTabDTO() + { + + + } + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int id { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? project_id { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string filename { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string file_content { get; set; } + + } +} diff --git a/Txgy.RBS.DbModel/CurrentMonitoring.cs b/Txgy.RBS.DbModel/CurrentMonitoring.cs deleted file mode 100644 index 4981508..0000000 --- a/Txgy.RBS.DbModel/CurrentMonitoring.cs +++ /dev/null @@ -1,15 +0,0 @@ -using SqlSugar; -using System; -using System.Collections.Generic; -using System.Text; - -namespace Txgy.RBS.DbModel -{ - - [SugarTable("current_monitoring")] - public class CurrentMonitoring - { - [SugarColumn(ColumnName = "current_moni_id", IsPrimaryKey = true, IsIdentity = true)] - public int CurrentMoniId { get; set; } - } -} diff --git a/Txgy.RBS.DbModel/CurrentWorkarea.cs b/Txgy.RBS.DbModel/CurrentWorkarea.cs deleted file mode 100644 index 843e3a5..0000000 --- a/Txgy.RBS.DbModel/CurrentWorkarea.cs +++ /dev/null @@ -1,14 +0,0 @@ -using SqlSugar; -using System; -using System.Collections.Generic; -using System.Text; - -namespace Txgy.RBS.DbModel -{ - [SugarTable("current_workarea")] - public class CurrentWorkarea - { - [SugarColumn(ColumnName = "current_workarea_id", IsPrimaryKey = true, IsIdentity = true)] - public int CurrentWorkareaId { get; set; } - } -} diff --git a/Txgy.RBS.DbModel/Models/current_project.cs b/Txgy.RBS.DbModel/Models/current_project.cs new file mode 100644 index 0000000..cf1c551 --- /dev/null +++ b/Txgy.RBS.DbModel/Models/current_project.cs @@ -0,0 +1,25 @@ +using System; +using System.Linq; +using System.Text; + +namespace Txgy.RBS.DbModel.Models +{ + /// + /// + /// + public partial class current_project + { + public current_project() + { + + + } + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public int current_project_id { get; set; } + + } +} diff --git a/Txgy.RBS.DbModel/Models/global_config.cs b/Txgy.RBS.DbModel/Models/global_config.cs new file mode 100644 index 0000000..2e61a8a --- /dev/null +++ b/Txgy.RBS.DbModel/Models/global_config.cs @@ -0,0 +1,60 @@ +using System; +using System.Linq; +using System.Text; + +namespace Txgy.RBS.DbModel.Models +{ + /// + /// + /// + public partial class global_config + { + public global_config() + { + + + } + /// + /// Desc: + /// Default:"c:\\project" + /// Nullable:False + /// + public string base_path { get; set; } + + /// + /// Desc: + /// Default:"https://www.txgy.xyz/api/index/push" + /// Nullable:False + /// + public string push_wx_url { get; set; } + + /// + /// Desc: + /// Default:2 + /// Nullable:False + /// + public int push_wx_company_id { get; set; } + + /// + /// Desc: + /// Default:1 + /// Nullable:False + /// + public int push_wx_message_id { get; set; } + + /// + /// Desc: + /// Default:事件通知 + /// Nullable:False + /// + public string push_wx_content { get; set; } + + /// + /// Desc: + /// Default:Y3qYFBQPMbfTt6m + /// Nullable:False + /// + public string push_wx_key { get; set; } + + } +} diff --git a/Txgy.RBS.DbModel/Models/project_info.cs b/Txgy.RBS.DbModel/Models/project_info.cs new file mode 100644 index 0000000..207fdf9 --- /dev/null +++ b/Txgy.RBS.DbModel/Models/project_info.cs @@ -0,0 +1,188 @@ +using SqlSugar; +using System; +using System.Linq; +using System.Text; + +namespace Txgy.RBS.DbModel.Models +{ + /// + /// + /// + public partial class project_info + { + public project_info() + { + + + } + /// + /// Desc: + /// Default: + /// Nullable:True + /// + [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + public int id { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public string project_name { get; set; } + + /// + /// Desc: + /// Default:1 + /// Nullable:False + /// + public int moni_layer { get; set; } + + /// + /// Desc: + /// Default:1 + /// Nullable:False + /// + public int moni_num { get; set; } + + /// + /// Desc: + /// Default:"2024-04-01" + /// Nullable:False + /// + public string moni_date { get; set; } + + /// + /// Desc: + /// Default:YA + /// Nullable:False + /// + public string network { get; set; } + + /// + /// Desc: + /// Default:"06" + /// Nullable:False + /// + public string location { get; set; } + + /// + /// Desc: + /// Default:"SHZ:SHN:SHE" + /// Nullable:False + /// + public string channels { get; set; } + + /// + /// Desc: + /// Default:3837 + /// Nullable:False + /// + public double xmin { get; set; } + + /// + /// Desc: + /// Default:3838 + /// Nullable:False + /// + public double xmax { get; set; } + + /// + /// Desc: + /// Default:402 + /// Nullable:False + /// + public double ymin { get; set; } + + /// + /// Desc: + /// Default:403 + /// Nullable:False + /// + public double ymax { get; set; } + + /// + /// Desc: + /// Default:200 + /// Nullable:False + /// + public double zmin { get; set; } + + /// + /// Desc: + /// Default:900 + /// Nullable:False + /// + public double zmax { get; set; } + + /// + /// Desc: + /// Default:0 + /// Nullable:False + /// + public int local_save_result { get; set; } + + /// + /// Desc: + /// Default:result + /// Nullable:False + /// + public string save_result_path { get; set; } + + /// + /// Desc: + /// Default:0 + /// Nullable:False + /// + public int local_save_waves { get; set; } + + /// + /// Desc: + /// Default:wavesdata + /// Nullable:False + /// + public string save_waves_path { get; set; } + + /// + /// Desc: + /// Default:1 + /// Nullable:False + /// + public int send_redis { get; set; } + + /// + /// Desc: + /// Default:"127.0.0.1:1883" + /// Nullable:False + /// + public string mqtt_server { get; set; } + + /// + /// Desc: + /// Default:0 + /// Nullable:False + /// + public int push_wx { get; set; } + + /// + /// Desc: + /// Default:- 1.0 + /// Nullable:False + /// + public double push_wx_value { get; set; } + + /// + /// Desc: + /// Default:8 + /// Nullable:False + /// + public int push_wx_area_id { get; set; } + + /// + /// Desc: + /// Default:2 + /// Nullable:False + /// + public int push_wx_company_id { get; set; } + + } +} diff --git a/Txgy.RBS.DbModel/Models/result.cs b/Txgy.RBS.DbModel/Models/result.cs new file mode 100644 index 0000000..0454d3c --- /dev/null +++ b/Txgy.RBS.DbModel/Models/result.cs @@ -0,0 +1,111 @@ +using SqlSugar; +using System; +using System.Linq; +using System.Text; + +namespace Txgy.RBS.DbModel.Models +{ + /// + /// + /// + public partial class result + { + public result() + { + + + } + /// + /// Desc: + /// Default: + /// Nullable:False + /// + [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + public int id { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? project_id { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string otime { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? e { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? n { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? depth { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? ml { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? energy { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? rms { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? phases_count { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? amps_count { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string seismic_source { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? seismic_direction { get; set; } + + } +} diff --git a/Txgy.RBS.DbModel/Models/result_json.cs b/Txgy.RBS.DbModel/Models/result_json.cs new file mode 100644 index 0000000..95c52dd --- /dev/null +++ b/Txgy.RBS.DbModel/Models/result_json.cs @@ -0,0 +1,41 @@ +using SqlSugar; +using System; +using System.Linq; +using System.Text; + +namespace Txgy.RBS.DbModel.Models +{ + /// + /// + /// + public partial class result_json + { + public result_json() + { + + + } + /// + /// Desc: + /// Default: + /// Nullable:False + /// + [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + public int id { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? result_id { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string json { get; set; } + + } +} diff --git a/Txgy.RBS.DbModel/Models/station_file.cs b/Txgy.RBS.DbModel/Models/station_file.cs new file mode 100644 index 0000000..f6f9d7f --- /dev/null +++ b/Txgy.RBS.DbModel/Models/station_file.cs @@ -0,0 +1,41 @@ +using SqlSugar; +using System; +using System.Linq; +using System.Text; + +namespace Txgy.RBS.DbModel.Models +{ + /// + /// + /// + public partial class station_file + { + public station_file() + { + + + } + /// + /// Desc: + /// Default: + /// Nullable:True + /// + [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + public int id { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public int project_id { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string file_name { get; set; } + + } +} diff --git a/Txgy.RBS.DbModel/Models/station_num_vpn.cs b/Txgy.RBS.DbModel/Models/station_num_vpn.cs new file mode 100644 index 0000000..0ecd269 --- /dev/null +++ b/Txgy.RBS.DbModel/Models/station_num_vpn.cs @@ -0,0 +1,32 @@ +using System; +using System.Linq; +using System.Text; + +namespace Txgy.RBS.DbModel.Models +{ + /// + /// + /// + public partial class station_num_vpn + { + public station_num_vpn() + { + + + } + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string num { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string vpn_name { get; set; } + + } +} diff --git a/Txgy.RBS.DbModel/Models/stations.cs b/Txgy.RBS.DbModel/Models/stations.cs new file mode 100644 index 0000000..3ebcdcc --- /dev/null +++ b/Txgy.RBS.DbModel/Models/stations.cs @@ -0,0 +1,97 @@ +using SqlSugar; +using System; +using System.Linq; +using System.Text; + +namespace Txgy.RBS.DbModel.Models +{ + /// + /// + /// + public partial class stations + { + public stations() + { + + + } + /// + /// Desc: + /// Default: + /// Nullable:True + /// + [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + public int id { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public int project_id { get; set; } + + /// + /// Desc: + /// Default:YA + /// Nullable:False + /// + public string network { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public string num { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public double coord_e { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public double coord_n { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public double altitude { get; set; } + + /// + /// Desc: + /// Default:3200000000 + /// Nullable:False + /// + public int sens { get; set; } + + /// + /// Desc: + /// Default:"2023-01-01T00:00:00.000" + /// Nullable:False + /// + public string begin_time { get; set; } + + /// + /// Desc: + /// Default:"2026-12-31T23:59:59.000" + /// Nullable:False + /// + public string end_time { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public string site_number { get; set; } + + } +} diff --git a/Txgy.RBS.DbModel/Models/time_tab.cs b/Txgy.RBS.DbModel/Models/time_tab.cs new file mode 100644 index 0000000..19e6f01 --- /dev/null +++ b/Txgy.RBS.DbModel/Models/time_tab.cs @@ -0,0 +1,48 @@ +using SqlSugar; +using System; +using System.Linq; +using System.Text; + +namespace Txgy.RBS.DbModel.Models +{ + /// + /// + /// + public partial class time_tab + { + public time_tab() + { + + + } + /// + /// Desc: + /// Default: + /// Nullable:True + /// + [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + public int id { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? project_id { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string filename { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string file_content { get; set; } + + } +} diff --git a/Txgy.RBS.DbModel/MonitoringInfo.cs b/Txgy.RBS.DbModel/MonitoringInfo.cs deleted file mode 100644 index 441afc3..0000000 --- a/Txgy.RBS.DbModel/MonitoringInfo.cs +++ /dev/null @@ -1,22 +0,0 @@ -using SqlSugar; -using System; -using System.Collections.Generic; -using System.Text; - -namespace Txgy.RBS.DbModel -{ - [SugarTable("monitoring_info")] - public class MonitoringInfo - { - [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)] - public int Id { get; set; } - [SugarColumn(ColumnName = "work_area_id")] - public int WorkAreaId { get; set; } - [SugarColumn(ColumnName = "layer_num")] - public int LayerNum { get; set; } - [SugarColumn(ColumnName = "moni_num")] - public int MoniNum { get; set; } - [SugarColumn(ColumnName = "moni_date")] - public string MoniDate { get; set; } - } -} diff --git a/Txgy.RBS.DbModel/Result.cs b/Txgy.RBS.DbModel/Result.cs deleted file mode 100644 index 37984ae..0000000 --- a/Txgy.RBS.DbModel/Result.cs +++ /dev/null @@ -1,39 +0,0 @@ -using SqlSugar; -using System; -using System.Collections.Generic; -using System.Text; - -namespace Txgy.RBS.DbModel -{ - - [SugarTable("result")] - public class Result - { - [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)] - public int Id { get; set; } - [SugarColumn(ColumnName = "project_id")] - public int ProjectId { get; set; } - [SugarColumn(ColumnName = "otime")] - public string Otime { get; set; } - [SugarColumn(ColumnName = "e")] - public double E { get; set; } - [SugarColumn(ColumnName = "n")] - public double N { get; set; } - [SugarColumn(ColumnName = "depth")] - public double Depth { get; set; } - [SugarColumn(ColumnName = "ml")] - public double Ml { get; set; } - [SugarColumn(ColumnName = "energy")] - public double Energy { get; set; } - [SugarColumn(ColumnName = "rms")] - public double Rms { get; set; } - [SugarColumn(ColumnName = "phases_count")] - public int PhasesCount { get; set; } - [SugarColumn(ColumnName = "amps_count")] - public int AmpsCount { get; set; } - [SugarColumn(ColumnName = "seismic_source")] - public string SeismicSource { get; set; } - [SugarColumn(ColumnName = "seismic_direction")] - public double SeismicDirection { get; set; } - } -} diff --git a/Txgy.RBS.DbModel/ResultJson.cs b/Txgy.RBS.DbModel/ResultJson.cs deleted file mode 100644 index 3396934..0000000 --- a/Txgy.RBS.DbModel/ResultJson.cs +++ /dev/null @@ -1,19 +0,0 @@ -using SqlSugar; -using System; -using System.Collections.Generic; -using System.Text; - -namespace Txgy.RBS.DbModel -{ - - [SugarTable("result_json")] - public class ResultJson - { - [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)] - public int Id { get; set; } - [SugarColumn(ColumnName = "result_id")] - public int ResultId { get; set; } - [SugarColumn(ColumnName = "json")] - public string Json { get; set; } - } -} diff --git a/Txgy.RBS.DbModel/Workarea.cs b/Txgy.RBS.DbModel/Workarea.cs deleted file mode 100644 index 39bf472..0000000 --- a/Txgy.RBS.DbModel/Workarea.cs +++ /dev/null @@ -1,59 +0,0 @@ -using SqlSugar; -using System; -using System.Collections.Generic; -using System.Text; - -namespace Txgy.RBS.DbModel -{ - - [SugarTable("workarea")] - public class Workarea - { - [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)] - public int Id { get; set; } - [SugarColumn(ColumnName = "name")] - public string Name { get; set; } - [SugarColumn(ColumnName = "csv_path")] - public string CsvPath { get; set; } - [SugarColumn(ColumnName = "ttime_path")] - public string TtimePath { get; set; } - [SugarColumn(ColumnName = "x_min")] - public double Xmin { get; set; } - [SugarColumn(ColumnName = "x_max")] - public double Xmax { get; set; } - [SugarColumn(ColumnName = "y_min")] - public double Ymin { get; set; } - [SugarColumn(ColumnName = "y_max")] - public double Ymax { get; set; } - [SugarColumn(ColumnName = "z_min")] - public double Zmin { get; set; } - [SugarColumn(ColumnName = "z_max")] - public double Zmax { get; set; } - [SugarColumn(ColumnName = "save_result")] - public int SaveResult { get; set; } - [SugarColumn(ColumnName = "save_result_path")] - public string SaveResultPath { get; set; } - [SugarColumn(ColumnName = "push_wx")] - public int PushWx { get; set; } - [SugarColumn(ColumnName = "push_wx_value")] - public double PushWxValue { get; set; } - [SugarColumn(ColumnName = "push_dd")] - public int PushDd { get; set; } - [SugarColumn(ColumnName = "push_dd_value")] - public double PushDdValue { get; set; } - [SugarColumn(ColumnName = "save_waves")] - public int SaveWaves { get; set; } - [SugarColumn(ColumnName = "save_waves_path")] - public double SaveWavesPath { get; set; } - [SugarColumn(ColumnName = "send_redis")] - public int SendRedis { get; set; } - [SugarColumn(ColumnName = "mqtt_Server")] - public string MqttServer { get; set; } - [SugarColumn(ColumnName = "network")] - public string Network { get; set; } - [SugarColumn(ColumnName = "location")] - public string Location { get; set; } - [SugarColumn(ColumnName = "channels")] - public string Channels { get; set; } - } -} diff --git a/Txgy.RBS.Framework/CustomEnum/UserTypeEnum.cs b/Txgy.RBS.Framework/CustomEnum/UserTypeEnum.cs deleted file mode 100644 index 769c393..0000000 --- a/Txgy.RBS.Framework/CustomEnum/UserTypeEnum.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace Txgy.RBS.Framework.CustomEnum -{ - /// - /// 用户类别 - /// - public enum UserTypeEnum - { - /// - /// 后台用户 - /// - [Remark("后台用户")] - Administrators = 1, - - /// - /// 普通用户 - /// - [Remark("普通用户")] - Member = 2, - - /// - /// 主播用户 - /// - [Remark("主播用户")] - Anchor = 3 - } -} diff --git a/Txgy.RBS.IServices/AutoMapObject.cs b/Txgy.RBS.IServices/AutoMapObject.cs index e8240f4..a9cb059 100644 --- a/Txgy.RBS.IServices/AutoMapObject.cs +++ b/Txgy.RBS.IServices/AutoMapObject.cs @@ -1,5 +1,6 @@ using AutoMapper; using Txgy.RBS.DbModel; +using Txgy.RBS.DbModel.Models; using Txgy.RBS.DTO; using Txgy.RBS.DTO.Reception; using Txgy.RBS.Framework; @@ -10,9 +11,10 @@ namespace Txgy.RBS.IServices { public AutoMapObject() { - CreateMap().ReverseMap(); - //CreateMap().ReverseMap(); - //CreateMap, PagingData>(); + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); } } } diff --git a/Txgy.RBS.IServices/IDataAccessService.cs b/Txgy.RBS.IServices/IDataAccessService.cs deleted file mode 100644 index 8500cd9..0000000 --- a/Txgy.RBS.IServices/IDataAccessService.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Txgy.RBS.IServices -{ - public interface IDataAccessService - { - List GetIcons(); - - /// - /// 获取客户端类型 - /// - /// - Setting GetClientType(int useId = 1); - - void UpdateClientDetail(double createTime, int mailRule, string mailbox, string appMessage); - /// - /// 根据车道ID获取对应的设备信息 - /// - /// - /// - string GetDevices(int roadId); - void UpdateDeviceType(int currentDevice); - } -} diff --git a/Txgy.RBS.IServices/IGlobalConfigService.cs b/Txgy.RBS.IServices/IGlobalConfigService.cs new file mode 100644 index 0000000..b51005a --- /dev/null +++ b/Txgy.RBS.IServices/IGlobalConfigService.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Txgy.RBS.DbModel.Models; +using Txgy.RBS.Framework.Api; +using Txgy.RBS.IServices; + +namespace Txgy.RBS.IServices +{ + public interface IGlobalConfigService : IBaseService + { + ApiResult AddGlobalConfig(GlobalConfigDTO globalConfigDTO); + + ApiResult UpdateGlobalConfig(GlobalConfigDTO globalConfigDTO); + + GlobalConfigDTO GetGlobalConfig(int id); + + List GetAllGlobalConfig(); + + } +} diff --git a/Txgy.RBS.IServices/ILoginDal.cs b/Txgy.RBS.IServices/ILoginDal.cs deleted file mode 100644 index 5144a74..0000000 --- a/Txgy.RBS.IServices/ILoginDal.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Txgy.RBS.IServices -{ - public interface ILoginService : IBaseService - { - } -} \ No newline at end of file diff --git a/Txgy.RBS.IServices/IProjectInfoService.cs b/Txgy.RBS.IServices/IProjectInfoService.cs new file mode 100644 index 0000000..d71936b --- /dev/null +++ b/Txgy.RBS.IServices/IProjectInfoService.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Txgy.RBS.DbModel.Models; +using Txgy.RBS.Framework.Api; +using Txgy.RBS.IServices; + +namespace Txgy.RBS.IServices +{ + public interface IProjectInfoService : IBaseService + { + ApiResult AddProjectInfo(ProjectInfoDTO project); + + ApiResult DeleteProjectInfo(int id); + + ApiResult UpdateProjectInfo(ProjectInfoDTO project); + + ProjectInfoDTO GetProjectInfo(int id); + + List GetAllProjectInfo(); + + ProjectInfoDTO GetCurrentProjectInfo(); + + } +} diff --git a/Txgy.RBS.IServices/IResultInfoService.cs b/Txgy.RBS.IServices/IResultInfoService.cs new file mode 100644 index 0000000..4e70673 --- /dev/null +++ b/Txgy.RBS.IServices/IResultInfoService.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Txgy.RBS.DbModel.Models; +using Txgy.RBS.DTO; +using Txgy.RBS.Framework.Api; +using Txgy.RBS.IServices; + +namespace Txgy.RBS.IServices +{ + public interface IResultInfoService : IBaseService + { + ApiResult AddResultInfo(ResultJsonDTO resultJsonDTO); + + ApiResult DeleteResultInfo(int id); + + ApiResult UpdateResultInfo(ResultJsonDTO resultJsonDTO); + + ResultJsonDTO GetResultInfo(int id); + + List GetAllResultInfo(); + + } +} diff --git a/Txgy.RBS.IServices/IStationsService.cs b/Txgy.RBS.IServices/IStationsService.cs new file mode 100644 index 0000000..10a6c39 --- /dev/null +++ b/Txgy.RBS.IServices/IStationsService.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Txgy.RBS.DbModel.Models; +using Txgy.RBS.Framework.Api; +using Txgy.RBS.IServices; + +namespace Txgy.RBS.IServices +{ + public interface IStationsService : IBaseService + { + ApiResult AddStations(StationsDTO stationsDTO); + + ApiResult DeleteStations(int id); + + ApiResult UpdateStations(StationsDTO stationsDTO); + + StationsDTO GetStations(int id); + + List GetAllStations(); + + } +} diff --git a/Txgy.RBS.IServices/ITimeTabService.cs b/Txgy.RBS.IServices/ITimeTabService.cs new file mode 100644 index 0000000..d0a7310 --- /dev/null +++ b/Txgy.RBS.IServices/ITimeTabService.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Txgy.RBS.DbModel.Models; +using Txgy.RBS.Framework.Api; +using Txgy.RBS.IServices; + +namespace Txgy.RBS.IServices +{ + public interface ITimeTabService : IBaseService + { + ApiResult AddTimeTab(TimeTabDTO timeTabDTO); + + ApiResult DeleteTimeTab(int id); + + ApiResult UpdateTimeTab(TimeTabDTO timeTabDTO); + + TimeTabDTO GetTimeTab(int id); + + List GetAllTimeTab(); + } +} diff --git a/Txgy.RBS.IServices/Setting.cs b/Txgy.RBS.IServices/Setting.cs deleted file mode 100644 index 985a90e..0000000 --- a/Txgy.RBS.IServices/Setting.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Txgy.RBS.IServices -{ - public class Setting - { - public int ClientType { get; set; } - - public string Mailbox { get; set; } - - public int MailRule { get; set; } - - //为了统计1个整月的数据,如果修改时间超过每月28号统一设置成每月28号; - public double CreateTime { get; set; } - - public int CurrentDevice { get; set; } - - public string AppMessage { get; set; } - } -} diff --git a/Txgy.RBS.Server.SqlSugarMigration/ProgramMigration.cs b/Txgy.RBS.Server.SqlSugarMigration/ProgramMigration.cs new file mode 100644 index 0000000..5cf4e9f --- /dev/null +++ b/Txgy.RBS.Server.SqlSugarMigration/ProgramMigration.cs @@ -0,0 +1,39 @@ +// See https://aka.ms/new-console-template for more information + +using SqlSugar; +using System.Data; + +Console.WriteLine("------SqlSugar生成实体对象~~"); +try +{ + var connetctionlist = new List() + { + //第一个从库 + new SlaveConnectionConfig(){ + HitRate=10, + ConnectionString="Data Source=rbs_server_db.db" + } + }; + + ConnectionConfig connectionConfig1 = new ConnectionConfig() + { + DbType = SqlSugar.DbType.Sqlite, + ConnectionString = "Data Source=rbs_server_db.db", + InitKeyType = InitKeyType.Attribute, + //IsAutoCloseConnection = true, + //SlaveConnectionConfigs = connetctionlist + }; + + using (ISqlSugarClient client = new SqlSugarClient(connectionConfig1)) + { + //一、基于数据库生成实体对象--DbFirst + { + client.DbFirst.CreateClassFile(@"..\..\..\myModels"); + } + } +} +catch (Exception) +{ + + throw; +} diff --git a/Txgy.RBS.Server.SqlSugarMigration/Txgy.RBS.Server.SqlSugarMigration.csproj b/Txgy.RBS.Server.SqlSugarMigration/Txgy.RBS.Server.SqlSugarMigration.csproj new file mode 100644 index 0000000..0cef0ee --- /dev/null +++ b/Txgy.RBS.Server.SqlSugarMigration/Txgy.RBS.Server.SqlSugarMigration.csproj @@ -0,0 +1,14 @@ + + + + Exe + net6.0 + enable + enable + + + + + + + diff --git a/Txgy.RBS.Server.SqlSugarMigration/myModels/current_project.cs b/Txgy.RBS.Server.SqlSugarMigration/myModels/current_project.cs new file mode 100644 index 0000000..4d94f54 --- /dev/null +++ b/Txgy.RBS.Server.SqlSugarMigration/myModels/current_project.cs @@ -0,0 +1,24 @@ +using System; +using System.Linq; +using System.Text; + +namespace Models +{ + /// + /// + /// + public partial class current_project + { + public current_project(){ + + + } + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public int current_project_id {get;set;} + + } +} diff --git a/Txgy.RBS.Server.SqlSugarMigration/myModels/global_config.cs b/Txgy.RBS.Server.SqlSugarMigration/myModels/global_config.cs new file mode 100644 index 0000000..6f42b2c --- /dev/null +++ b/Txgy.RBS.Server.SqlSugarMigration/myModels/global_config.cs @@ -0,0 +1,59 @@ +using System; +using System.Linq; +using System.Text; + +namespace Models +{ + /// + /// + /// + public partial class global_config + { + public global_config(){ + + + } + /// + /// Desc: + /// Default:"c:\\project" + /// Nullable:False + /// + public string base_path {get;set;} + + /// + /// Desc: + /// Default:"https://www.txgy.xyz/api/index/push" + /// Nullable:False + /// + public string push_wx_url {get;set;} + + /// + /// Desc: + /// Default:2 + /// Nullable:False + /// + public int push_wx_company_id {get;set;} + + /// + /// Desc: + /// Default:1 + /// Nullable:False + /// + public int push_wx_message_id {get;set;} + + /// + /// Desc: + /// Default:事件通知 + /// Nullable:False + /// + public string push_wx_content {get;set;} + + /// + /// Desc: + /// Default:Y3qYFBQPMbfTt6m + /// Nullable:False + /// + public string push_wx_key {get;set;} + + } +} diff --git a/Txgy.RBS.Server.SqlSugarMigration/myModels/project_info.cs b/Txgy.RBS.Server.SqlSugarMigration/myModels/project_info.cs new file mode 100644 index 0000000..db08b30 --- /dev/null +++ b/Txgy.RBS.Server.SqlSugarMigration/myModels/project_info.cs @@ -0,0 +1,185 @@ +using System; +using System.Linq; +using System.Text; + +namespace Models +{ + /// + /// + /// + public partial class project_info + { + public project_info(){ + + + } + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? id {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public string project_name {get;set;} + + /// + /// Desc: + /// Default:1 + /// Nullable:False + /// + public int moni_layer {get;set;} + + /// + /// Desc: + /// Default:1 + /// Nullable:False + /// + public int moni_num {get;set;} + + /// + /// Desc: + /// Default:"2024-04-01" + /// Nullable:False + /// + public string moni_date {get;set;} + + /// + /// Desc: + /// Default:YA + /// Nullable:False + /// + public string network {get;set;} + + /// + /// Desc: + /// Default:"06" + /// Nullable:False + /// + public string location {get;set;} + + /// + /// Desc: + /// Default:"SHZ:SHN:SHE" + /// Nullable:False + /// + public string channels {get;set;} + + /// + /// Desc: + /// Default:3837 + /// Nullable:False + /// + public double xmin {get;set;} + + /// + /// Desc: + /// Default:3838 + /// Nullable:False + /// + public double xmax {get;set;} + + /// + /// Desc: + /// Default:402 + /// Nullable:False + /// + public double ymin {get;set;} + + /// + /// Desc: + /// Default:403 + /// Nullable:False + /// + public double ymax {get;set;} + + /// + /// Desc: + /// Default:200 + /// Nullable:False + /// + public double zmin {get;set;} + + /// + /// Desc: + /// Default:900 + /// Nullable:False + /// + public double zmax {get;set;} + + /// + /// Desc: + /// Default:0 + /// Nullable:False + /// + public int local_save_result {get;set;} + + /// + /// Desc: + /// Default:result + /// Nullable:False + /// + public string save_result_path {get;set;} + + /// + /// Desc: + /// Default:0 + /// Nullable:False + /// + public int local_save_waves {get;set;} + + /// + /// Desc: + /// Default:wavesdata + /// Nullable:False + /// + public string save_waves_path {get;set;} + + /// + /// Desc: + /// Default:1 + /// Nullable:False + /// + public int send_redis {get;set;} + + /// + /// Desc: + /// Default:"127.0.0.1:1883" + /// Nullable:False + /// + public string mqtt_server {get;set;} + + /// + /// Desc: + /// Default:0 + /// Nullable:False + /// + public int push_wx {get;set;} + + /// + /// Desc: + /// Default:- 1.0 + /// Nullable:False + /// + public double push_wx_value {get;set;} + + /// + /// Desc: + /// Default:8 + /// Nullable:False + /// + public int push_wx_area_id {get;set;} + + /// + /// Desc: + /// Default:2 + /// Nullable:False + /// + public int push_wx_company_id {get;set;} + + } +} diff --git a/Txgy.RBS.Server.SqlSugarMigration/myModels/result.cs b/Txgy.RBS.Server.SqlSugarMigration/myModels/result.cs new file mode 100644 index 0000000..a6cdd6f --- /dev/null +++ b/Txgy.RBS.Server.SqlSugarMigration/myModels/result.cs @@ -0,0 +1,108 @@ +using System; +using System.Linq; +using System.Text; + +namespace Models +{ + /// + /// + /// + public partial class result + { + public result(){ + + + } + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public int id {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? project_id {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string otime {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? e {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? n {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? depth {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? ml {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? energy {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? rms {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? phases_count {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? amps_count {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string seismic_source {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public double? seismic_direction {get;set;} + + } +} diff --git a/Txgy.RBS.Server.SqlSugarMigration/myModels/result_json.cs b/Txgy.RBS.Server.SqlSugarMigration/myModels/result_json.cs new file mode 100644 index 0000000..d4f2ae4 --- /dev/null +++ b/Txgy.RBS.Server.SqlSugarMigration/myModels/result_json.cs @@ -0,0 +1,38 @@ +using System; +using System.Linq; +using System.Text; + +namespace Models +{ + /// + /// + /// + public partial class result_json + { + public result_json(){ + + + } + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public int id {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? result_id {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string json {get;set;} + + } +} diff --git a/Txgy.RBS.Server.SqlSugarMigration/myModels/station_file.cs b/Txgy.RBS.Server.SqlSugarMigration/myModels/station_file.cs new file mode 100644 index 0000000..3064ec8 --- /dev/null +++ b/Txgy.RBS.Server.SqlSugarMigration/myModels/station_file.cs @@ -0,0 +1,38 @@ +using System; +using System.Linq; +using System.Text; + +namespace Models +{ + /// + /// + /// + public partial class station_file + { + public station_file(){ + + + } + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? id {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public int project_id {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string file_name {get;set;} + + } +} diff --git a/Txgy.RBS.Server.SqlSugarMigration/myModels/station_num_vpn.cs b/Txgy.RBS.Server.SqlSugarMigration/myModels/station_num_vpn.cs new file mode 100644 index 0000000..b2c3987 --- /dev/null +++ b/Txgy.RBS.Server.SqlSugarMigration/myModels/station_num_vpn.cs @@ -0,0 +1,31 @@ +using System; +using System.Linq; +using System.Text; + +namespace Models +{ + /// + /// + /// + public partial class station_num_vpn + { + public station_num_vpn(){ + + + } + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string num {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string vpn_name {get;set;} + + } +} diff --git a/Txgy.RBS.Server.SqlSugarMigration/myModels/stations.cs b/Txgy.RBS.Server.SqlSugarMigration/myModels/stations.cs new file mode 100644 index 0000000..a66812f --- /dev/null +++ b/Txgy.RBS.Server.SqlSugarMigration/myModels/stations.cs @@ -0,0 +1,94 @@ +using System; +using System.Linq; +using System.Text; + +namespace Models +{ + /// + /// + /// + public partial class stations + { + public stations(){ + + + } + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? id {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public int project_id {get;set;} + + /// + /// Desc: + /// Default:YA + /// Nullable:False + /// + public string network {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public string num {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public double coord_e {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public double coord_n {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public double altitude {get;set;} + + /// + /// Desc: + /// Default:3200000000 + /// Nullable:False + /// + public int sens {get;set;} + + /// + /// Desc: + /// Default:"2023-01-01T00:00:00.000" + /// Nullable:False + /// + public string begin_time {get;set;} + + /// + /// Desc: + /// Default:"2026-12-31T23:59:59.000" + /// Nullable:False + /// + public string end_time {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public string site_number {get;set;} + + } +} diff --git a/Txgy.RBS.Server.SqlSugarMigration/myModels/time_tab.cs b/Txgy.RBS.Server.SqlSugarMigration/myModels/time_tab.cs new file mode 100644 index 0000000..5064898 --- /dev/null +++ b/Txgy.RBS.Server.SqlSugarMigration/myModels/time_tab.cs @@ -0,0 +1,45 @@ +using System; +using System.Linq; +using System.Text; + +namespace Models +{ + /// + /// + /// + public partial class time_tab + { + public time_tab(){ + + + } + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? id {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public int? project_id {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string filename {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string file_content {get;set;} + + } +} diff --git a/Txgy.RBS.Server.SqlSugarMigration/rbs_server_db.db b/Txgy.RBS.Server.SqlSugarMigration/rbs_server_db.db new file mode 100644 index 0000000000000000000000000000000000000000..b3311cf188074ae7856be10e794ff20fd778c1d7 GIT binary patch literal 77824 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 literal 0 HcmV?d00001 diff --git a/Txgy.RBS.Server.WebApi.sln b/Txgy.RBS.Server.WebApi.sln index ec4b0a6..ba28254 100644 --- a/Txgy.RBS.Server.WebApi.sln +++ b/Txgy.RBS.Server.WebApi.sln @@ -7,13 +7,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Txgy.RBS.DbModel", "Txgy.RB EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Txgy.RBS.Server.WebApi", "Txgy.RBS.Server.WebApi\Txgy.RBS.Server.WebApi.csproj", "{AA0B6F7F-60BE-4194-AF85-ABD5F9CEB949}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Txgy.RBS.IServices", "Txgy.RBS.IServices\Txgy.RBS.IServices.csproj", "{E80A6A7C-514E-4E98-B5D3-92076960D15D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Txgy.RBS.IServices", "Txgy.RBS.IServices\Txgy.RBS.IServices.csproj", "{E80A6A7C-514E-4E98-B5D3-92076960D15D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Txgy.RBS.Services", "Txgy.RBS.Services\Txgy.RBS.Services.csproj", "{62C154B8-02B1-4373-9CC3-E1BE98BD5185}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Txgy.RBS.Services", "Txgy.RBS.Services\Txgy.RBS.Services.csproj", "{62C154B8-02B1-4373-9CC3-E1BE98BD5185}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Txgy.RBS.DTO", "Txgy.RBS.DTO\Txgy.RBS.DTO.csproj", "{AD9839D2-4CDE-49CC-BFC2-B5E2C7A3D8D8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Txgy.RBS.DTO", "Txgy.RBS.DTO\Txgy.RBS.DTO.csproj", "{AD9839D2-4CDE-49CC-BFC2-B5E2C7A3D8D8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Txgy.RBS.Framework", "Txgy.RBS.Framework\Txgy.RBS.Framework.csproj", "{192F744E-9C15-46F5-94CE-801C65E67AED}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Txgy.RBS.Framework", "Txgy.RBS.Framework\Txgy.RBS.Framework.csproj", "{192F744E-9C15-46F5-94CE-801C65E67AED}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/Txgy.RBS.Server.WebApi/Controllers/GlobalConfigController.cs b/Txgy.RBS.Server.WebApi/Controllers/GlobalConfigController.cs new file mode 100644 index 0000000..6b1cc12 --- /dev/null +++ b/Txgy.RBS.Server.WebApi/Controllers/GlobalConfigController.cs @@ -0,0 +1,47 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Txgy.RBS.DbModel.Models; +using Txgy.RBS.Framework.Api; +using Txgy.RBS.IServices; +using Txgy.RBS.Services; + +namespace Txgy.RBS.Server.WebApi.Controllers +{ + [Route("api/[controller]/[action]")] + [ApiController] + public class GlobalConfigController : ControllerBase + { + private readonly IGlobalConfigService _globalConfigService; + + public GlobalConfigController(ILogger logger, IGlobalConfigService globalConfigService) + { + this._globalConfigService = globalConfigService; + } + [HttpPost] + public ApiResult AddGlobalConfig(GlobalConfigDTO globalConfigDTO) + { + return _globalConfigService.AddGlobalConfig(globalConfigDTO); + } + + + [HttpPost] + public ApiResult UpdateGlobalConfig(GlobalConfigDTO globalConfigDTO) + { + return _globalConfigService.UpdateGlobalConfig(globalConfigDTO); + } + + [HttpGet("{id}")] + public GlobalConfigDTO GetGlobalConfig(int id) + { + return _globalConfigService.GetGlobalConfig(id); + } + + [HttpGet] + public List GetAllGlobalConfig() + { + return _globalConfigService.GetAllGlobalConfig(); + } + + + } +} diff --git a/Txgy.RBS.Server.WebApi/Controllers/ProjectInfoController.cs b/Txgy.RBS.Server.WebApi/Controllers/ProjectInfoController.cs new file mode 100644 index 0000000..7443596 --- /dev/null +++ b/Txgy.RBS.Server.WebApi/Controllers/ProjectInfoController.cs @@ -0,0 +1,65 @@ +using Microsoft.AspNetCore.Mvc; +using Txgy.RBS.DbModel.Models; +using Txgy.RBS.Framework.Api; +using Txgy.RBS.IServices; +using Txgy.RBS.Services; + +// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 + +namespace Txgy.RBS.Server.WebApi.Controllers +{ + [Route("api/[controller]/[action]")] + [ApiController] + public class ProjectInfoController : ControllerBase + { + private readonly IProjectInfoService _projectInfoService; + + public ProjectInfoController(ILogger logger, IProjectInfoService projectInfoService) + { + this._projectInfoService = projectInfoService; + } + + [HttpPost] + public ApiResult AddProjectInfo(ProjectInfoDTO project) + { + return _projectInfoService.AddProjectInfo(project); + } + + [HttpDelete("{id}")] + public ApiResult DeleteProjectInfo(int id) + { + return _projectInfoService.DeleteProjectInfo(id); + } + + [HttpPost] + public ApiResult UpdateProjectInfo(ProjectInfoDTO project) + { + return _projectInfoService.UpdateProjectInfo(project); + } + + [HttpGet("{id}")] + public ProjectInfoDTO GetProjectInfo(int id) + { + return _projectInfoService.GetProjectInfo(id); + } + + [HttpGet] + public List GetAllProjectInfo() + { + return _projectInfoService.GetAllProjectInfo(); + } + + [HttpGet] + public ProjectInfoDTO GetCurrentProjectInfo() + { + return _projectInfoService.GetCurrentProjectInfo(); + } + + //[HttpPost] + //public void Post([FromBody] string value) + //{ + + //} + + } +} diff --git a/Txgy.RBS.Server.WebApi/Controllers/ResultInfoController.cs b/Txgy.RBS.Server.WebApi/Controllers/ResultInfoController.cs new file mode 100644 index 0000000..9893d75 --- /dev/null +++ b/Txgy.RBS.Server.WebApi/Controllers/ResultInfoController.cs @@ -0,0 +1,51 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Txgy.RBS.DbModel.Models; +using Txgy.RBS.DTO; +using Txgy.RBS.Framework.Api; +using Txgy.RBS.IServices; +using Txgy.RBS.Services; + +namespace Txgy.RBS.Server.WebApi.Controllers +{ + [Route("api/[controller]/[action]")] + [ApiController] + public class ResultInfoController : ControllerBase + { + private readonly IResultInfoService _resultInfoService; + + public ResultInfoController(ILogger logger, IResultInfoService resultInfoService) + { + this._resultInfoService = resultInfoService; + } + [HttpPost] + public ApiResult AddProjectInfo(ResultJsonDTO resultJsonDTO) + { + return _resultInfoService.AddResultInfo(resultJsonDTO); + } + + [HttpDelete("{id}")] + public ApiResult DeleteResultInfo(int id) + { + return _resultInfoService.DeleteResultInfo(id); + } + + [HttpPost] + public ApiResult UpdateResultInfo(ResultJsonDTO resultJsonDTO) + { + return _resultInfoService.UpdateResultInfo(resultJsonDTO); + } + + [HttpGet("{id}")] + public ResultJsonDTO GetProjectInfo(int id) + { + return _resultInfoService.GetResultInfo(id); + } + + [HttpGet] + public List GetAllResultInfo() + { + return _resultInfoService.GetAllResultInfo(); + } + } +} diff --git a/Txgy.RBS.Server.WebApi/Controllers/StationsController.cs b/Txgy.RBS.Server.WebApi/Controllers/StationsController.cs new file mode 100644 index 0000000..64c4fce --- /dev/null +++ b/Txgy.RBS.Server.WebApi/Controllers/StationsController.cs @@ -0,0 +1,51 @@ +using Microsoft.AspNetCore.Mvc; +using Txgy.RBS.DbModel.Models; +using Txgy.RBS.Framework.Api; +using Txgy.RBS.IServices; + +// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 + +namespace Txgy.RBS.Server.WebApi.Controllers +{ + [Route("api/[controller]/[action]")] + [ApiController] + public class StationsController : ControllerBase + { + private readonly IStationsService _stationsService; + + public StationsController(ILogger logger, IStationsService stationsService) + { + this._stationsService = stationsService; + } + + [HttpPost] + public ApiResult AddStations(StationsDTO stationsDTO) + { + return _stationsService.AddStations(stationsDTO); + } + + [HttpDelete("{id}")] + public ApiResult DeleteStations(int id) + { + return _stationsService.DeleteStations(id); + } + + [HttpPost] + public ApiResult UpdateStations(StationsDTO stationsDTO) + { + return _stationsService.UpdateStations(stationsDTO); + } + + [HttpGet("{id}")] + public StationsDTO GetStations(int id) + { + return _stationsService.GetStations(id); + } + + [HttpGet] + public List GetAllStationss() + { + return _stationsService.GetAllStations(); + } + } +} diff --git a/Txgy.RBS.Server.WebApi/Controllers/TimeTabController.cs b/Txgy.RBS.Server.WebApi/Controllers/TimeTabController.cs new file mode 100644 index 0000000..8feb12c --- /dev/null +++ b/Txgy.RBS.Server.WebApi/Controllers/TimeTabController.cs @@ -0,0 +1,50 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Txgy.RBS.DbModel.Models; +using Txgy.RBS.Framework.Api; +using Txgy.RBS.IServices; + +namespace Txgy.RBS.Server.WebApi.Controllers +{ + [Route("api/[controller]/[action]")] + [ApiController] + public class TimeTabController : ControllerBase + { + private readonly ITimeTabService _timeTabService; + + public TimeTabController(ILogger logger, ITimeTabService timeTabService) + { + this._timeTabService = timeTabService; + } + + [HttpPost] + public ApiResult AddTimeTab(TimeTabDTO timeTabDTO) + { + return _timeTabService.AddTimeTab(timeTabDTO); + } + + [HttpDelete("{id}")] + public ApiResult DeleteTimeTab(int id) + { + return _timeTabService.DeleteTimeTab(id); + } + + [HttpPost] + public ApiResult UpdateTimeTab(TimeTabDTO timeTabDTO) + { + return _timeTabService.UpdateTimeTab(timeTabDTO); + } + + [HttpGet("{id}")] + public TimeTabDTO GetTimeTab(int id) + { + return _timeTabService.GetTimeTab(id); + } + + [HttpGet] + public List GetAllTimeTabs() + { + return _timeTabService.GetAllTimeTab(); + } + } +} diff --git a/Txgy.RBS.Server.WebApi/Controllers/WeatherForecastController.cs b/Txgy.RBS.Server.WebApi/Controllers/WeatherForecastController.cs index a882e1c..bef71ae 100644 --- a/Txgy.RBS.Server.WebApi/Controllers/WeatherForecastController.cs +++ b/Txgy.RBS.Server.WebApi/Controllers/WeatherForecastController.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Mvc; using Txgy.RBS.IServices; +using Txgy.RBS.Services; namespace Txgy.RBS.Server.WebApi.Controllers { @@ -13,18 +14,16 @@ namespace Txgy.RBS.Server.WebApi.Controllers }; private readonly ILogger _logger; - private readonly IDataAccessService _dataAccessDal; - public WeatherForecastController(ILogger logger, IDataAccessService dataAccessDal) + public WeatherForecastController(ILogger logger, IProjectInfoService projectInfoService) { _logger = logger; - this._dataAccessDal = dataAccessDal; + var pro= projectInfoService.GetCurrentProjectInfo(); } [HttpGet(Name = "GetWeatherForecast")] public IEnumerable Get() { - var a = _dataAccessDal.GetIcons(); return Enumerable.Range(1, 5).Select(index => new WeatherForecast { Date = DateTime.Now.AddDays(index), diff --git a/Txgy.RBS.Server.WebApi/Program.cs b/Txgy.RBS.Server.WebApi/Program.cs index 5513f3f..65d878a 100644 --- a/Txgy.RBS.Server.WebApi/Program.cs +++ b/Txgy.RBS.Server.WebApi/Program.cs @@ -1,3 +1,5 @@ +using Microsoft.Extensions.Options; +using Microsoft.OpenApi.Models; using SqlSugar; using System.ComponentModel; using Txgy.RBS.IServices; @@ -15,25 +17,6 @@ builder.Services.AddControllers(); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); - //sqlsugar - builder.Services.AddTransient(context => - { - string con = builder.Configuration.GetConnectionString("ConnectionSqlite"); - SqlSugarClient client = new SqlSugarClient(new ConnectionConfig() - { - ConnectionString = builder.Configuration.GetConnectionString("ConnectionSqlite"), - DbType = DbType.Sqlite, - InitKeyType = InitKeyType.Attribute, - }); - //֧sqlų - client.Aop.OnLogExecuting = (sql, par) => - { - Console.WriteLine("\r\n"); - Console.WriteLine($"Sql:{sql}"); - Console.WriteLine($"======================================================================"); - }; - return client; - }); var app = builder.Build(); diff --git a/Txgy.RBS.Server.WebApi/Register/HostBuilderExtend.cs b/Txgy.RBS.Server.WebApi/Register/HostBuilderExtend.cs index d36d3de..54ba832 100644 --- a/Txgy.RBS.Server.WebApi/Register/HostBuilderExtend.cs +++ b/Txgy.RBS.Server.WebApi/Register/HostBuilderExtend.cs @@ -45,7 +45,6 @@ namespace Txgy.RBS.Server.WebApi.Register // } // } }); - //支持sql语句的输出,方便排除错误 client.Aop.OnLogExecuting = (sql, par) => { @@ -55,6 +54,7 @@ namespace Txgy.RBS.Server.WebApi.Register }; return client; }); + #endregion #region 注册Redis diff --git a/Txgy.RBS.Server.WebApi/rbs_server_db.db b/Txgy.RBS.Server.WebApi/rbs_server_db.db index b3311cf188074ae7856be10e794ff20fd778c1d7..bfce5d32e5fb735d95c3af15654db6f443c30bc0 100644 GIT binary patch delta 1252 zcmcK3J!lhQ9LMqhb9bRlZ1VKQCG>4k5o{#MbI&Dx*~CGG&RPd4T5F_D(j-*3%TfiQ zs6?es0bho0O5BQzg1G9?K~UO7p-Vf6Q)&JG{#6jGZaxQhe4l&n;lo2xU-Rl~-kn}G zdbjUHWR#8{sz1Nh2rH>q_J{)Ag4E} zJzA|zc6e^T;%BW;Dpoxr>WcolILF3T=;ADM&0GE3b+3d=G}T|)}X zf^`KcEDP2-q_8Ylr;)<4V2vV$Wx*OkhT`(!>gUdg%je@#38b)mX3;KESU$683n?t0 zS+tH6md`ADj}(^AEP9O;md`ADffSaX3Avx5#pSb$9w3Efm_;`^)50>$qU%Uu8L$dS zVHvO{kis%xok0rAfHj5`mH{ip*_#%ZfolM-#bx-oNVme53*8-_UM2lWuj;S*Gyi1Y z=#e(JNAbTmviCGz+#OW4soC<(WNpeg2i*SX&x-Ljp57q6t-t9ly}{pq&_^P!Qgad9 b%O38IeNg^s_Cg@cGuUOy~_w zuYS1oI>~iC^;0dX@2cC`IPgv_bf0buJkQ&Zooh|Ww4YD)*VaswROAiHtVs)Ri-5xTwxkwh|A277~m2!AZlD>>NQ3sTp*efv551`A~D7} zVq#))gtI)3hz=7>%8D$;nUob7l$n$jg*d~ctSG=~CS^q$r&X4z5e7o~L^K i@4BiW{Cu`moo&{pTGd=9)%>F}zMswVw)6L2TK@;>>)!DI diff --git a/Txgy.RBS.Services/DataAccessService.cs b/Txgy.RBS.Services/DataAccessService.cs deleted file mode 100644 index 31ada9b..0000000 --- a/Txgy.RBS.Services/DataAccessService.cs +++ /dev/null @@ -1,43 +0,0 @@ -using SqlSugar; -using System.Data; -using Txgy.RBS.DbModel; -using Txgy.RBS.IServices; - -namespace Txgy.RBS.Services -{ - //sqlite数据库操作 - public class DataAccessService : BaseService, IDataAccessService - { - - public DataAccessService(ISqlSugarClient sqlSugarClient) : base(sqlSugarClient) - { - - } - - public List GetIcons() - { - var data = _Client.Queryable().ToList(); - return null; - } - - - public Setting GetClientType(int userId = 1) - { - return new Setting(); - } - public void UpdateClientDetail(double createTime, int mailRule, string mailbox, string appMessage) - { - - } - - public string GetDevices(int roadId) - { - return string.Empty; - } - - public void UpdateDeviceType(int currentDevice) - { - - } - } -} diff --git a/Txgy.RBS.Services/GlobalConfigService.cs b/Txgy.RBS.Services/GlobalConfigService.cs new file mode 100644 index 0000000..157c00c --- /dev/null +++ b/Txgy.RBS.Services/GlobalConfigService.cs @@ -0,0 +1,59 @@ +using AutoMapper; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Txgy.RBS.DbModel.Models; +using Txgy.RBS.Framework.Api; +using Txgy.RBS.IServices; + +namespace Txgy.RBS.Services +{ + public class GlobalConfigService : BaseService, IGlobalConfigService + { + private readonly IMapper _iMapper; + + public GlobalConfigService(ISqlSugarClient client, IMapper iMapper) : base(client) + { + this._iMapper = iMapper; + } + + public ApiResult AddGlobalConfig(GlobalConfigDTO globalConfigDTO) + { + int res = 0; + global_config global_Config = _iMapper.Map(globalConfigDTO); + + res = _Client.Insertable(global_Config).ExecuteCommand(); + if (res > 0) + { + return new ApiResult(); + } + return new ApiResult() { Message = "添加失败" }; + } + + public List GetAllGlobalConfig() + { + var global_Config = _Client.Queryable().ToList(); + return _iMapper.Map>(global_Config); + } + + + public GlobalConfigDTO GetGlobalConfig(int id) + { + return new GlobalConfigDTO(); + } + + public ApiResult UpdateGlobalConfig(GlobalConfigDTO GlobalConfigDTO) + { + global_config global_Config = _iMapper.Map (GlobalConfigDTO); + int res= _Client.Updateable(global_Config).ExecuteCommand(); + if(res > 0) + { + return new ApiResult(); + } + return new ApiResult() { Message = "更新失败" }; + } + } +} diff --git a/Txgy.RBS.Services/LoginService.cs b/Txgy.RBS.Services/LoginService.cs deleted file mode 100644 index 9047d0f..0000000 --- a/Txgy.RBS.Services/LoginService.cs +++ /dev/null @@ -1,14 +0,0 @@ -using SqlSugar; -using System; -using System.Collections.Generic; -using System.Text; -using Txgy.RBS.IServices; - - -namespace Txgy.RBS.Services -{ - public class LoginService : BaseService, ILoginService - { - public LoginService(ISqlSugarClient sqlSugarClient) : base(sqlSugarClient) { } - } -} diff --git a/Txgy.RBS.Services/ProjectInfoService.cs b/Txgy.RBS.Services/ProjectInfoService.cs new file mode 100644 index 0000000..0b94d68 --- /dev/null +++ b/Txgy.RBS.Services/ProjectInfoService.cs @@ -0,0 +1,78 @@ +using AutoMapper; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Txgy.RBS.DbModel.Models; +using Txgy.RBS.Framework.Api; +using Txgy.RBS.IServices; + +namespace Txgy.RBS.Services +{ + public class ProjectInfoService : BaseService, IProjectInfoService + { + private readonly IMapper _iMapper; + + public ProjectInfoService(ISqlSugarClient client, IMapper iMapper) : base(client) + { + this._iMapper = iMapper; + } + + public ApiResult AddProjectInfo(ProjectInfoDTO project) + { + int res = 0; + project_info project_Info = _iMapper.Map(project); + + res = _Client.Insertable(project_Info).ExecuteCommand(); + if (res > 0) + { + return new ApiResult(); + } + return new ApiResult() { Message = "添加失败" }; + } + + public ApiResult DeleteProjectInfo(int id) + { + int res= _Client.Deleteable(p=>p.id==id).ExecuteCommand(); + if (res > 0) + { + return new ApiResult(); + } + return new ApiResult() { Message = "删除失败" }; + } + + public List GetAllProjectInfo() + { + var projects = _Client.Queryable().ToList(); + return _iMapper.Map>(projects); + } + + public ProjectInfoDTO GetCurrentProjectInfo() + { + var curProject = _Client.Queryable().First(); + project_info projectInfo = _Client.Queryable().First(c => c.id == curProject.current_project_id); + ProjectInfoDTO projectInfoDTO= _iMapper.Map(projectInfo); + return projectInfoDTO; + } + + public ProjectInfoDTO GetProjectInfo(int id) + { + project_info projectInfo = _Client.Queryable().First(c => c.id == id); + ProjectInfoDTO projectInfoDTO = _iMapper.Map(projectInfo); + return projectInfoDTO; + } + + public ApiResult UpdateProjectInfo(ProjectInfoDTO project) + { + project_info projectInfo = _iMapper.Map (project); + int res= _Client.Updateable(projectInfo).ExecuteCommand(); + if(res > 0) + { + return new ApiResult(); + } + return new ApiResult() { Message = "更新失败" }; + } + } +} diff --git a/Txgy.RBS.Services/ResultInfoService.cs b/Txgy.RBS.Services/ResultInfoService.cs new file mode 100644 index 0000000..42c84d4 --- /dev/null +++ b/Txgy.RBS.Services/ResultInfoService.cs @@ -0,0 +1,72 @@ +using AutoMapper; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Txgy.RBS.DbModel.Models; +using Txgy.RBS.DTO; +using Txgy.RBS.Framework.Api; +using Txgy.RBS.IServices; + +namespace Txgy.RBS.Services +{ + public class ResultInfoService : BaseService, IResultInfoService + { + private readonly IMapper _iMapper; + + public ResultInfoService(ISqlSugarClient client, IMapper iMapper) : base(client) + { + this._iMapper = iMapper; + } + + public ApiResult AddResultInfo(ResultJsonDTO resultJsonDTO) + { + int res = 0; + result_json result_Json = _iMapper.Map(resultJsonDTO); + + res = _Client.Insertable(result_Json).ExecuteCommand(); + if (res > 0) + { + return new ApiResult(); + } + return new ApiResult() { Message = "添加失败" }; + } + + public ApiResult DeleteResultInfo(int id) + { + int res= _Client.Deleteable(p=>p.id==id).ExecuteCommand(); + if (res > 0) + { + return new ApiResult(); + } + return new ApiResult() { Message = "删除失败" }; + } + + public List GetAllResultInfo() + { + var projects = _Client.Queryable().ToList(); + return _iMapper.Map>(projects); + } + + + public ResultJsonDTO GetResultInfo(int id) + { + result_json result_Json = _Client.Queryable().First(c => c.id == id); + ResultJsonDTO resultJsonDTO = _iMapper.Map(result_Json); + return resultJsonDTO; + } + + public ApiResult UpdateResultInfo(ResultJsonDTO resultJsonDTO) + { + result_json result_Json = _iMapper.Map (resultJsonDTO); + int res= _Client.Updateable(result_Json).ExecuteCommand(); + if(res > 0) + { + return new ApiResult(); + } + return new ApiResult() { Message = "更新失败" }; + } + } +} diff --git a/Txgy.RBS.Services/StationsService.cs b/Txgy.RBS.Services/StationsService.cs new file mode 100644 index 0000000..de80c7e --- /dev/null +++ b/Txgy.RBS.Services/StationsService.cs @@ -0,0 +1,71 @@ +using AutoMapper; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Txgy.RBS.DbModel.Models; +using Txgy.RBS.Framework.Api; +using Txgy.RBS.IServices; + +namespace Txgy.RBS.Services +{ + public class StationsService : BaseService, IStationsService + { + private readonly IMapper _iMapper; + + public StationsService(ISqlSugarClient client, IMapper iMapper) : base(client) + { + this._iMapper = iMapper; + } + + public ApiResult AddStations(StationsDTO stationsDTO) + { + int res = 0; + stations station = _iMapper.Map(stationsDTO); + + res = _Client.Insertable(station).ExecuteCommand(); + if (res > 0) + { + return new ApiResult(); + } + return new ApiResult() { Message = "添加失败" }; + } + + public ApiResult DeleteStations(int id) + { + int res= _Client.Deleteable(p=>p.id==id).ExecuteCommand(); + if (res > 0) + { + return new ApiResult(); + } + return new ApiResult() { Message = "删除失败" }; + } + + public List GetAllStations() + { + var projects = _Client.Queryable().ToList(); + return _iMapper.Map>(projects); + } + + + public StationsDTO GetStations(int id) + { + stations station = _Client.Queryable().First(c => c.id == id); + StationsDTO stationsDTO = _iMapper.Map(station); + return stationsDTO; + } + + public ApiResult UpdateStations(StationsDTO stationsDTO) + { + stations station = _iMapper.Map (stationsDTO); + int res= _Client.Updateable(station).ExecuteCommand(); + if(res > 0) + { + return new ApiResult(); + } + return new ApiResult() { Message = "更新失败" }; + } + } +} diff --git a/Txgy.RBS.Services/TimeTabService.cs b/Txgy.RBS.Services/TimeTabService.cs new file mode 100644 index 0000000..54cd575 --- /dev/null +++ b/Txgy.RBS.Services/TimeTabService.cs @@ -0,0 +1,71 @@ +using AutoMapper; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Txgy.RBS.DbModel.Models; +using Txgy.RBS.Framework.Api; +using Txgy.RBS.IServices; + +namespace Txgy.RBS.Services +{ + public class TimeTabService : BaseService, ITimeTabService + { + private readonly IMapper _iMapper; + + public TimeTabService(ISqlSugarClient client, IMapper iMapper) : base(client) + { + this._iMapper = iMapper; + } + + public ApiResult AddTimeTab(TimeTabDTO project) + { + int res = 0; + time_tab station = _iMapper.Map(project); + + res = _Client.Insertable(station).ExecuteCommand(); + if (res > 0) + { + return new ApiResult(); + } + return new ApiResult() { Message = "添加失败" }; + } + + public ApiResult DeleteTimeTab(int id) + { + int res= _Client.Deleteable(p=>p.id==id).ExecuteCommand(); + if (res > 0) + { + return new ApiResult(); + } + return new ApiResult() { Message = "删除失败" }; + } + + public List GetAllTimeTab() + { + var projects = _Client.Queryable().ToList(); + return _iMapper.Map>(projects); + } + + + public TimeTabDTO GetTimeTab(int id) + { + time_tab time_Tab = _Client.Queryable().First(c => c.id == id); + TimeTabDTO TimeTabDTO = _iMapper.Map(time_Tab); + return TimeTabDTO; + } + + public ApiResult UpdateTimeTab(TimeTabDTO TimeTabDTO) + { + time_tab station = _iMapper.Map (TimeTabDTO); + int res= _Client.Updateable(station).ExecuteCommand(); + if(res > 0) + { + return new ApiResult(); + } + return new ApiResult() { Message = "更新失败" }; + } + } +}