Очистка и анализ кода

This commit is contained in:
Фролов 2021-08-09 15:41:42 +05:00
parent a14e5134bf
commit 3a325f6c94
36 changed files with 120 additions and 140 deletions

View File

@ -1,8 +1,4 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AsbCloudApp.Data namespace AsbCloudApp.Data
{ {

View File

@ -1,10 +1,4 @@
using System; namespace AsbCloudApp.Data
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AsbCloudApp.Data
{ {
public class WellOperationDto : IId public class WellOperationDto : IId
{ {

View File

@ -1,6 +1,6 @@
using System; using AsbCloudApp.Data;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using AsbCloudApp.Data;
namespace AsbCloudApp.Services namespace AsbCloudApp.Services
{ {

View File

@ -1,5 +1,5 @@
using System.Collections.Generic; using AsbCloudApp.Data;
using AsbCloudApp.Data; using System.Collections.Generic;
namespace AsbCloudApp.Services namespace AsbCloudApp.Services
{ {

View File

@ -139,7 +139,8 @@ namespace AsbCloudDb.Model
.HasConstraintName("t_well_t_telemetry_id_fk"); .HasConstraintName("t_well_t_telemetry_id_fk");
}); });
modelBuilder.Entity<RelationCompanyWell>(entity => { modelBuilder.Entity<RelationCompanyWell>(entity =>
{
entity.HasKey(nameof(RelationCompanyWell.IdCompany), nameof(RelationCompanyWell.IdWell)); entity.HasKey(nameof(RelationCompanyWell.IdCompany), nameof(RelationCompanyWell.IdWell));
@ -298,7 +299,8 @@ namespace AsbCloudDb.Model
}); });
}); });
modelBuilder.Entity<RelationCompanyWell>(entity => { modelBuilder.Entity<RelationCompanyWell>(entity =>
{
entity.HasData(new List<RelationCompanyWell> { entity.HasData(new List<RelationCompanyWell> {
new RelationCompanyWell{ IdWell = 1, IdCompany = 1}, new RelationCompanyWell{ IdWell = 1, IdCompany = 1},
new RelationCompanyWell{ IdWell = 2, IdCompany = 1}, new RelationCompanyWell{ IdWell = 2, IdCompany = 1},

View File

@ -1,6 +1,4 @@
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
#nullable disable #nullable disable

View File

@ -1,5 +1,5 @@
using System.Collections.Generic; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;

View File

@ -1,8 +1,5 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mapster namespace Mapster
{ {

View File

@ -74,7 +74,8 @@ namespace AsbSaubReport
var dataMinDate = dataQuery.Min(e => e.Date); var dataMinDate = dataQuery.Min(e => e.Date);
var dataMaxDate = dataQuery.Max(e => e.Date); var dataMaxDate = dataQuery.Max(e => e.Date);
var result = new AnalyzeResult { var result = new AnalyzeResult
{
MaxDate = dataMinDate < messagesMinDate ? dataMinDate : messagesMinDate, MaxDate = dataMinDate < messagesMinDate ? dataMinDate : messagesMinDate,
MinDate = dataMaxDate > messagesMaxDate ? dataMaxDate : messagesMaxDate, MinDate = dataMaxDate > messagesMaxDate ? dataMaxDate : messagesMaxDate,
MessagesCount = messagesCount, MessagesCount = messagesCount,

View File

@ -2,11 +2,11 @@
using AsbCloudApp.Services; using AsbCloudApp.Services;
using AsbCloudDb.Model; using AsbCloudDb.Model;
using AsbCloudInfrastructure.Services.Cache; using AsbCloudInfrastructure.Services.Cache;
using Mapster;
using Microsoft.EntityFrameworkCore;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Microsoft.EntityFrameworkCore;
using Mapster;
namespace AsbCloudInfrastructure.Services namespace AsbCloudInfrastructure.Services
{ {

View File

@ -1,9 +1,9 @@
using System.Collections.Generic; using AsbCloudApp.Services;
using System.Linq;
using AsbCloudDb.Model; using AsbCloudDb.Model;
using AsbCloudApp.Services;
using Mapster; using Mapster;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.Linq;
namespace AsbCloudInfrastructure.Services namespace AsbCloudInfrastructure.Services
{ {

View File

@ -1,10 +1,10 @@
using System; using AsbCloudApp.Data;
using System.Linq;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using AsbCloudApp.Data;
using AsbCloudApp.Services; using AsbCloudApp.Services;
using AsbCloudDb.Model; using AsbCloudDb.Model;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
namespace AsbCloudInfrastructure.Services namespace AsbCloudInfrastructure.Services
{ {
@ -12,13 +12,11 @@ namespace AsbCloudInfrastructure.Services
{ {
public string RootPath { get; private set; } public string RootPath { get; private set; }
private readonly IAsbCloudDbContext db; private readonly IAsbCloudDbContext db;
private readonly ITelemetryService telemetryService;
public FileService(IAsbCloudDbContext db, ITelemetryService telemetryService) public FileService(IAsbCloudDbContext db)
{ {
RootPath = "files"; RootPath = "files";
this.db = db; this.db = db;
this.telemetryService = telemetryService;
} }
public IDictionary<string, int> SaveFilesPropertiesToDb(int idWell, int idCategory, public IDictionary<string, int> SaveFilesPropertiesToDb(int idWell, int idCategory,

View File

@ -1,7 +1,7 @@
using System.Linq; using AsbCloudApp.Services;
using AsbCloudDb.Model; using AsbCloudDb.Model;
using AsbCloudApp.Services;
using Mapster; using Mapster;
using System.Linq;
using System.Text.Json; using System.Text.Json;
namespace AsbCloudInfrastructure.Services namespace AsbCloudInfrastructure.Services

View File

@ -1,5 +1,5 @@
using AsbCloudDb.Model; using AsbCloudApp.Data;
using AsbCloudApp.Data; using AsbCloudDb.Model;
using System; using System;
namespace AsbCloudInfrastructure.Services namespace AsbCloudInfrastructure.Services

View File

@ -1,5 +1,5 @@
using AsbCloudDb.Model; using AsbCloudApp.Data;
using AsbCloudApp.Data; using AsbCloudDb.Model;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;

View File

@ -37,13 +37,15 @@ namespace AsbCloudInfrastructure.Services
Latitude = gDeposit.Key.Latitude, Latitude = gDeposit.Key.Latitude,
Longitude = gDeposit.Key.Longitude, Longitude = gDeposit.Key.Longitude,
Description = "", Description = "",
Clusters = gDeposit.Select(gCluster=>new ClusterDto { Clusters = gDeposit.Select(gCluster => new ClusterDto
{
Id = gCluster.Key.Id, Id = gCluster.Key.Id,
Caption = gCluster.Key.Caption, Caption = gCluster.Key.Caption,
Latitude = gCluster.Key.Latitude, Latitude = gCluster.Key.Latitude,
Longitude = gCluster.Key.Longitude, Longitude = gCluster.Key.Longitude,
Description = "", Description = "",
Wells = gCluster.Select(well => new WellDto { Wells = gCluster.Select(well => new WellDto
{
Id = well.Id, Id = well.Id,
Caption = well.Caption, Caption = well.Caption,
Latitude = well.Latitude, Latitude = well.Latitude,
@ -169,7 +171,8 @@ namespace AsbCloudInfrastructure.Services
var clusterById = db.Clusters.FirstOrDefault(c => c.Id == idCluster); var clusterById = db.Clusters.FirstOrDefault(c => c.Id == idCluster);
return new ClusterStatDto { return new ClusterStatDto
{
Id = clusterById.Id, Id = clusterById.Id,
Description = "", Description = "",
Caption = clusterById.Caption, Caption = clusterById.Caption,

View File

@ -1,7 +1,6 @@
using Microsoft.AspNetCore.Mvc; using AsbCloudApp.Data;
using System.Collections.Generic;
using AsbCloudApp.Data;
using AsbCloudApp.Services; using AsbCloudApp.Services;
using Microsoft.AspNetCore.Mvc;
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 // For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

View File

@ -1,11 +1,11 @@
using System; using AsbCloudApp.Data;
using System.Linq;
using System.IO;
using AsbCloudApp.Data;
using AsbCloudApp.Services; using AsbCloudApp.Services;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.IO;
using System.Linq;
namespace AsbCloudWebApi.Controllers namespace AsbCloudWebApi.Controllers
{ {

View File

@ -1,7 +1,7 @@
using Microsoft.AspNetCore.Mvc; using AsbCloudApp.Data;
using Microsoft.AspNetCore.Authorization;
using AsbCloudApp.Data;
using AsbCloudApp.Services; using AsbCloudApp.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace AsbCloudWebApi.Controllers namespace AsbCloudWebApi.Controllers
{ {

View File

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc; using AsbCloudApp.Services;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using AsbCloudApp.Services; using Microsoft.AspNetCore.Mvc;
namespace AsbCloudWebApi.Controllers namespace AsbCloudWebApi.Controllers
{ {

View File

@ -1,7 +1,7 @@
using Microsoft.AspNetCore.Mvc; using AsbCloudApp.Data;
using Microsoft.AspNetCore.Authorization;
using AsbCloudApp.Data;
using AsbCloudApp.Services; using AsbCloudApp.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace AsbCloudWebApi.Controllers namespace AsbCloudWebApi.Controllers
{ {

View File

@ -1,7 +1,7 @@
using Microsoft.AspNetCore.Mvc; using AsbCloudApp.Data;
using Microsoft.AspNetCore.Authorization;
using AsbCloudApp.Data;
using AsbCloudApp.Services; using AsbCloudApp.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace AsbCloudWebApi.Controllers namespace AsbCloudWebApi.Controllers
{ {

View File

@ -1,12 +1,7 @@
using AsbCloudApp.Data; using AsbCloudApp.Data;
using AsbCloudApp.Services; using AsbCloudApp.Services;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace AsbCloudWebApi.Controllers namespace AsbCloudWebApi.Controllers
{ {

View File

@ -6,9 +6,6 @@
//using AutoMapper; //using AutoMapper;
//using Microsoft.EntityFrameworkCore; //using Microsoft.EntityFrameworkCore;
using System; using System;
using System.Collections.Generic;
using System.IO;
using Mapster;
namespace ConsoleApp1 namespace ConsoleApp1
{ {