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 0000000..b3311cf Binary files /dev/null and b/Txgy.RBS.Server.SqlSugarMigration/rbs_server_db.db differ 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 b3311cf..bfce5d3 100644 Binary files a/Txgy.RBS.Server.WebApi/rbs_server_db.db and b/Txgy.RBS.Server.WebApi/rbs_server_db.db differ 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 = "更新失败" }; + } + } +}