mirror of https://github.com/abpframework/abp.git
28 changed files with 427 additions and 23 deletions
@ -0,0 +1,20 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<PropertyGroup> |
|||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion> |
|||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> |
|||
</PropertyGroup> |
|||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" /> |
|||
<PropertyGroup Label="Globals"> |
|||
<ProjectGuid>e45b2ba3-7917-4236-99cd-b0a25285a652</ProjectGuid> |
|||
<RootNamespace> |
|||
</RootNamespace> |
|||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath> |
|||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath> |
|||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> |
|||
</PropertyGroup> |
|||
<PropertyGroup> |
|||
<SchemaVersion>2.0</SchemaVersion> |
|||
</PropertyGroup> |
|||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" /> |
|||
</Project> |
|||
@ -0,0 +1,11 @@ |
|||
using Volo.Abp.Application.Services.Dtos; |
|||
|
|||
namespace AbpDesk.Tickets.Dtos |
|||
{ |
|||
public class TicketDto : EntityDto<int> |
|||
{ |
|||
public string Title { get; set; } |
|||
|
|||
public string Body { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
using AbpDesk.Tickets.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
using Volo.Abp.Application.Services.Dtos; |
|||
|
|||
namespace AbpDesk.Tickets |
|||
{ |
|||
public interface ITicketAppService : IApplicationService |
|||
{ |
|||
ListResultDto<TicketDto> GetAll(); |
|||
} |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
using System.Reflection; |
|||
using System.Runtime.CompilerServices; |
|||
using System.Runtime.InteropServices; |
|||
|
|||
// General Information about an assembly is controlled through the following
|
|||
// set of attributes. Change these attribute values to modify the information
|
|||
// associated with an assembly.
|
|||
[assembly: AssemblyConfiguration("")] |
|||
[assembly: AssemblyCompany("")] |
|||
[assembly: AssemblyProduct("AbpDesk.Application.Contracts")] |
|||
[assembly: AssemblyTrademark("")] |
|||
|
|||
// Setting ComVisible to false makes the types in this assembly not visible
|
|||
// to COM components. If you need to access a type in this assembly from
|
|||
// COM, set the ComVisible attribute to true on that type.
|
|||
[assembly: ComVisible(false)] |
|||
|
|||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
|||
[assembly: Guid("e45b2ba3-7917-4236-99cd-b0a25285a652")] |
|||
@ -0,0 +1,14 @@ |
|||
{ |
|||
"version": "1.0.0-*", |
|||
|
|||
"dependencies": { |
|||
"NETStandard.Library": "1.6.1", |
|||
"Volo.Abp": "1.0.0-*" |
|||
}, |
|||
|
|||
"frameworks": { |
|||
"netstandard1.6": { |
|||
"imports": "dnxcore50" |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<PropertyGroup> |
|||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion> |
|||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> |
|||
</PropertyGroup> |
|||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" /> |
|||
<PropertyGroup Label="Globals"> |
|||
<ProjectGuid>b6e622ce-0aee-45da-81ab-c244196cb583</ProjectGuid> |
|||
<RootNamespace> |
|||
</RootNamespace> |
|||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath> |
|||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath> |
|||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> |
|||
</PropertyGroup> |
|||
<PropertyGroup> |
|||
<SchemaVersion>2.0</SchemaVersion> |
|||
</PropertyGroup> |
|||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" /> |
|||
</Project> |
|||
@ -0,0 +1,17 @@ |
|||
using System.Collections.Generic; |
|||
using AbpDesk.Tickets.Dtos; |
|||
using Volo.Abp.Application.Services.Dtos; |
|||
|
|||
namespace AbpDesk.Tickets |
|||
{ |
|||
public class TicketAppService : ITicketAppService |
|||
{ |
|||
public ListResultDto<TicketDto> GetAll() |
|||
{ |
|||
return new ListResultDto<TicketDto>(new List<TicketDto> |
|||
{ |
|||
new TicketDto {Id = 1, Title = "Ticket 1 Title", Body = "Ticket 1 Body" } |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
using System.Reflection; |
|||
using System.Runtime.CompilerServices; |
|||
using System.Runtime.InteropServices; |
|||
|
|||
// General Information about an assembly is controlled through the following
|
|||
// set of attributes. Change these attribute values to modify the information
|
|||
// associated with an assembly.
|
|||
[assembly: AssemblyConfiguration("")] |
|||
[assembly: AssemblyCompany("")] |
|||
[assembly: AssemblyProduct("AbpDesk.Application")] |
|||
[assembly: AssemblyTrademark("")] |
|||
|
|||
// Setting ComVisible to false makes the types in this assembly not visible
|
|||
// to COM components. If you need to access a type in this assembly from
|
|||
// COM, set the ComVisible attribute to true on that type.
|
|||
[assembly: ComVisible(false)] |
|||
|
|||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
|||
[assembly: Guid("b6e622ce-0aee-45da-81ab-c244196cb583")] |
|||
@ -0,0 +1,15 @@ |
|||
{ |
|||
"version": "1.0.0-*", |
|||
|
|||
"dependencies": { |
|||
"AbpDesk.Application.Contracts": "1.0.0-*", |
|||
"AbpDesk.Domain": "1.0.0-*", |
|||
"NETStandard.Library": "1.6.1" |
|||
}, |
|||
|
|||
"frameworks": { |
|||
"netstandard1.6": { |
|||
"imports": "dnxcore50" |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<PropertyGroup> |
|||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion> |
|||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> |
|||
</PropertyGroup> |
|||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" /> |
|||
<PropertyGroup Label="Globals"> |
|||
<ProjectGuid>2dba20a3-8b1c-49f0-90f6-eb09db78b1b8</ProjectGuid> |
|||
<RootNamespace> |
|||
</RootNamespace> |
|||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath> |
|||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath> |
|||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> |
|||
</PropertyGroup> |
|||
<PropertyGroup> |
|||
<SchemaVersion>2.0</SchemaVersion> |
|||
</PropertyGroup> |
|||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" /> |
|||
</Project> |
|||
@ -0,0 +1,26 @@ |
|||
using Volo.Abp.Domain.Entities; |
|||
|
|||
namespace AbpDesk.Tickets |
|||
{ |
|||
public class Ticket : AggregateRoot<int> |
|||
{ |
|||
public const int MaxTitleLength = 256; |
|||
|
|||
public const int MaxBodyLength = 64 * 1024; //64K
|
|||
|
|||
public string Title { get; set; } |
|||
|
|||
public string Body { get; set; } |
|||
|
|||
private Ticket() |
|||
{ |
|||
|
|||
} |
|||
|
|||
public Ticket(string title, string body) |
|||
{ |
|||
Title = title; |
|||
Body = body; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
using System.Reflection; |
|||
using System.Runtime.CompilerServices; |
|||
using System.Runtime.InteropServices; |
|||
|
|||
// General Information about an assembly is controlled through the following
|
|||
// set of attributes. Change these attribute values to modify the information
|
|||
// associated with an assembly.
|
|||
[assembly: AssemblyConfiguration("")] |
|||
[assembly: AssemblyCompany("")] |
|||
[assembly: AssemblyProduct("AbpDesk.Domain")] |
|||
[assembly: AssemblyTrademark("")] |
|||
|
|||
// Setting ComVisible to false makes the types in this assembly not visible
|
|||
// to COM components. If you need to access a type in this assembly from
|
|||
// COM, set the ComVisible attribute to true on that type.
|
|||
[assembly: ComVisible(false)] |
|||
|
|||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
|||
[assembly: Guid("2dba20a3-8b1c-49f0-90f6-eb09db78b1b8")] |
|||
@ -0,0 +1,14 @@ |
|||
{ |
|||
"version": "1.0.0-*", |
|||
|
|||
"dependencies": { |
|||
"NETStandard.Library": "1.6.1", |
|||
"Volo.Abp": "1.0.0-*" |
|||
}, |
|||
|
|||
"frameworks": { |
|||
"netstandard1.6": { |
|||
"imports": "dnxcore50" |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<PropertyGroup> |
|||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion> |
|||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> |
|||
</PropertyGroup> |
|||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" /> |
|||
<PropertyGroup Label="Globals"> |
|||
<ProjectGuid>35624e7c-6501-4b42-9aa7-70555666a8b3</ProjectGuid> |
|||
<RootNamespace> |
|||
</RootNamespace> |
|||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath> |
|||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath> |
|||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> |
|||
</PropertyGroup> |
|||
<PropertyGroup> |
|||
<SchemaVersion>2.0</SchemaVersion> |
|||
</PropertyGroup> |
|||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" /> |
|||
</Project> |
|||
@ -0,0 +1,18 @@ |
|||
using AbpDesk.Tickets; |
|||
using Microsoft.EntityFrameworkCore; |
|||
|
|||
namespace AbpDesk.EntityFrameworkCore |
|||
{ |
|||
public class AbpDeskDbContext : DbContext |
|||
{ |
|||
protected override void OnModelCreating(ModelBuilder modelBuilder) |
|||
{ |
|||
base.OnModelCreating(modelBuilder); |
|||
|
|||
modelBuilder.Entity<Ticket>(builder => |
|||
{ |
|||
builder.ToTable("DskTickets"); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
using System.Reflection; |
|||
using System.Runtime.CompilerServices; |
|||
using System.Runtime.InteropServices; |
|||
|
|||
// General Information about an assembly is controlled through the following
|
|||
// set of attributes. Change these attribute values to modify the information
|
|||
// associated with an assembly.
|
|||
[assembly: AssemblyConfiguration("")] |
|||
[assembly: AssemblyCompany("")] |
|||
[assembly: AssemblyProduct("AbpDesk.EntityFrameworkCore")] |
|||
[assembly: AssemblyTrademark("")] |
|||
|
|||
// Setting ComVisible to false makes the types in this assembly not visible
|
|||
// to COM components. If you need to access a type in this assembly from
|
|||
// COM, set the ComVisible attribute to true on that type.
|
|||
[assembly: ComVisible(false)] |
|||
|
|||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
|||
[assembly: Guid("35624e7c-6501-4b42-9aa7-70555666a8b3")] |
|||
@ -0,0 +1,16 @@ |
|||
{ |
|||
"version": "1.0.0-*", |
|||
|
|||
"dependencies": { |
|||
"AbpDesk.Domain": "1.0.0-*", |
|||
"NETStandard.Library": "1.6.1", |
|||
"Volo.Abp.EntityFrameworkCore": "1.0.0-*", |
|||
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.0" |
|||
}, |
|||
|
|||
"frameworks": { |
|||
"netstandard1.6": { |
|||
"imports": "dnxcore50" |
|||
} |
|||
} |
|||
} |
|||
@ -1,12 +1,12 @@ |
|||
using Volo.Abp.AspNetCore; |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.AspNetCore.Modularity; |
|||
using Microsoft.AspNetCore.Builder; |
|||
using Microsoft.AspNetCore.Builder; |
|||
using Microsoft.AspNetCore.Hosting; |
|||
using Microsoft.Extensions.Logging; |
|||
using Microsoft.AspNetCore.Http; |
|||
using Microsoft.Extensions.Logging; |
|||
using Volo.Abp.AspNetCore; |
|||
using Volo.Abp.AspNetCore.Modularity; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace AspNetCoreDemo |
|||
namespace AbpDesk |
|||
{ |
|||
[DependsOn(typeof(AbpAspNetCoreModule))] |
|||
public class AppModule : AbpModule |
|||
@ -1,7 +1,7 @@ |
|||
using System.IO; |
|||
using Microsoft.AspNetCore.Hosting; |
|||
|
|||
namespace AspNetCoreDemo |
|||
namespace AbpDesk |
|||
{ |
|||
public class Program |
|||
{ |
|||
@ -0,0 +1,31 @@ |
|||
namespace Volo.Abp.Application.Services.Dtos |
|||
{ |
|||
/// <summary>
|
|||
/// Implements common properties for entity based DTOs.
|
|||
/// </summary>
|
|||
/// <typeparam name="TPrimaryKey">Type of the primary key</typeparam>
|
|||
public class EntityDto<TPrimaryKey> |
|||
{ |
|||
/// <summary>
|
|||
/// Id of the entity.
|
|||
/// </summary>
|
|||
public TPrimaryKey Id { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// Creates a new <see cref="EntityDto{TPrimaryKey}"/> object.
|
|||
/// </summary>
|
|||
public EntityDto() |
|||
{ |
|||
|
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Creates a new <see cref="EntityDto{TPrimaryKey}"/> object.
|
|||
/// </summary>
|
|||
/// <param name="id">Id of the entity</param>
|
|||
public EntityDto(TPrimaryKey id) |
|||
{ |
|||
Id = id; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,36 @@ |
|||
using System.Collections.Generic; |
|||
|
|||
namespace Volo.Abp.Application.Services.Dtos |
|||
{ |
|||
//TODO: [Serializable] for all DTO classes
|
|||
|
|||
public class ListResultDto<T> |
|||
{ |
|||
/// <summary>
|
|||
/// List of items.
|
|||
/// </summary>
|
|||
public IReadOnlyList<T> Items |
|||
{ |
|||
get { return _items ?? (_items = new List<T>()); } |
|||
set { _items = value; } |
|||
} |
|||
private IReadOnlyList<T> _items; |
|||
|
|||
/// <summary>
|
|||
/// Creates a new <see cref="ListResultDto{T}"/> object.
|
|||
/// </summary>
|
|||
public ListResultDto() |
|||
{ |
|||
|
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Creates a new <see cref="ListResultDto{T}"/> object.
|
|||
/// </summary>
|
|||
/// <param name="items">List of items</param>
|
|||
public ListResultDto(IReadOnlyList<T> items) |
|||
{ |
|||
Items = items; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
using Volo.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.Application.Services |
|||
{ |
|||
/// <summary>
|
|||
/// This interface must be implemented by all application services to identify them by convention.
|
|||
/// </summary>
|
|||
public interface IApplicationService : ITransientDependency |
|||
{ |
|||
|
|||
} |
|||
} |
|||
Loading…
Reference in new issue