Add drafts for Interface business and repository + DataContract presentation

This commit is contained in:
Sébastien André
2019-09-20 19:29:54 +02:00
parent 98d48ae2c6
commit 5d476e5e4e
25 changed files with 202 additions and 26 deletions

View File

@@ -4,6 +4,8 @@ using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using skydiveLogs_api.Business.Interface;
using skydiveLogs_api.DataContract;
namespace skydiveLogs_api.Controllers
{
@@ -11,6 +13,11 @@ namespace skydiveLogs_api.Controllers
[ApiController]
public class AircraftController : ControllerBase
{
public AircraftController(IAircraftService aircraftService)
{
_aircraftService = aircraftService;
}
// GET: api/Aircraft
[HttpGet]
public IEnumerable<AircraftResp> Get()
@@ -42,5 +49,7 @@ namespace skydiveLogs_api.Controllers
public void Delete(int id)
{
}
private readonly IAircraftService _aircraftService;
}
}

View File

@@ -4,6 +4,7 @@ using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using skydiveLogs_api.Business.Interface;
using skydiveLogs_api.DataContract;
namespace skydiveLogs_api.Controllers
@@ -12,6 +13,11 @@ namespace skydiveLogs_api.Controllers
[ApiController]
public class DropZoneController : ControllerBase
{
public DropZoneController(IDropZoneService dropZoneService)
{
_dropZoneService = dropZoneService;
}
// GET: api/DropZone
[HttpGet]
public IEnumerable<DropZoneResp> Get()
@@ -43,5 +49,7 @@ namespace skydiveLogs_api.Controllers
public void Delete(int id)
{
}
private readonly IDropZoneService _dropZoneService;
}
}

View File

@@ -4,6 +4,8 @@ using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using skydiveLogs_api.Business.Interface;
using skydiveLogs_api.DataContract;
namespace skydiveLogs_api.Controllers
{
@@ -11,6 +13,11 @@ namespace skydiveLogs_api.Controllers
[ApiController]
public class JumpController : ControllerBase
{
public JumpController(IJumpService jumpService)
{
_jumpService = jumpService;
}
// GET: api/Jump
[HttpGet]
public IEnumerable<JumpResp> Get()
@@ -42,5 +49,7 @@ namespace skydiveLogs_api.Controllers
public void Delete(int id)
{
}
private readonly IJumpService _jumpService;
}
}

View File

@@ -4,6 +4,8 @@ using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using skydiveLogs_api.Business.Interface;
using skydiveLogs_api.DataContract;
namespace skydiveLogs_api.Controllers
{
@@ -11,6 +13,11 @@ namespace skydiveLogs_api.Controllers
[ApiController]
public class JumpTypeController : ControllerBase
{
public JumpTypeController(IJumpTypeService jumpTypeService)
{
_jumpTypeService = jumpTypeService;
}
// GET: api/JumpType
[HttpGet]
public IEnumerable<JumpTypeResp> Get()
@@ -42,5 +49,7 @@ namespace skydiveLogs_api.Controllers
public void Delete(int id)
{
}
private readonly IJumpTypeService _jumpTypeService;
}
}

View File

@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace skydiveLogs_api.DataContract
{
public class AircraftReq
{
}
}

View File

@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace skydiveLogs_api.DataContract
{
public class AircraftResp
{
}
}

View File

@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace skydiveLogs_api.DataContract
{
public class JumpReq
{
}
}

View File

@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace skydiveLogs_api.DataContract
{
public class JumpResp
{
}
}

View File

@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace skydiveLogs_api.DataContract
{
public class JumpTypeReq
{
}
}

View File

@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace skydiveLogs_api.DataContract
{
public class JumpTypeResp
{
}
}

View File

@@ -1,12 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
namespace skydiveLogs_api
{
@@ -18,7 +11,6 @@ namespace skydiveLogs_api
}
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>();
WebHost.CreateDefaultBuilder(args).UseStartup<Startup>();
}
}

View File

@@ -1,15 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
namespace skydiveLogs_api
{
@@ -26,6 +19,16 @@ namespace skydiveLogs_api
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
// IoC
//services.AddSingleton<IConfigurationRoot>(Configuration);
//services.AddSingleton<Services.IGroupService, Services.GroupService>();
//services.AddSingleton<Services.IUserService, Services.UserService>();
//services.AddSingleton<Services.IPermissionService, Services.PermissionService>();
//services.AddScoped<Builder.IBuilderVmGroup, Builder.BuilderVmGroup>();
//services.AddScoped<Builder.IBuilderVmUser, Builder.BuilderVmUser>();
//services.AddScoped<Builder.IBuilderVmPermission, Builder.BuilderVmPermission>();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.