修改测试数据库接口问题

master
mzhifa 6 months ago
parent 705372c2d1
commit 3ccca8a399

@ -0,0 +1,60 @@
using System;
using System.Linq;
using System.Text;
namespace Txgy.RBS.DbModel.Models
{
///<summary>
///
///</summary>
public partial class GlobalConfigDTO
{
public GlobalConfigDTO()
{
}
/// <summary>
/// Desc:
/// Default:"c:\\project"
/// Nullable:False
/// </summary>
public string base_path { get; set; }
/// <summary>
/// Desc:
/// Default:"https://www.txgy.xyz/api/index/push"
/// Nullable:False
/// </summary>
public string push_wx_url { get; set; }
/// <summary>
/// Desc:
/// Default:2
/// Nullable:False
/// </summary>
public int push_wx_company_id { get; set; }
/// <summary>
/// Desc:
/// Default:1
/// Nullable:False
/// </summary>
public int push_wx_message_id { get; set; }
/// <summary>
/// Desc:
/// Default:事件通知
/// Nullable:False
/// </summary>
public string push_wx_content { get; set; }
/// <summary>
/// Desc:
/// Default:Y3qYFBQPMbfTt6m
/// Nullable:False
/// </summary>
public string push_wx_key { get; set; }
}
}

@ -0,0 +1,184 @@
using System;
using System.Linq;
using System.Text;
namespace Txgy.RBS.DbModel.Models
{
///<summary>
///
///</summary>
public class ProjectInfoDTO
{
public ProjectInfoDTO()
{
}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public int id { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public string project_name { get; set; }
/// <summary>
/// Desc:
/// Default:1
/// Nullable:False
/// </summary>
public int moni_layer { get; set; }
/// <summary>
/// Desc:
/// Default:1
/// Nullable:False
/// </summary>
public int moni_num { get; set; }
/// <summary>
/// Desc:
/// Default:"2024-04-01"
/// Nullable:False
/// </summary>
public string moni_date { get; set; }
/// <summary>
/// Desc:
/// Default:YA
/// Nullable:False
/// </summary>
public string network { get; set; }
/// <summary>
/// Desc:
/// Default:"06"
/// Nullable:False
/// </summary>
public string location { get; set; }
/// <summary>
/// Desc:
/// Default:"SHZ:SHN:SHE"
/// Nullable:False
/// </summary>
public string channels { get; set; }
/// <summary>
/// Desc:
/// Default:3837
/// Nullable:False
/// </summary>
public double xmin { get; set; }
/// <summary>
/// Desc:
/// Default:3838
/// Nullable:False
/// </summary>
public double xmax { get; set; }
/// <summary>
/// Desc:
/// Default:402
/// Nullable:False
/// </summary>
public double ymin { get; set; }
/// <summary>
/// Desc:
/// Default:403
/// Nullable:False
/// </summary>
public double ymax { get; set; }
/// <summary>
/// Desc:
/// Default:200
/// Nullable:False
/// </summary>
public double zmin { get; set; }
/// <summary>
/// Desc:
/// Default:900
/// Nullable:False
/// </summary>
public double zmax { get; set; }
/// <summary>
/// Desc:
/// Default:0
/// Nullable:False
/// </summary>
public int local_save_result { get; set; }
/// <summary>
/// Desc:
/// Default:result
/// Nullable:False
/// </summary>
public string save_result_path { get; set; }
/// <summary>
/// Desc:
/// Default:0
/// Nullable:False
/// </summary>
public int local_save_waves { get; set; }
/// <summary>
/// Desc:
/// Default:wavesdata
/// Nullable:False
/// </summary>
public string save_waves_path { get; set; }
/// <summary>
/// Desc:
/// Default:1
/// Nullable:False
/// </summary>
public int send_redis { get; set; }
/// <summary>
/// Desc:
/// Default:"127.0.0.1:1883"
/// Nullable:False
/// </summary>
public string mqtt_server { get; set; }
/// <summary>
/// Desc:
/// Default:0
/// Nullable:False
/// </summary>
public int push_wx { get; set; }
/// <summary>
/// Desc:
/// Default:- 1.0
/// Nullable:False
/// </summary>
public double push_wx_value { get; set; }
/// <summary>
/// Desc:
/// Default:8
/// Nullable:False
/// </summary>
public int push_wx_area_id { get; set; }
/// <summary>
/// Desc:
/// Default:2
/// Nullable:False
/// </summary>
public int push_wx_company_id { get; set; }
}
}

@ -17,11 +17,7 @@ namespace Txgy.RBS.DTO.Reception
get;
set;
}
//public SigningCredentials Credentials
//{
// get;
// set;
//}
public string? Issuer
{
get;

@ -0,0 +1,109 @@
using System;
using System.Linq;
using System.Text;
namespace Txgy.RBS.DbModel.Models
{
///<summary>
///
///</summary>
public partial class ResultDTO
{
public ResultDTO()
{
}
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public int id { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public int? project_id { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string otime { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public double? e { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public double? n { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public double? depth { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public double? ml { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public double? energy { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public double? rms { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public int? phases_count { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public int? amps_count { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string seismic_source { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public double? seismic_direction { get; set; }
}
}

@ -0,0 +1,39 @@
using System;
using System.Linq;
using System.Text;
namespace Txgy.RBS.DbModel.Models
{
///<summary>
///
///</summary>
public partial class StationFileDTO
{
public StationFileDTO()
{
}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public int? id { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public int project_id { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string file_name { get; set; }
}
}

@ -0,0 +1,32 @@
using System;
using System.Linq;
using System.Text;
namespace Txgy.RBS.DbModel.Models
{
///<summary>
///
///</summary>
public partial class StationNumVpnDTO
{
public StationNumVpnDTO()
{
}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string num { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string vpn_name { get; set; }
}
}

@ -0,0 +1,95 @@
using System;
using System.Linq;
using System.Text;
namespace Txgy.RBS.DbModel.Models
{
///<summary>
///
///</summary>
public partial class StationsDTO
{
public StationsDTO()
{
}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public int id { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public int project_id { get; set; }
/// <summary>
/// Desc:
/// Default:YA
/// Nullable:False
/// </summary>
public string network { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public string num { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public double coord_e { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public double coord_n { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public double altitude { get; set; }
/// <summary>
/// Desc:
/// Default:3200000000
/// Nullable:False
/// </summary>
public int sens { get; set; }
/// <summary>
/// Desc:
/// Default:"2023-01-01T00:00:00.000"
/// Nullable:False
/// </summary>
public string begin_time { get; set; }
/// <summary>
/// Desc:
/// Default:"2026-12-31T23:59:59.000"
/// Nullable:False
/// </summary>
public string end_time { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public string site_number { get; set; }
}
}

@ -0,0 +1,46 @@
using System;
using System.Linq;
using System.Text;
namespace Txgy.RBS.DbModel.Models
{
///<summary>
///
///</summary>
public partial class TimeTabDTO
{
public TimeTabDTO()
{
}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public int id { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public int? project_id { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string filename { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string file_content { get; set; }
}
}

@ -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; }
}
}

@ -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; }
}
}

@ -0,0 +1,25 @@
using System;
using System.Linq;
using System.Text;
namespace Txgy.RBS.DbModel.Models
{
///<summary>
///
///</summary>
public partial class current_project
{
public current_project()
{
}
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public int current_project_id { get; set; }
}
}

@ -0,0 +1,60 @@
using System;
using System.Linq;
using System.Text;
namespace Txgy.RBS.DbModel.Models
{
///<summary>
///
///</summary>
public partial class global_config
{
public global_config()
{
}
/// <summary>
/// Desc:
/// Default:"c:\\project"
/// Nullable:False
/// </summary>
public string base_path { get; set; }
/// <summary>
/// Desc:
/// Default:"https://www.txgy.xyz/api/index/push"
/// Nullable:False
/// </summary>
public string push_wx_url { get; set; }
/// <summary>
/// Desc:
/// Default:2
/// Nullable:False
/// </summary>
public int push_wx_company_id { get; set; }
/// <summary>
/// Desc:
/// Default:1
/// Nullable:False
/// </summary>
public int push_wx_message_id { get; set; }
/// <summary>
/// Desc:
/// Default:事件通知
/// Nullable:False
/// </summary>
public string push_wx_content { get; set; }
/// <summary>
/// Desc:
/// Default:Y3qYFBQPMbfTt6m
/// Nullable:False
/// </summary>
public string push_wx_key { get; set; }
}
}

@ -0,0 +1,188 @@
using SqlSugar;
using System;
using System.Linq;
using System.Text;
namespace Txgy.RBS.DbModel.Models
{
///<summary>
///
///</summary>
public partial class project_info
{
public project_info()
{
}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int id { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public string project_name { get; set; }
/// <summary>
/// Desc:
/// Default:1
/// Nullable:False
/// </summary>
public int moni_layer { get; set; }
/// <summary>
/// Desc:
/// Default:1
/// Nullable:False
/// </summary>
public int moni_num { get; set; }
/// <summary>
/// Desc:
/// Default:"2024-04-01"
/// Nullable:False
/// </summary>
public string moni_date { get; set; }
/// <summary>
/// Desc:
/// Default:YA
/// Nullable:False
/// </summary>
public string network { get; set; }
/// <summary>
/// Desc:
/// Default:"06"
/// Nullable:False
/// </summary>
public string location { get; set; }
/// <summary>
/// Desc:
/// Default:"SHZ:SHN:SHE"
/// Nullable:False
/// </summary>
public string channels { get; set; }
/// <summary>
/// Desc:
/// Default:3837
/// Nullable:False
/// </summary>
public double xmin { get; set; }
/// <summary>
/// Desc:
/// Default:3838
/// Nullable:False
/// </summary>
public double xmax { get; set; }
/// <summary>
/// Desc:
/// Default:402
/// Nullable:False
/// </summary>
public double ymin { get; set; }
/// <summary>
/// Desc:
/// Default:403
/// Nullable:False
/// </summary>
public double ymax { get; set; }
/// <summary>
/// Desc:
/// Default:200
/// Nullable:False
/// </summary>
public double zmin { get; set; }
/// <summary>
/// Desc:
/// Default:900
/// Nullable:False
/// </summary>
public double zmax { get; set; }
/// <summary>
/// Desc:
/// Default:0
/// Nullable:False
/// </summary>
public int local_save_result { get; set; }
/// <summary>
/// Desc:
/// Default:result
/// Nullable:False
/// </summary>
public string save_result_path { get; set; }
/// <summary>
/// Desc:
/// Default:0
/// Nullable:False
/// </summary>
public int local_save_waves { get; set; }
/// <summary>
/// Desc:
/// Default:wavesdata
/// Nullable:False
/// </summary>
public string save_waves_path { get; set; }
/// <summary>
/// Desc:
/// Default:1
/// Nullable:False
/// </summary>
public int send_redis { get; set; }
/// <summary>
/// Desc:
/// Default:"127.0.0.1:1883"
/// Nullable:False
/// </summary>
public string mqtt_server { get; set; }
/// <summary>
/// Desc:
/// Default:0
/// Nullable:False
/// </summary>
public int push_wx { get; set; }
/// <summary>
/// Desc:
/// Default:- 1.0
/// Nullable:False
/// </summary>
public double push_wx_value { get; set; }
/// <summary>
/// Desc:
/// Default:8
/// Nullable:False
/// </summary>
public int push_wx_area_id { get; set; }
/// <summary>
/// Desc:
/// Default:2
/// Nullable:False
/// </summary>
public int push_wx_company_id { get; set; }
}
}

@ -0,0 +1,111 @@
using SqlSugar;
using System;
using System.Linq;
using System.Text;
namespace Txgy.RBS.DbModel.Models
{
///<summary>
///
///</summary>
public partial class result
{
public result()
{
}
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int id { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public int? project_id { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string otime { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public double? e { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public double? n { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public double? depth { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public double? ml { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public double? energy { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public double? rms { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public int? phases_count { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public int? amps_count { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string seismic_source { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public double? seismic_direction { get; set; }
}
}

@ -0,0 +1,41 @@
using SqlSugar;
using System;
using System.Linq;
using System.Text;
namespace Txgy.RBS.DbModel.Models
{
///<summary>
///
///</summary>
public partial class result_json
{
public result_json()
{
}
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int id { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public int? result_id { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string json { get; set; }
}
}

@ -0,0 +1,41 @@
using SqlSugar;
using System;
using System.Linq;
using System.Text;
namespace Txgy.RBS.DbModel.Models
{
///<summary>
///
///</summary>
public partial class station_file
{
public station_file()
{
}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int id { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public int project_id { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string file_name { get; set; }
}
}

@ -0,0 +1,32 @@
using System;
using System.Linq;
using System.Text;
namespace Txgy.RBS.DbModel.Models
{
///<summary>
///
///</summary>
public partial class station_num_vpn
{
public station_num_vpn()
{
}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string num { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string vpn_name { get; set; }
}
}

@ -0,0 +1,97 @@
using SqlSugar;
using System;
using System.Linq;
using System.Text;
namespace Txgy.RBS.DbModel.Models
{
///<summary>
///
///</summary>
public partial class stations
{
public stations()
{
}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int id { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public int project_id { get; set; }
/// <summary>
/// Desc:
/// Default:YA
/// Nullable:False
/// </summary>
public string network { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public string num { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public double coord_e { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public double coord_n { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public double altitude { get; set; }
/// <summary>
/// Desc:
/// Default:3200000000
/// Nullable:False
/// </summary>
public int sens { get; set; }
/// <summary>
/// Desc:
/// Default:"2023-01-01T00:00:00.000"
/// Nullable:False
/// </summary>
public string begin_time { get; set; }
/// <summary>
/// Desc:
/// Default:"2026-12-31T23:59:59.000"
/// Nullable:False
/// </summary>
public string end_time { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public string site_number { get; set; }
}
}

@ -0,0 +1,48 @@
using SqlSugar;
using System;
using System.Linq;
using System.Text;
namespace Txgy.RBS.DbModel.Models
{
///<summary>
///
///</summary>
public partial class time_tab
{
public time_tab()
{
}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int id { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public int? project_id { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string filename { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string file_content { get; set; }
}
}

@ -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; }
}
}

@ -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; }
}
}

@ -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; }
}
}

@ -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; }
}
}

@ -1,26 +0,0 @@
namespace Txgy.RBS.Framework.CustomEnum
{
/// <summary>
/// 用户类别
/// </summary>
public enum UserTypeEnum
{
/// <summary>
/// 后台用户
/// </summary>
[Remark("后台用户")]
Administrators = 1,
/// <summary>
/// 普通用户
/// </summary>
[Remark("普通用户")]
Member = 2,
/// <summary>
/// 主播用户
/// </summary>
[Remark("主播用户")]
Anchor = 3
}
}

@ -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<ResultJson, ResultJsonDTO>().ReverseMap();
//CreateMap<MenueInfo, MenueInfoDTO>().ReverseMap();
//CreateMap<PagingData<MenueInfo>, PagingData<MenueInfoDTO>>();
CreateMap<result_json, ResultJsonDTO>().ReverseMap();
CreateMap<project_info, ProjectInfoDTO>().ReverseMap();
CreateMap<stations, StationsDTO>().ReverseMap();
CreateMap<time_tab, TimeTabDTO>().ReverseMap();
}
}
}

@ -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<string> GetIcons();
/// <summary>
/// 获取客户端类型
/// </summary>
/// <returns></returns>
Setting GetClientType(int useId = 1);
void UpdateClientDetail(double createTime, int mailRule, string mailbox, string appMessage);
/// <summary>
/// 根据车道ID获取对应的设备信息
/// </summary>
/// <param name="roadId"></param>
/// <returns></returns>
string GetDevices(int roadId);
void UpdateDeviceType(int currentDevice);
}
}

@ -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<GlobalConfigDTO> GetAllGlobalConfig();
}
}

@ -1,10 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Txgy.RBS.IServices
{
public interface ILoginService : IBaseService
{
}
}

@ -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<ProjectInfoDTO> GetAllProjectInfo();
ProjectInfoDTO GetCurrentProjectInfo();
}
}

@ -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<ResultJsonDTO> GetAllResultInfo();
}
}

@ -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<StationsDTO> GetAllStations();
}
}

@ -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<TimeTabDTO> GetAllTimeTab();
}
}

@ -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; }
}
}

@ -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<SlaveConnectionConfig>()
{
//第一个从库
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;
}

@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SqlSugarCore" Version="5.1.4.148" />
</ItemGroup>
</Project>

@ -0,0 +1,24 @@
using System;
using System.Linq;
using System.Text;
namespace Models
{
///<summary>
///
///</summary>
public partial class current_project
{
public current_project(){
}
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public int current_project_id {get;set;}
}
}

@ -0,0 +1,59 @@
using System;
using System.Linq;
using System.Text;
namespace Models
{
///<summary>
///
///</summary>
public partial class global_config
{
public global_config(){
}
/// <summary>
/// Desc:
/// Default:"c:\\project"
/// Nullable:False
/// </summary>
public string base_path {get;set;}
/// <summary>
/// Desc:
/// Default:"https://www.txgy.xyz/api/index/push"
/// Nullable:False
/// </summary>
public string push_wx_url {get;set;}
/// <summary>
/// Desc:
/// Default:2
/// Nullable:False
/// </summary>
public int push_wx_company_id {get;set;}
/// <summary>
/// Desc:
/// Default:1
/// Nullable:False
/// </summary>
public int push_wx_message_id {get;set;}
/// <summary>
/// Desc:
/// Default:事件通知
/// Nullable:False
/// </summary>
public string push_wx_content {get;set;}
/// <summary>
/// Desc:
/// Default:Y3qYFBQPMbfTt6m
/// Nullable:False
/// </summary>
public string push_wx_key {get;set;}
}
}

@ -0,0 +1,185 @@
using System;
using System.Linq;
using System.Text;
namespace Models
{
///<summary>
///
///</summary>
public partial class project_info
{
public project_info(){
}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public int? id {get;set;}
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public string project_name {get;set;}
/// <summary>
/// Desc:
/// Default:1
/// Nullable:False
/// </summary>
public int moni_layer {get;set;}
/// <summary>
/// Desc:
/// Default:1
/// Nullable:False
/// </summary>
public int moni_num {get;set;}
/// <summary>
/// Desc:
/// Default:"2024-04-01"
/// Nullable:False
/// </summary>
public string moni_date {get;set;}
/// <summary>
/// Desc:
/// Default:YA
/// Nullable:False
/// </summary>
public string network {get;set;}
/// <summary>
/// Desc:
/// Default:"06"
/// Nullable:False
/// </summary>
public string location {get;set;}
/// <summary>
/// Desc:
/// Default:"SHZ:SHN:SHE"
/// Nullable:False
/// </summary>
public string channels {get;set;}
/// <summary>
/// Desc:
/// Default:3837
/// Nullable:False
/// </summary>
public double xmin {get;set;}
/// <summary>
/// Desc:
/// Default:3838
/// Nullable:False
/// </summary>
public double xmax {get;set;}
/// <summary>
/// Desc:
/// Default:402
/// Nullable:False
/// </summary>
public double ymin {get;set;}
/// <summary>
/// Desc:
/// Default:403
/// Nullable:False
/// </summary>
public double ymax {get;set;}
/// <summary>
/// Desc:
/// Default:200
/// Nullable:False
/// </summary>
public double zmin {get;set;}
/// <summary>
/// Desc:
/// Default:900
/// Nullable:False
/// </summary>
public double zmax {get;set;}
/// <summary>
/// Desc:
/// Default:0
/// Nullable:False
/// </summary>
public int local_save_result {get;set;}
/// <summary>
/// Desc:
/// Default:result
/// Nullable:False
/// </summary>
public string save_result_path {get;set;}
/// <summary>
/// Desc:
/// Default:0
/// Nullable:False
/// </summary>
public int local_save_waves {get;set;}
/// <summary>
/// Desc:
/// Default:wavesdata
/// Nullable:False
/// </summary>
public string save_waves_path {get;set;}
/// <summary>
/// Desc:
/// Default:1
/// Nullable:False
/// </summary>
public int send_redis {get;set;}
/// <summary>
/// Desc:
/// Default:"127.0.0.1:1883"
/// Nullable:False
/// </summary>
public string mqtt_server {get;set;}
/// <summary>
/// Desc:
/// Default:0
/// Nullable:False
/// </summary>
public int push_wx {get;set;}
/// <summary>
/// Desc:
/// Default:- 1.0
/// Nullable:False
/// </summary>
public double push_wx_value {get;set;}
/// <summary>
/// Desc:
/// Default:8
/// Nullable:False
/// </summary>
public int push_wx_area_id {get;set;}
/// <summary>
/// Desc:
/// Default:2
/// Nullable:False
/// </summary>
public int push_wx_company_id {get;set;}
}
}

@ -0,0 +1,108 @@
using System;
using System.Linq;
using System.Text;
namespace Models
{
///<summary>
///
///</summary>
public partial class result
{
public result(){
}
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public int id {get;set;}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public int? project_id {get;set;}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string otime {get;set;}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public double? e {get;set;}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public double? n {get;set;}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public double? depth {get;set;}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public double? ml {get;set;}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public double? energy {get;set;}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public double? rms {get;set;}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public int? phases_count {get;set;}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public int? amps_count {get;set;}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string seismic_source {get;set;}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public double? seismic_direction {get;set;}
}
}

@ -0,0 +1,38 @@
using System;
using System.Linq;
using System.Text;
namespace Models
{
///<summary>
///
///</summary>
public partial class result_json
{
public result_json(){
}
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public int id {get;set;}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public int? result_id {get;set;}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string json {get;set;}
}
}

@ -0,0 +1,38 @@
using System;
using System.Linq;
using System.Text;
namespace Models
{
///<summary>
///
///</summary>
public partial class station_file
{
public station_file(){
}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public int? id {get;set;}
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public int project_id {get;set;}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string file_name {get;set;}
}
}

@ -0,0 +1,31 @@
using System;
using System.Linq;
using System.Text;
namespace Models
{
///<summary>
///
///</summary>
public partial class station_num_vpn
{
public station_num_vpn(){
}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string num {get;set;}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string vpn_name {get;set;}
}
}

@ -0,0 +1,94 @@
using System;
using System.Linq;
using System.Text;
namespace Models
{
///<summary>
///
///</summary>
public partial class stations
{
public stations(){
}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public int? id {get;set;}
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public int project_id {get;set;}
/// <summary>
/// Desc:
/// Default:YA
/// Nullable:False
/// </summary>
public string network {get;set;}
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public string num {get;set;}
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public double coord_e {get;set;}
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public double coord_n {get;set;}
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public double altitude {get;set;}
/// <summary>
/// Desc:
/// Default:3200000000
/// Nullable:False
/// </summary>
public int sens {get;set;}
/// <summary>
/// Desc:
/// Default:"2023-01-01T00:00:00.000"
/// Nullable:False
/// </summary>
public string begin_time {get;set;}
/// <summary>
/// Desc:
/// Default:"2026-12-31T23:59:59.000"
/// Nullable:False
/// </summary>
public string end_time {get;set;}
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public string site_number {get;set;}
}
}

@ -0,0 +1,45 @@
using System;
using System.Linq;
using System.Text;
namespace Models
{
///<summary>
///
///</summary>
public partial class time_tab
{
public time_tab(){
}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public int? id {get;set;}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public int? project_id {get;set;}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string filename {get;set;}
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string file_content {get;set;}
}
}

@ -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

@ -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<GlobalConfigController> 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<GlobalConfigDTO> GetAllGlobalConfig()
{
return _globalConfigService.GetAllGlobalConfig();
}
}
}

@ -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<ProjectInfoController> 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<ProjectInfoDTO> GetAllProjectInfo()
{
return _projectInfoService.GetAllProjectInfo();
}
[HttpGet]
public ProjectInfoDTO GetCurrentProjectInfo()
{
return _projectInfoService.GetCurrentProjectInfo();
}
//[HttpPost]
//public void Post([FromBody] string value)
//{
//}
}
}

@ -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<ResultInfoController> 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<ResultJsonDTO> GetAllResultInfo()
{
return _resultInfoService.GetAllResultInfo();
}
}
}

@ -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<StationsController> 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<StationsDTO> GetAllStationss()
{
return _stationsService.GetAllStations();
}
}
}

@ -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<TimeTabController> 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<TimeTabDTO> GetAllTimeTabs()
{
return _timeTabService.GetAllTimeTab();
}
}
}

@ -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<WeatherForecastController> _logger;
private readonly IDataAccessService _dataAccessDal;
public WeatherForecastController(ILogger<WeatherForecastController> logger, IDataAccessService dataAccessDal)
public WeatherForecastController(ILogger<WeatherForecastController> logger, IProjectInfoService projectInfoService)
{
_logger = logger;
this._dataAccessDal = dataAccessDal;
var pro= projectInfoService.GetCurrentProjectInfo();
}
[HttpGet(Name = "GetWeatherForecast")]
public IEnumerable<WeatherForecast> Get()
{
var a = _dataAccessDal.GetIcons();
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = DateTime.Now.AddDays(index),

@ -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<ISqlSugarClient>(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();

@ -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

@ -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<string> GetIcons()
{
var data = _Client.Queryable<Result>().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)
{
}
}
}

@ -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<global_config>(globalConfigDTO);
res = _Client.Insertable(global_Config).ExecuteCommand();
if (res > 0)
{
return new ApiResult();
}
return new ApiResult() { Message = "添加失败" };
}
public List<GlobalConfigDTO> GetAllGlobalConfig()
{
var global_Config = _Client.Queryable<global_config>().ToList();
return _iMapper.Map<List<GlobalConfigDTO>>(global_Config);
}
public GlobalConfigDTO GetGlobalConfig(int id)
{
return new GlobalConfigDTO();
}
public ApiResult UpdateGlobalConfig(GlobalConfigDTO GlobalConfigDTO)
{
global_config global_Config = _iMapper.Map<global_config> (GlobalConfigDTO);
int res= _Client.Updateable<global_config>(global_Config).ExecuteCommand();
if(res > 0)
{
return new ApiResult();
}
return new ApiResult() { Message = "更新失败" };
}
}
}

@ -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) { }
}
}

