Add some update
Add a TODO for the ideas
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using Microsoft.AspNetCore.Cors;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using skydiveLogs_api.DataContract;
|
||||
using skydiveLogs_api.Domain;
|
||||
using skydiveLogs_api.DomainBusiness.Interfaces;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -49,12 +50,13 @@ namespace skydiveLogs_api.Controllers
|
||||
}
|
||||
|
||||
// POST: api/Tunnel
|
||||
//[HttpPost]
|
||||
//[EnableCors]
|
||||
//public void Post([FromBody] TunnelReq value)
|
||||
//{
|
||||
// _tunnelService.AddNewJumpType(_mapper.Map<Tunnel>(value));
|
||||
//}
|
||||
[HttpPost]
|
||||
[EnableCors]
|
||||
public void Post([FromBody] TunnelFlightReq value)
|
||||
{
|
||||
_tunnelService.AddNewFlight(value.TunnelId,
|
||||
_mapper.Map<TunnelFlight>(value));
|
||||
}
|
||||
|
||||
// PUT: api/Tunnel/5
|
||||
//[HttpPut("{id}")]
|
||||
|
||||
17
Back/skydiveLogs-api/DataContract/TunnelFlightReq.cs
Normal file
17
Back/skydiveLogs-api/DataContract/TunnelFlightReq.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
|
||||
namespace skydiveLogs_api.DataContract
|
||||
{
|
||||
public class TunnelFlightReq
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public int TunnelId { get; set; }
|
||||
|
||||
public int NbMinutes { get; set; }
|
||||
|
||||
public string Notes { get; set; }
|
||||
|
||||
public DateTime FlightDate { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace skydiveLogs_api.DataContract
|
||||
{
|
||||
public class TunnelReq
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public string Latitude { get; set; }
|
||||
|
||||
public string Longitude { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Address { get; set; }
|
||||
|
||||
public string Website { get; set; }
|
||||
|
||||
public string Email { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ namespace skydiveLogs_api.Mapper
|
||||
CreateMap<DataContract.GearReq, Gear>();
|
||||
CreateMap<DataContract.UserReq, User>();
|
||||
CreateMap<DataContract.ImageReq, UserImage>();
|
||||
CreateMap<DataContract.TunnelReq, Tunnel>();
|
||||
CreateMap<DataContract.TunnelFlightReq, TunnelFlight>();
|
||||
|
||||
CreateMap<Gear, DataContract.GearResp>();
|
||||
CreateMap<Jump, DataContract.JumpResp>().ForMember(dest => dest.AircraftId, opt => opt.MapFrom(s => s.Aircraft.Id))
|
||||
|
||||
Reference in New Issue
Block a user