forked from MDCPS/DamageAssessment_Backend
Fix for Namespace SurveyResponses
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
using DamageAssesment.Api.SurveyResponses.Interfaces;
|
||||
using DamageAssesment.Api.SurveyResponses.Models;
|
||||
using DamageAssesment.Api.Responses.Interfaces;
|
||||
using DamageAssesment.Api.Responses.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Controllers
|
||||
namespace DamageAssesment.Api.Responses.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
public class SurveyResponsesController : ControllerBase
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Db
|
||||
namespace DamageAssesment.Api.Responses.Db
|
||||
{
|
||||
public class SurveyResponse
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Db
|
||||
namespace DamageAssesment.Api.Responses.Db
|
||||
{
|
||||
public class SurveyResponseDbContext:DbContext
|
||||
{
|
||||
|
@ -6,10 +6,10 @@ EXPOSE 80
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
||||
WORKDIR /src
|
||||
COPY ["DamageAssesment.Api.SurveyResponses/DamageAssesment.Api.Responses.csproj", "DamageAssesment.Api.SurveyResponses/"]
|
||||
RUN dotnet restore "DamageAssesment.Api.SurveyResponses/DamageAssesment.Api.Responses.csproj"
|
||||
COPY ["DamageAssesment.Api.Responses/DamageAssesment.Api.Responses.csproj", "DamageAssesment.Api.Responses/"]
|
||||
RUN dotnet restore "DamageAssesment.Api.Responses/DamageAssesment.Api.Responses.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/DamageAssesment.Api.SurveyResponses"
|
||||
WORKDIR "/src/DamageAssesment.Api.Responses"
|
||||
RUN dotnet build "DamageAssesment.Api.Responses.csproj" -c Release -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
|
@ -1,6 +1,6 @@
|
||||
using DamageAssesment.Api.SurveyResponses.Models;
|
||||
using DamageAssesment.Api.Responses.Models;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Interfaces
|
||||
namespace DamageAssesment.Api.Responses.Interfaces
|
||||
{
|
||||
public interface IAnswerServiceProvider
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using DamageAssesment.Api.SurveyResponses.Models;
|
||||
using DamageAssesment.Api.Responses.Models;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Interfaces
|
||||
namespace DamageAssesment.Api.Responses.Interfaces
|
||||
{
|
||||
public interface IAttachmentServiceProvider
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using DamageAssesment.Api.SurveyResponses.Models;
|
||||
using DamageAssesment.Api.Responses.Models;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Interfaces
|
||||
namespace DamageAssesment.Api.Responses.Interfaces
|
||||
{
|
||||
public interface IEmployeeServiceProvider
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using DamageAssesment.Api.SurveyResponses.Models;
|
||||
using DamageAssesment.Api.Responses.Models;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Interfaces
|
||||
namespace DamageAssesment.Api.Responses.Interfaces
|
||||
{
|
||||
public interface IHttpUtil
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using DamageAssesment.Api.SurveyResponses.Models;
|
||||
using DamageAssesment.Api.Responses.Models;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Interfaces
|
||||
namespace DamageAssesment.Api.Responses.Interfaces
|
||||
{
|
||||
public interface ILocationServiceProvider
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using DamageAssesment.Api.SurveyResponses.Models;
|
||||
using DamageAssesment.Api.Responses.Models;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Interfaces
|
||||
namespace DamageAssesment.Api.Responses.Interfaces
|
||||
{
|
||||
public interface IQuestionServiceProvider
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using DamageAssesment.Api.SurveyResponses.Models;
|
||||
using DamageAssesment.Api.Responses.Models;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Interfaces
|
||||
namespace DamageAssesment.Api.Responses.Interfaces
|
||||
{
|
||||
public interface IRegionServiceProvider
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using DamageAssesment.Api.SurveyResponses.Models;
|
||||
using DamageAssesment.Api.Responses.Models;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Interfaces
|
||||
namespace DamageAssesment.Api.Responses.Interfaces
|
||||
{
|
||||
public interface ISurveyServiceProvider
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
using DamageAssesment.Api.SurveyResponses.Models;
|
||||
using DamageAssesment.Api.Responses.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Interfaces
|
||||
namespace DamageAssesment.Api.Responses.Interfaces
|
||||
{
|
||||
public interface ISurveysResponse
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Models
|
||||
namespace DamageAssesment.Api.Responses.Models
|
||||
{
|
||||
public class Answer
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace DamageAssesment.Api.SurveyResponses.Models
|
||||
namespace DamageAssesment.Api.Responses.Models
|
||||
{
|
||||
public class AnswerRequest
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Models
|
||||
namespace DamageAssesment.Api.Responses.Models
|
||||
{
|
||||
public class Attachment
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace DamageAssesment.Api.SurveyResponses.Models
|
||||
namespace DamageAssesment.Api.Responses.Models
|
||||
{
|
||||
public class AttachmentInfo
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Models
|
||||
namespace DamageAssesment.Api.Responses.Models
|
||||
{
|
||||
public class Employee
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace DamageAssesment.Api.SurveyResponses.Models
|
||||
namespace DamageAssesment.Api.Responses.Models
|
||||
{
|
||||
public class Location
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Models
|
||||
namespace DamageAssesment.Api.Responses.Models
|
||||
{
|
||||
public class Question
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Models
|
||||
namespace DamageAssesment.Api.Responses.Models
|
||||
{
|
||||
public class Region
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace DamageAssesment.Api.SurveyResponses.Models
|
||||
namespace DamageAssesment.Api.Responses.Models
|
||||
{
|
||||
public class Request
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Models
|
||||
namespace DamageAssesment.Api.Responses.Models
|
||||
{
|
||||
public class Survey
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace DamageAssesment.Api.SurveyResponses.Models
|
||||
namespace DamageAssesment.Api.Responses.Models
|
||||
{
|
||||
public class SurveyQuestions
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Models
|
||||
namespace DamageAssesment.Api.Responses.Models
|
||||
{
|
||||
public class SurveyResponse
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace DamageAssesment.Api.SurveyResponses.Models
|
||||
namespace DamageAssesment.Api.Responses.Models
|
||||
{
|
||||
public class SurveyTranslation
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace DamageAssesment.Api.SurveyResponses.Profiles
|
||||
namespace DamageAssesment.Api.Responses.Profiles
|
||||
{
|
||||
public class SurveyResponsesProvider : AutoMapper.Profile
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
using DamageAssesment.Api.SurveyResponses.Db;
|
||||
using DamageAssesment.Api.SurveyResponses.Interfaces;
|
||||
using DamageAssesment.Api.SurveyResponses.Services;
|
||||
using DamageAssesment.Api.SurveyResponses.Providers;
|
||||
using DamageAssesment.Api.Responses.Db;
|
||||
using DamageAssesment.Api.Responses.Interfaces;
|
||||
using DamageAssesment.Api.Responses.Services;
|
||||
using DamageAssesment.Api.Responses.Providers;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Polly;
|
||||
using System.Reflection;
|
||||
@ -44,7 +44,7 @@ builder.Services.AddSwaggerGen(c =>
|
||||
});
|
||||
builder.Services.AddDbContext<SurveyResponseDbContext>(option =>
|
||||
{
|
||||
option.UseInMemoryDatabase("SurveyResponses");
|
||||
option.UseInMemoryDatabase("Responses");
|
||||
});
|
||||
var app = builder.Build();
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
using AutoMapper;
|
||||
using DamageAssesment.Api.SurveyResponses.Db;
|
||||
using DamageAssesment.Api.SurveyResponses.Interfaces;
|
||||
using DamageAssesment.Api.SurveyResponses.Models;
|
||||
using DamageAssesment.Api.Responses.Db;
|
||||
using DamageAssesment.Api.Responses.Interfaces;
|
||||
using DamageAssesment.Api.Responses.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Providers
|
||||
namespace DamageAssesment.Api.Responses.Providers
|
||||
{
|
||||
public class SurveyResponsesProvider : ISurveysResponse
|
||||
{
|
||||
@ -40,10 +40,10 @@ namespace DamageAssesment.Api.SurveyResponses.Providers
|
||||
{
|
||||
surveyResponseDbContext.SurveyResponses.Add(new Db.SurveyResponse { SurveyId = 1, EmployeeId = 1, LocationId = 1, ClientDevice = "Mobile", Latitude = 98.8767, Longitute = -129.9897, KeyAnswerResult = "true", CreatedDate = DateTime.Now });
|
||||
surveyResponseDbContext.SurveyResponses.Add(new Db.SurveyResponse { SurveyId = 1, EmployeeId = 2, LocationId = 2, ClientDevice = "Desktop", Latitude = 98.8767, Longitute = -129.9897, KeyAnswerResult = "true", CreatedDate = DateTime.Now });
|
||||
//surveyResponseDbContext.SurveyResponses.Add(new Db.SurveyResponse { Id = 3, SurveyId = 3, EmployeeId = 4, LocationId = 1, ClientDevice = "Mobile", Latitude = 98.8767, Longitute = -129.9897, KeyAnswerResult = "true", CreatedDate = DateTime.Now });
|
||||
//surveyResponseDbContext.SurveyResponses.Add(new Db.SurveyResponse { Id = 4, SurveyId = 4, EmployeeId = 1, LocationId = 2, ClientDevice = "Desktop", Latitude = 98.8767, Longitute = -129.9897, KeyAnswerResult = "false", CreatedDate = DateTime.Now });
|
||||
//surveyResponseDbContext.SurveyResponses.Add(new Db.SurveyResponse { Id = 6, SurveyId = 1, EmployeeId = 4, LocationId = 2, ClientDevice = "Desktop", Latitude = 98.8767, Longitute = -129.9897, KeyAnswerResult = "true", CreatedDate = DateTime.Now });
|
||||
//surveyResponseDbContext.SurveyResponses.Add(new Db.SurveyResponse { Id = 7, SurveyId = 1, EmployeeId = 4, LocationId = 3, ClientDevice = "Desktop", Latitude = 98.8767, Longitute = -129.9897, KeyAnswerResult = "false", CreatedDate = DateTime.Now });
|
||||
//surveyResponseDbContext.Responses.Add(new Db.SurveyResponse { Id = 3, SurveyId = 3, EmployeeId = 4, LocationId = 1, ClientDevice = "Mobile", Latitude = 98.8767, Longitute = -129.9897, KeyAnswerResult = "true", CreatedDate = DateTime.Now });
|
||||
//surveyResponseDbContext.Responses.Add(new Db.SurveyResponse { Id = 4, SurveyId = 4, EmployeeId = 1, LocationId = 2, ClientDevice = "Desktop", Latitude = 98.8767, Longitute = -129.9897, KeyAnswerResult = "false", CreatedDate = DateTime.Now });
|
||||
//surveyResponseDbContext.Responses.Add(new Db.SurveyResponse { Id = 6, SurveyId = 1, EmployeeId = 4, LocationId = 2, ClientDevice = "Desktop", Latitude = 98.8767, Longitute = -129.9897, KeyAnswerResult = "true", CreatedDate = DateTime.Now });
|
||||
//surveyResponseDbContext.Responses.Add(new Db.SurveyResponse { Id = 7, SurveyId = 1, EmployeeId = 4, LocationId = 3, ClientDevice = "Desktop", Latitude = 98.8767, Longitute = -129.9897, KeyAnswerResult = "false", CreatedDate = DateTime.Now });
|
||||
surveyResponseDbContext.SaveChanges();
|
||||
}
|
||||
}
|
||||
@ -851,7 +851,7 @@ namespace DamageAssesment.Api.SurveyResponses.Providers
|
||||
}
|
||||
}
|
||||
|
||||
//var surveyResponses = await surveyResponseDbContext.SurveyResponses.Where(x => x.SurveyId == survey.Id).ToListAsync();
|
||||
//var surveyResponses = await surveyResponseDbContext.Responses.Where(x => x.SurveyId == survey.Id).ToListAsync();
|
||||
// var employees = await employeeServiceProvider.getEmployeesAsync();
|
||||
var answers = await answerServiceProvider.getAnswersAsync();
|
||||
var attachments = await attachmentServiceProvider.getAttachmentsAsync();
|
||||
|
@ -1,9 +1,9 @@
|
||||
using DamageAssesment.Api.SurveyResponses.Interfaces;
|
||||
using DamageAssesment.Api.SurveyResponses.Models;
|
||||
using DamageAssesment.Api.Responses.Interfaces;
|
||||
using DamageAssesment.Api.Responses.Models;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Services
|
||||
namespace DamageAssesment.Api.Responses.Services
|
||||
{
|
||||
public class AnswerServiceProvider : ServiceProviderBase, IAnswerServiceProvider
|
||||
{
|
||||
|
@ -1,8 +1,8 @@
|
||||
using DamageAssesment.Api.SurveyResponses.Interfaces;
|
||||
using DamageAssesment.Api.SurveyResponses.Models;
|
||||
using DamageAssesment.Api.Responses.Interfaces;
|
||||
using DamageAssesment.Api.Responses.Models;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Services
|
||||
namespace DamageAssesment.Api.Responses.Services
|
||||
{
|
||||
public class AttachmentServiceProvider : ServiceProviderBase, IAttachmentServiceProvider
|
||||
{
|
||||
|
@ -1,9 +1,9 @@
|
||||
using DamageAssesment.Api.SurveyResponses.Interfaces;
|
||||
using DamageAssesment.Api.SurveyResponses.Models;
|
||||
using DamageAssesment.Api.Responses.Interfaces;
|
||||
using DamageAssesment.Api.Responses.Models;
|
||||
using Microsoft.AspNetCore.Mvc.Routing;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Services
|
||||
namespace DamageAssesment.Api.Responses.Services
|
||||
{
|
||||
public class EmployeeServiceProvider : ServiceProviderBase, IEmployeeServiceProvider
|
||||
{
|
||||
|
@ -1,8 +1,8 @@
|
||||
using DamageAssesment.Api.SurveyResponses.Interfaces;
|
||||
using DamageAssesment.Api.Responses.Interfaces;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Services
|
||||
namespace DamageAssesment.Api.Responses.Services
|
||||
{
|
||||
public class HttpUtil : IHttpUtil
|
||||
{
|
||||
|
@ -1,8 +1,8 @@
|
||||
using DamageAssesment.Api.SurveyResponses.Interfaces;
|
||||
using DamageAssesment.Api.SurveyResponses.Models;
|
||||
using DamageAssesment.Api.Responses.Interfaces;
|
||||
using DamageAssesment.Api.Responses.Models;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Services
|
||||
namespace DamageAssesment.Api.Responses.Services
|
||||
{
|
||||
public class LocationServiceProvider :ServiceProviderBase, ILocationServiceProvider
|
||||
{
|
||||
|
@ -1,8 +1,8 @@
|
||||
using DamageAssesment.Api.SurveyResponses.Interfaces;
|
||||
using DamageAssesment.Api.SurveyResponses.Models;
|
||||
using DamageAssesment.Api.Responses.Interfaces;
|
||||
using DamageAssesment.Api.Responses.Models;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Services
|
||||
namespace DamageAssesment.Api.Responses.Services
|
||||
{
|
||||
public class QuestionServiceProvider : ServiceProviderBase, IQuestionServiceProvider
|
||||
{
|
||||
|
@ -1,8 +1,8 @@
|
||||
using DamageAssesment.Api.SurveyResponses.Interfaces;
|
||||
using DamageAssesment.Api.SurveyResponses.Models;
|
||||
using DamageAssesment.Api.Responses.Interfaces;
|
||||
using DamageAssesment.Api.Responses.Models;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Services
|
||||
namespace DamageAssesment.Api.Responses.Services
|
||||
{
|
||||
public class RegionServiceProvider : ServiceProviderBase, IRegionServiceProvider
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using DamageAssesment.Api.SurveyResponses.Interfaces;
|
||||
using DamageAssesment.Api.Responses.Interfaces;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Services
|
||||
namespace DamageAssesment.Api.Responses.Services
|
||||
{
|
||||
public class ServiceProviderBase
|
||||
{
|
||||
|
@ -1,8 +1,8 @@
|
||||
using DamageAssesment.Api.SurveyResponses.Interfaces;
|
||||
using DamageAssesment.Api.SurveyResponses.Models;
|
||||
using DamageAssesment.Api.Responses.Interfaces;
|
||||
using DamageAssesment.Api.Responses.Models;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace DamageAssesment.Api.SurveyResponses.Services
|
||||
namespace DamageAssesment.Api.Responses.Services
|
||||
{
|
||||
public class SurveyServiceProvider : ServiceProviderBase, ISurveyServiceProvider
|
||||
{
|
||||
|
Reference in New Issue
Block a user