@ -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_info>(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<project_info>(p=>p.id==id).ExecuteCommand();
if (res > 0)
{
return new ApiResult();
}
return new ApiResult() { Message = "删除失败" };
}
public List<ProjectInfoDTO> GetAllProjectInfo()
{
var projects = _Client.Queryable<project_info>().ToList();
return _iMapper.Map<List<ProjectInfoDTO>>(projects);
}
public ProjectInfoDTO GetCurrentProjectInfo()
{
var curProject = _Client.Queryable<current_project>().First();
project_info projectInfo = _Client.Queryable<project_info>().First(c => c.id == curProject.current_project_id);
ProjectInfoDTO projectInfoDTO= _iMapper.Map<project_info, ProjectInfoDTO>(projectInfo);
return projectInfoDTO;
}
public ProjectInfoDTO GetProjectInfo(int id)
{
project_info projectInfo = _Client.Queryable<project_info>().First(c => c.id == id);
ProjectInfoDTO projectInfoDTO = _iMapper.Map<project_info, ProjectInfoDTO>(projectInfo);
return projectInfoDTO;
}
public ApiResult UpdateProjectInfo(ProjectInfoDTO project)
{
project_info projectInfo = _iMapper.Map<ProjectInfoDTO, project_info> (project);
int res= _Client.Updateable<project_info>(projectInfo).ExecuteCommand();
if(res > 0)
{
return new ApiResult();
}
return new ApiResult() { Message = "更新失败" };
}
}
}

