mirror of https://github.com/abpframework/abp.git
16 changed files with 65 additions and 13 deletions
@ -1,6 +1,6 @@ |
|||
using Volo.Abp.Localization; |
|||
|
|||
namespace MyCompanyName.MyProjectName.Localization.MyProjectName |
|||
namespace MyCompanyName.MyProjectName.Localization |
|||
{ |
|||
[LocalizationResourceName("MyProjectName")] |
|||
public class MyProjectNameResource |
|||
@ -0,0 +1,13 @@ |
|||
using MyCompanyName.MyProjectName.Localization; |
|||
using Volo.Abp.AspNetCore.Mvc; |
|||
|
|||
namespace MyCompanyName.MyProjectName.Controllers |
|||
{ |
|||
public abstract class MyProjectNameController : AbpController |
|||
{ |
|||
protected MyProjectNameController() |
|||
{ |
|||
LocalizationResource = typeof(MyProjectNameResource); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,28 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using MyCompanyName.MyProjectName.Models.Test; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace MyCompanyName.MyProjectName.Controllers |
|||
{ |
|||
[Route("api/test")] |
|||
public class TestController : MyProjectNameController |
|||
{ |
|||
public TestController() |
|||
{ |
|||
|
|||
} |
|||
|
|||
[HttpGet] |
|||
[Route("")] |
|||
public async Task<List<TestModel>> GetAsync() |
|||
{ |
|||
return new List<TestModel> |
|||
{ |
|||
new TestModel {Name = "John", BirthDate = new DateTime(1942, 11, 18)}, |
|||
new TestModel {Name = "Adams", BirthDate = new DateTime(1997, 05, 24)} |
|||
}; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
using System; |
|||
|
|||
namespace MyCompanyName.MyProjectName.Models.Test |
|||
{ |
|||
public class TestModel |
|||
{ |
|||
public string Name { get; set; } |
|||
|
|||
public DateTime BirthDate { get; set; } |
|||
} |
|||
} |
|||
Loading…
Reference in new issue