mirror of https://github.com/abpframework/abp.git
18 changed files with 251 additions and 9 deletions
@ -0,0 +1,13 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc; |
|||
|
|||
namespace AbpDesk.Controllers |
|||
{ |
|||
public class HomeController : AbpController |
|||
{ |
|||
public IActionResult Index() |
|||
{ |
|||
return RedirectToAction("Index", "Tickets"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
using AbpDesk.Models.Tickets; |
|||
using AbpDesk.Tickets; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc; |
|||
|
|||
namespace AbpDesk.Controllers |
|||
{ |
|||
public class TicketsController : AbpController |
|||
{ |
|||
private readonly ITicketAppService _ticketAppService; |
|||
|
|||
public TicketsController(ITicketAppService ticketAppService) |
|||
{ |
|||
_ticketAppService = ticketAppService; |
|||
} |
|||
|
|||
public IActionResult Index() |
|||
{ |
|||
var result = _ticketAppService.GetAll(); |
|||
|
|||
var model = new IndexViewModel |
|||
{ |
|||
Tickets = result.Items |
|||
}; |
|||
|
|||
return View(model); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
using System.Collections.Generic; |
|||
using AbpDesk.Tickets.Dtos; |
|||
|
|||
namespace AbpDesk.Models.Tickets |
|||
{ |
|||
public class IndexViewModel |
|||
{ |
|||
public IReadOnlyList<TicketDto> Tickets { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
@model AbpDesk.Models.Tickets.IndexViewModel |
|||
|
|||
<link rel="stylesheet" type="text/css" href="~/global-styles.css"/> |
|||
|
|||
<h2>Tickets</h2> |
|||
|
|||
<ul class="ticket-list"> |
|||
@foreach (var ticket in Model.Tickets) |
|||
{ |
|||
<li data-entity-id="@ticket.Id"> |
|||
<h3>@ticket.Title</h3> |
|||
<p>@ticket.Body</p> |
|||
</li> |
|||
} |
|||
</ul> |
|||
@ -0,0 +1,6 @@ |
|||
[ |
|||
{ |
|||
"outputFile": "wwwroot/global-styles.css", |
|||
"inputFile": "wwwroot/global-styles.scss" |
|||
} |
|||
] |
|||
@ -0,0 +1,49 @@ |
|||
{ |
|||
"compilers": { |
|||
"less": { |
|||
"autoPrefix": "", |
|||
"cssComb": "none", |
|||
"ieCompat": true, |
|||
"strictMath": false, |
|||
"strictUnits": false, |
|||
"relativeUrls": true, |
|||
"rootPath": "", |
|||
"sourceMapRoot": "", |
|||
"sourceMapBasePath": "", |
|||
"sourceMap": false |
|||
}, |
|||
"sass": { |
|||
"includePath": "", |
|||
"indentType": "space", |
|||
"indentWidth": 2, |
|||
"outputStyle": "nested", |
|||
"Precision": 5, |
|||
"relativeUrls": true, |
|||
"sourceMapRoot": "", |
|||
"sourceMap": false |
|||
}, |
|||
"stylus": { |
|||
"sourceMap": false |
|||
}, |
|||
"babel": { |
|||
"sourceMap": false |
|||
}, |
|||
"coffeescript": { |
|||
"bare": false, |
|||
"runtimeMode": "node", |
|||
"sourceMap": false |
|||
} |
|||
}, |
|||
"minifiers": { |
|||
"css": { |
|||
"enabled": true, |
|||
"termSemicolons": true, |
|||
"gzip": false |
|||
}, |
|||
"javascript": { |
|||
"enabled": true, |
|||
"termSemicolons": true, |
|||
"gzip": false |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,5 @@ |
|||
ul.ticket-list { |
|||
list-style: none; } |
|||
ul.ticket-list li { |
|||
border-bottom: 1px solid #d0d0d0; } |
|||
|
|||
@ -0,0 +1 @@ |
|||
ul.ticket-list{list-style:none;}ul.ticket-list li{border-bottom:1px solid #d0d0d0;} |
|||
@ -0,0 +1,8 @@ |
|||
ul.ticket-list { |
|||
|
|||
list-style: none; |
|||
|
|||
li { |
|||
border-bottom: 1px solid #d0d0d0; |
|||
} |
|||
} |
|||
@ -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("Volo.Abp.AspNetCore.Mvc")] |
|||
[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("3fb342ca-23b6-4795-91ef-c664527c07b7")] |
|||
@ -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>3fb342ca-23b6-4795-91ef-c664527c07b7</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,16 @@ |
|||
using Microsoft.AspNetCore.Builder; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc |
|||
{ |
|||
[DependsOn(typeof(AbpAspNetCoreModule))] |
|||
public class AbpAspNetCoreMvcModule : IAbpModule |
|||
{ |
|||
public void ConfigureServices(IServiceCollection services) |
|||
{ |
|||
services.AddObjectAccessor<IApplicationBuilder>(); |
|||
services.AddAssemblyOf<AbpAspNetCoreMvcModule>(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc |
|||
{ |
|||
public abstract class AbpController : Controller |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
{ |
|||
"version": "1.0.0-*", |
|||
|
|||
"dependencies": { |
|||
"NETStandard.Library": "1.6.1", |
|||
"Volo.Abp.AspNetCore": "1.0.0-*", |
|||
"Microsoft.AspNetCore.Mvc": "1.1.0" |
|||
}, |
|||
|
|||
"frameworks": { |
|||
"netstandard1.6": { |
|||
"imports": "dnxcore50" |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue