Skip to content

Commit

Permalink
remove unnecessary changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioIvancik committed Nov 6, 2023
1 parent 9728a50 commit 51834b7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 31 deletions.
30 changes: 1 addition & 29 deletions BE/Artin.BringAuto/Controllers/CarController.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
using Artin.BringAuto.Shared;
using Artin.BringAuto.Shared.Butons;
using Artin.BringAuto.Shared.Cars;
using Artin.BringAuto.Shared.Enums;
using Artin.BringAuto.Shared.LocationHistory;
using AutoMapper;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ApplicationParts;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
Expand All @@ -21,18 +18,15 @@ namespace Artin.BringAuto.Controllers
[Route("[controller]")]
public class CarController : ControllerBase
{
private readonly ILogger<CarController> logger;
private readonly ICarRepository carRepository;
private readonly ILocationHistoryRepository locationHistoryRepository;
private readonly IButtonRepository buttonRepository;
private readonly IMapper mapper;

public CarController(ICarRepository carRepository, ILocationHistoryRepository locationHistoryRepository,
IButtonRepository buttonRepository,
IMapper mapper,
ILogger<CarController> logger)
IMapper mapper)
{
this.logger = logger;
this.carRepository = carRepository;
this.locationHistoryRepository = locationHistoryRepository;
this.buttonRepository = buttonRepository;
Expand Down Expand Up @@ -69,27 +63,5 @@ public async Task<ActionResult<Car>> UpdateCarButtonStatus(CarButtonStatus butto
}
return null;
}

[HttpPost("startstop")]
[AllowAnonymous]
public async Task<ActionResult<Car>> StartStopCar(string companyName, string carName, CarStatusInfo aaaa)
{
logger.LogInformation($"startstop request reached company: {companyName}, car: {carName}");
//var carStatus = await carRepository.GetCarStatus(companyName, carName);
//var startstop = await carRepository.GetStartStopToggle(companyName, carName);
/*TODO backend has no idea about car state
if (carStatus == CarStatus.Driving || startstop)
{*/
aaaa.Longitude = 0;
aaaa.Latitude = 0;
aaaa.Status = CarStatus.Driving;

await carRepository.UpdateStatusAsync(3, aaaa);
//await carRepository.UpdateStartStopToggle(companyName, carName);
logger.LogInformation("startstop request finished");
return null;
//}
//TODO zisti id auta a skus to s tym zmenit, ked nie zisti jak sa autorizovat
}
}
}
2 changes: 0 additions & 2 deletions BE/Artin.BringAuto/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@
using HotChocolate;
using HotChocolate.AspNetCore;
using HotChocolate.AspNetCore.Subscriptions;
using HotChocolate.Execution.Configuration;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
Expand Down

0 comments on commit 51834b7

Please sign in to comment.