@ -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<result_json>(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<result_json>(p=>p.id==id).ExecuteCommand();
if (res > 0)
{
return new ApiResult();
}
return new ApiResult() { Message = "删除失败" };
}
public List<ResultJsonDTO> GetAllResultInfo()
{
var projects = _Client.Queryable<result_json>().ToList();
return _iMapper.Map<List<ResultJsonDTO>>(projects);
}
public ResultJsonDTO GetResultInfo(int id)
{
result_json result_Json = _Client.Queryable<result_json>().First(c => c.id == id);
ResultJsonDTO resultJsonDTO = _iMapper.Map<ResultJsonDTO>(result_Json);
return resultJsonDTO;
}
public ApiResult UpdateResultInfo(ResultJsonDTO resultJsonDTO)
{
result_json result_Json = _iMapper.Map<result_json> (resultJsonDTO);
int res= _Client.Updateable<result_json>(result_Json).ExecuteCommand();
if(res > 0)
{
return new ApiResult();
}
return new ApiResult() { Message = "更新失败" };
}
}
}

@ -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<stations>(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<stations>(p=>p.id==id).ExecuteCommand();
if (res > 0)
{
return new ApiResult();
}
return new ApiResult() { Message = "删除失败" };
}
public List<StationsDTO> GetAllStations()
{
var projects = _Client.Queryable<stations>().ToList();
return _iMapper.Map<List<StationsDTO>>(projects);
}
public StationsDTO GetStations(int id)
{
stations station = _Client.Queryable<stations>().First(c => c.id == id);
StationsDTO stationsDTO = _iMapper.Map<StationsDTO>(station);
return stationsDTO;
}
public ApiResult UpdateStations(StationsDTO stationsDTO)
{
stations station = _iMapper.Map<stations> (stationsDTO);
int res= _Client.Updateable<stations>(station).ExecuteCommand();
if(res > 0)
{
return new ApiResult();
}
return new ApiResult() { Message = "更新失败" };
}
}
}

@ -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<time_tab>(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<time_tab>(p=>p.id==id).ExecuteCommand();
if (res > 0)
{
return new ApiResult();
}
return new ApiResult() { Message = "删除失败" };
}
public List<TimeTabDTO> GetAllTimeTab()
{
var projects = _Client.Queryable<time_tab>().ToList();
return _iMapper.Map<List<TimeTabDTO>>(projects);
}
public TimeTabDTO GetTimeTab(int id)
{
time_tab time_Tab = _Client.Queryable<time_tab>().First(c => c.id == id);
TimeTabDTO TimeTabDTO = _iMapper.Map<TimeTabDTO>(time_Tab);
return TimeTabDTO;
}
public ApiResult UpdateTimeTab(TimeTabDTO TimeTabDTO)
{
time_tab station = _iMapper.Map<time_tab> (TimeTabDTO);
int res= _Client.Updateable<time_tab>(station).ExecuteCommand();
if(res > 0)
{
return new ApiResult();
}
return new ApiResult() { Message = "更新失败" };
}
}
}
Loading…
Cancel
Save