mirror of https://github.com/abpframework/abp.git
577 changed files with 75 additions and 29642 deletions
@ -1,27 +0,0 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd"> |
|
||||
<metadata> |
|
||||
<id>Volo.Abp.Account.Web</id> |
|
||||
<version>0.2.0</version> |
|
||||
<authors>Volo.Abp.Account.Web</authors> |
|
||||
<owners>Volo.Abp.Account.Web</owners> |
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance> |
|
||||
<licenseUrl>https://github.com/aspnetzero/abp/blob/master/LICENSE</licenseUrl> |
|
||||
<projectUrl>http://abp.io/</projectUrl> |
|
||||
<iconUrl>http://www.aspnetboilerplate.com/images/abp_nupkg.png</iconUrl> |
|
||||
<description>Package Description</description> |
|
||||
<repository type="git" url="https://github.com/aspnetzero/abp/" /> |
|
||||
<dependencies> |
|
||||
<group targetFramework=".NETStandard2.0"> |
|
||||
<dependency id="Volo.Abp.Account.Application.Contracts" version="0.2.0" exclude="Build,Analyzers" /> |
|
||||
<dependency id="Volo.Abp.AspNetCore.Mvc.UI.Bootstrap" version="0.2.0" exclude="Build,Analyzers" /> |
|
||||
<dependency id="Volo.Abp.Identity.Domain" version="0.2.0" exclude="Build,Analyzers" /> |
|
||||
</group> |
|
||||
</dependencies> |
|
||||
<contentFiles> |
|
||||
<files include="any/netstandard2.0/Pages/Account/Login.cshtml" buildAction="Content" /> |
|
||||
<files include="any/netstandard2.0/Pages/Account/Register.cshtml" buildAction="Content" /> |
|
||||
<files include="any/netstandard2.0/Properties/launchSettings.json" buildAction="Content" /> |
|
||||
</contentFiles> |
|
||||
</metadata> |
|
||||
</package> |
|
||||
@ -1,10 +0,0 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"> |
|
||||
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /> |
|
||||
<Default Extension="psmdcp" ContentType="application/vnd.openxmlformats-package.core-properties+xml" /> |
|
||||
<Default Extension="pdb" ContentType="application/octet" /> |
|
||||
<Default Extension="dll" ContentType="application/octet" /> |
|
||||
<Default Extension="cshtml" ContentType="application/octet" /> |
|
||||
<Default Extension="json" ContentType="application/octet" /> |
|
||||
<Default Extension="nuspec" ContentType="application/octet" /> |
|
||||
</Types> |
|
||||
@ -1,5 +0,0 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"> |
|
||||
<Relationship Type="http://schemas.microsoft.com/packaging/2010/07/manifest" Target="/Volo.Abp.Account.Web.nuspec" Id="Rfdd677b0690f4393" /> |
|
||||
<Relationship Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="/package/services/metadata/core-properties/d0b9dbb571f046678dd82d6354463c78.psmdcp" Id="Redc92efae9c749d6" /> |
|
||||
</Relationships> |
|
||||
@ -1,45 +0,0 @@ |
|||||
@page |
|
||||
@model Volo.Abp.Account.Web.Pages.Account.LoginModel |
|
||||
<div class="row"> |
|
||||
<div class="col-md-6"> |
|
||||
<div class="col-md-4"> |
|
||||
<form method="post"> |
|
||||
<div class="form-group"> |
|
||||
<label for="UsernameOrEmailAddress">Username or email address</label> |
|
||||
<input type="text" class="form-control" id="UsernameOrEmailAddress" name="UsernameOrEmailAddress"> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label for="Password">Password</label> |
|
||||
<input type="password" class="form-control" id="Password" name="Password"> |
|
||||
</div> |
|
||||
<div class="form-check"> |
|
||||
<label class="form-check-label"> |
|
||||
<input type="checkbox" name="RememberMe" value="true" checked="checked"> |
|
||||
Remember me |
|
||||
</label> |
|
||||
</div> |
|
||||
<button type="submit" class="btn btn-primary">Login</button> |
|
||||
</form> |
|
||||
|
|
||||
<div style="padding-top: 20px"> |
|
||||
<a href="@Url.Page("./Register", new { returnUrl = Model.ReturnUrl, returnUrlHash = Model.ReturnUrlHash })">Register</a> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
|
|
||||
@if (Model.ExternalLogins.Any()) |
|
||||
{ |
|
||||
<div class="col-md-6"> |
|
||||
<h4>Use another service to log in.</h4> |
|
||||
<form asp-page="./Login" asp-page-handler="ExternalLogin" asp-route-returnUrl="@Model.ReturnUrl" asp-route-returnUrlHash="@Model.ReturnUrlHash" method="post"> |
|
||||
<div> |
|
||||
@foreach (var provider in Model.ExternalLogins) |
|
||||
{ |
|
||||
<button type="submit" class="btn btn-primary" name="provider" value="@provider.Name" title="Log in using your @provider.DisplayName account">@provider.DisplayName</button> |
|
||||
} |
|
||||
</div> |
|
||||
</form> |
|
||||
</div> |
|
||||
} |
|
||||
|
|
||||
</div> |
|
||||
@ -1,21 +0,0 @@ |
|||||
@page |
|
||||
@model Volo.Abp.Account.Web.Pages.Account.RegisterModel |
|
||||
<div class="row"> |
|
||||
<div class="col-md-3"> |
|
||||
<form method="post"> |
|
||||
<div class="form-group"> |
|
||||
<label for="UserName">Username</label> |
|
||||
<input type="text" class="form-control" id="UserName" name="UserName" required> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label for="EmailAddress">Email address</label> |
|
||||
<input type="email" class="form-control" id="EmailAddress" name="EmailAddress" required> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label for="Password">Password</label> |
|
||||
<input type="password" class="form-control" id="Password" name="Password" required> |
|
||||
</div> |
|
||||
<button type="submit" class="btn btn-primary">Register</button> |
|
||||
</form> |
|
||||
</div> |
|
||||
</div> |
|
||||
@ -1,27 +0,0 @@ |
|||||
{ |
|
||||
"iisSettings": { |
|
||||
"windowsAuthentication": false, |
|
||||
"anonymousAuthentication": true, |
|
||||
"iisExpress": { |
|
||||
"applicationUrl": "http://localhost:53098/", |
|
||||
"sslPort": 0 |
|
||||
} |
|
||||
}, |
|
||||
"profiles": { |
|
||||
"IIS Express": { |
|
||||
"commandName": "IISExpress", |
|
||||
"launchBrowser": true, |
|
||||
"environmentVariables": { |
|
||||
"ASPNETCORE_ENVIRONMENT": "Development" |
|
||||
} |
|
||||
}, |
|
||||
"Volo.Abp.Account.Web": { |
|
||||
"commandName": "Project", |
|
||||
"launchBrowser": true, |
|
||||
"environmentVariables": { |
|
||||
"ASPNETCORE_ENVIRONMENT": "Development" |
|
||||
}, |
|
||||
"applicationUrl": "http://localhost:53099/" |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,45 +0,0 @@ |
|||||
@page |
|
||||
@model Volo.Abp.Account.Web.Pages.Account.LoginModel |
|
||||
<div class="row"> |
|
||||
<div class="col-md-6"> |
|
||||
<div class="col-md-4"> |
|
||||
<form method="post"> |
|
||||
<div class="form-group"> |
|
||||
<label for="UsernameOrEmailAddress">Username or email address</label> |
|
||||
<input type="text" class="form-control" id="UsernameOrEmailAddress" name="UsernameOrEmailAddress"> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label for="Password">Password</label> |
|
||||
<input type="password" class="form-control" id="Password" name="Password"> |
|
||||
</div> |
|
||||
<div class="form-check"> |
|
||||
<label class="form-check-label"> |
|
||||
<input type="checkbox" name="RememberMe" value="true" checked="checked"> |
|
||||
Remember me |
|
||||
</label> |
|
||||
</div> |
|
||||
<button type="submit" class="btn btn-primary">Login</button> |
|
||||
</form> |
|
||||
|
|
||||
<div style="padding-top: 20px"> |
|
||||
<a href="@Url.Page("./Register", new { returnUrl = Model.ReturnUrl, returnUrlHash = Model.ReturnUrlHash })">Register</a> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
|
|
||||
@if (Model.ExternalLogins.Any()) |
|
||||
{ |
|
||||
<div class="col-md-6"> |
|
||||
<h4>Use another service to log in.</h4> |
|
||||
<form asp-page="./Login" asp-page-handler="ExternalLogin" asp-route-returnUrl="@Model.ReturnUrl" asp-route-returnUrlHash="@Model.ReturnUrlHash" method="post"> |
|
||||
<div> |
|
||||
@foreach (var provider in Model.ExternalLogins) |
|
||||
{ |
|
||||
<button type="submit" class="btn btn-primary" name="provider" value="@provider.Name" title="Log in using your @provider.DisplayName account">@provider.DisplayName</button> |
|
||||
} |
|
||||
</div> |
|
||||
</form> |
|
||||
</div> |
|
||||
} |
|
||||
|
|
||||
</div> |
|
||||
@ -1,21 +0,0 @@ |
|||||
@page |
|
||||
@model Volo.Abp.Account.Web.Pages.Account.RegisterModel |
|
||||
<div class="row"> |
|
||||
<div class="col-md-3"> |
|
||||
<form method="post"> |
|
||||
<div class="form-group"> |
|
||||
<label for="UserName">Username</label> |
|
||||
<input type="text" class="form-control" id="UserName" name="UserName" required> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label for="EmailAddress">Email address</label> |
|
||||
<input type="email" class="form-control" id="EmailAddress" name="EmailAddress" required> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label for="Password">Password</label> |
|
||||
<input type="password" class="form-control" id="Password" name="Password" required> |
|
||||
</div> |
|
||||
<button type="submit" class="btn btn-primary">Register</button> |
|
||||
</form> |
|
||||
</div> |
|
||||
</div> |
|
||||
@ -1,27 +0,0 @@ |
|||||
{ |
|
||||
"iisSettings": { |
|
||||
"windowsAuthentication": false, |
|
||||
"anonymousAuthentication": true, |
|
||||
"iisExpress": { |
|
||||
"applicationUrl": "http://localhost:53098/", |
|
||||
"sslPort": 0 |
|
||||
} |
|
||||
}, |
|
||||
"profiles": { |
|
||||
"IIS Express": { |
|
||||
"commandName": "IISExpress", |
|
||||
"launchBrowser": true, |
|
||||
"environmentVariables": { |
|
||||
"ASPNETCORE_ENVIRONMENT": "Development" |
|
||||
} |
|
||||
}, |
|
||||
"Volo.Abp.Account.Web": { |
|
||||
"commandName": "Project", |
|
||||
"launchBrowser": true, |
|
||||
"environmentVariables": { |
|
||||
"ASPNETCORE_ENVIRONMENT": "Development" |
|
||||
}, |
|
||||
"applicationUrl": "http://localhost:53099/" |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
Binary file not shown.
@ -1,9 +0,0 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||
<coreProperties xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"> |
|
||||
<dc:creator>Volo.Abp.Account.Web</dc:creator> |
|
||||
<dc:description>Package Description</dc:description> |
|
||||
<dc:identifier>Volo.Abp.Account.Web</dc:identifier> |
|
||||
<version>0.2.0</version> |
|
||||
<keywords></keywords> |
|
||||
<lastModifiedBy>NuGet.Build.Tasks.Pack, Version=4.5.0.4, Culture=neutral, PublicKeyToken=31bf3856ad364e35;</lastModifiedBy> |
|
||||
</coreProperties> |
|
||||
@ -1,18 +0,0 @@ |
|||||
<Project Sdk="Microsoft.NET.Sdk"> |
|
||||
|
|
||||
<PropertyGroup> |
|
||||
<TargetFramework>netstandard2.0</TargetFramework> |
|
||||
<AssemblyName>AbpDesk.Application.Contracts</AssemblyName> |
|
||||
<PackageId>AbpDesk.Application.Contracts</PackageId> |
|
||||
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> |
|
||||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
|
||||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
|
||||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
|
||||
<RootNamespace /> |
|
||||
</PropertyGroup> |
|
||||
|
|
||||
<ItemGroup> |
|
||||
<ProjectReference Include="..\..\Volo.Abp.Ddd.Application\Volo.Abp.Ddd.Application.csproj" /> |
|
||||
</ItemGroup> |
|
||||
|
|
||||
</Project> |
|
||||
@ -1,11 +0,0 @@ |
|||||
using Volo.Abp.Application; |
|
||||
using Volo.Abp.Modularity; |
|
||||
|
|
||||
namespace AbpDesk |
|
||||
{ |
|
||||
[DependsOn(typeof(AbpDddApplicationModule))] |
|
||||
public class AbpDeskApplicationContractsModule : AbpModule |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
@ -1,7 +0,0 @@ |
|||||
namespace AbpDesk.Tickets.Dtos |
|
||||
{ |
|
||||
public class GetAllTicketsInput |
|
||||
{ |
|
||||
public string Filter { get; set; } |
|
||||
} |
|
||||
} |
|
||||
@ -1,16 +0,0 @@ |
|||||
using Volo.Abp.Application.Dtos; |
|
||||
|
|
||||
namespace AbpDesk.Tickets.Dtos |
|
||||
{ |
|
||||
public class TicketDto : EntityDto<int> |
|
||||
{ |
|
||||
public string Title { get; set; } |
|
||||
|
|
||||
public string Body { get; set; } |
|
||||
|
|
||||
public override string ToString() |
|
||||
{ |
|
||||
return $"{base.ToString()}, Title = {Title}, Body = {Body}"; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,14 +0,0 @@ |
|||||
using System.Threading.Tasks; |
|
||||
using AbpDesk.Tickets.Dtos; |
|
||||
using Volo.Abp.Application.Dtos; |
|
||||
using Volo.Abp.Application.Services; |
|
||||
|
|
||||
namespace AbpDesk.Tickets |
|
||||
{ |
|
||||
public interface ITicketAppService : IApplicationService |
|
||||
{ |
|
||||
Task<ListResultDto<TicketDto>> GetAll(GetAllTicketsInput input); |
|
||||
|
|
||||
ListResultDto<TicketDto> GetAll2(GetAllTicketsInput input); |
|
||||
} |
|
||||
} |
|
||||
@ -1,18 +0,0 @@ |
|||||
using System.Reflection; |
|
||||
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")] |
|
||||
@ -1,20 +0,0 @@ |
|||||
<Project Sdk="Microsoft.NET.Sdk"> |
|
||||
|
|
||||
<PropertyGroup> |
|
||||
<TargetFramework>netstandard2.0</TargetFramework> |
|
||||
<AssemblyName>AbpDesk.Application</AssemblyName> |
|
||||
<PackageId>AbpDesk.Application</PackageId> |
|
||||
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> |
|
||||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
|
||||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
|
||||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
|
||||
<RootNamespace /> |
|
||||
</PropertyGroup> |
|
||||
|
|
||||
<ItemGroup> |
|
||||
<ProjectReference Include="..\..\Volo.Abp.AutoMapper\Volo.Abp.AutoMapper.csproj" /> |
|
||||
<ProjectReference Include="..\AbpDesk.Application.Contracts\AbpDesk.Application.Contracts.csproj" /> |
|
||||
<ProjectReference Include="..\AbpDesk.Domain\AbpDesk.Domain.csproj" /> |
|
||||
</ItemGroup> |
|
||||
|
|
||||
</Project> |
|
||||
@ -1,27 +0,0 @@ |
|||||
using Microsoft.Extensions.DependencyInjection; |
|
||||
using Volo.Abp.AutoMapper; |
|
||||
using Volo.Abp.Modularity; |
|
||||
|
|
||||
namespace AbpDesk |
|
||||
{ |
|
||||
[DependsOn( |
|
||||
typeof(AbpDeskDomainModule), |
|
||||
typeof(AbpDeskApplicationContractsModule), |
|
||||
typeof(AbpAutoMapperModule) |
|
||||
)] |
|
||||
public class AbpDeskApplicationModule : AbpModule |
|
||||
{ |
|
||||
public override void ConfigureServices(IServiceCollection services) |
|
||||
{ |
|
||||
services.AddAssemblyOf<AbpDeskApplicationModule>(); |
|
||||
|
|
||||
services.Configure<AbpAutoMapperOptions>(options => |
|
||||
{ |
|
||||
options.Configurators.Add(context => |
|
||||
{ |
|
||||
context.MapperConfiguration.AddProfile<AbpDeskApplicationModuleAutoMapperProfile>(); |
|
||||
}); |
|
||||
}); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,14 +0,0 @@ |
|||||
using AbpDesk.Tickets; |
|
||||
using AbpDesk.Tickets.Dtos; |
|
||||
using AutoMapper; |
|
||||
|
|
||||
namespace AbpDesk |
|
||||
{ |
|
||||
public class AbpDeskApplicationModuleAutoMapperProfile : Profile |
|
||||
{ |
|
||||
public AbpDeskApplicationModuleAutoMapperProfile() |
|
||||
{ |
|
||||
CreateMap<Ticket, TicketDto>(); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,55 +0,0 @@ |
|||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Threading.Tasks; |
|
||||
using AbpDesk.Tickets.Dtos; |
|
||||
using Volo.Abp.Application.Dtos; |
|
||||
using Volo.Abp.Application.Services; |
|
||||
using Volo.Abp.Domain.Repositories; |
|
||||
using Volo.Abp.Linq; |
|
||||
|
|
||||
namespace AbpDesk.Tickets |
|
||||
{ |
|
||||
public class TicketAppService : ApplicationService, ITicketAppService |
|
||||
{ |
|
||||
private readonly IRepository<Ticket, int> _ticketRepository; |
|
||||
private readonly IAsyncQueryableExecuter _asyncQueryableExecuter; |
|
||||
|
|
||||
public TicketAppService( |
|
||||
IRepository<Ticket, int> ticketRepository, |
|
||||
IAsyncQueryableExecuter asyncQueryableExecuter) |
|
||||
{ |
|
||||
_ticketRepository = ticketRepository; |
|
||||
_asyncQueryableExecuter = asyncQueryableExecuter; |
|
||||
} |
|
||||
|
|
||||
//TODO: No need to virtual once we implement UOW filter for AspNet Core!
|
|
||||
public virtual async Task<ListResultDto<TicketDto>> GetAll(GetAllTicketsInput input) |
|
||||
{ |
|
||||
var tickets = await _asyncQueryableExecuter.ToListAsync(_ticketRepository |
|
||||
.WhereIf( |
|
||||
!input.Filter.IsNullOrWhiteSpace(), |
|
||||
t => t.Title.Contains(input.Filter) || t.Body.Contains(input.Filter) |
|
||||
) |
|
||||
); |
|
||||
|
|
||||
return new ListResultDto<TicketDto>( |
|
||||
ObjectMapper.Map<List<Ticket>, List<TicketDto>>(tickets) |
|
||||
); |
|
||||
} |
|
||||
|
|
||||
public ListResultDto<TicketDto> GetAll2(GetAllTicketsInput input) |
|
||||
{ |
|
||||
var tickets = _ticketRepository |
|
||||
.WhereIf( |
|
||||
!input.Filter.IsNullOrWhiteSpace(), |
|
||||
t => t.Title.Contains(input.Filter) || t.Body.Contains(input.Filter) |
|
||||
) |
|
||||
.ToList(); |
|
||||
|
|
||||
return new ListResultDto<TicketDto>( |
|
||||
ObjectMapper.Map<List<Ticket>, List<TicketDto>>(tickets) |
|
||||
); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,18 +0,0 @@ |
|||||
using System.Reflection; |
|
||||
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")] |
|
||||
@ -1,12 +0,0 @@ |
|||||
<Project Sdk="Microsoft.NET.Sdk"> |
|
||||
|
|
||||
<PropertyGroup> |
|
||||
<OutputType>Exe</OutputType> |
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework> |
|
||||
</PropertyGroup> |
|
||||
|
|
||||
<ItemGroup> |
|
||||
<PackageReference Include="IdentityModel" Version="3.1.0" /> |
|
||||
</ItemGroup> |
|
||||
|
|
||||
</Project> |
|
||||
@ -1,54 +0,0 @@ |
|||||
using System; |
|
||||
using System.Net.Http; |
|
||||
using System.Threading.Tasks; |
|
||||
using IdentityModel.Client; |
|
||||
|
|
||||
namespace AbpDesk.ConsoleClient |
|
||||
{ |
|
||||
class Program |
|
||||
{ |
|
||||
static void Main(string[] args) |
|
||||
{ |
|
||||
RunDemo().Wait(); |
|
||||
Console.ReadLine(); |
|
||||
} |
|
||||
|
|
||||
private static async Task RunDemo() |
|
||||
{ |
|
||||
// discover endpoints from metadata
|
|
||||
var disco = await DiscoveryClient.GetAsync("http://localhost:59980"); |
|
||||
if (disco.IsError) |
|
||||
{ |
|
||||
Console.WriteLine(disco.Error); |
|
||||
return; |
|
||||
} |
|
||||
|
|
||||
// request token
|
|
||||
var tokenClient = new TokenClient(disco.TokenEndpoint, "client", "secret"); |
|
||||
var tokenResponse = await tokenClient.RequestClientCredentialsAsync("api1"); |
|
||||
|
|
||||
if (tokenResponse.IsError) |
|
||||
{ |
|
||||
Console.WriteLine(tokenResponse.Error); |
|
||||
return; |
|
||||
} |
|
||||
|
|
||||
Console.WriteLine(tokenResponse.Json); |
|
||||
|
|
||||
// call api
|
|
||||
var client = new HttpClient(); |
|
||||
client.SetBearerToken(tokenResponse.AccessToken); |
|
||||
|
|
||||
var response = await client.GetAsync("http://localhost:59980/identity-test"); |
|
||||
if (!response.IsSuccessStatusCode) |
|
||||
{ |
|
||||
Console.WriteLine(response.StatusCode); |
|
||||
} |
|
||||
else |
|
||||
{ |
|
||||
var content = await response.Content.ReadAsStringAsync(); |
|
||||
Console.WriteLine(content); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,42 +0,0 @@ |
|||||
<Project Sdk="Microsoft.NET.Sdk"> |
|
||||
|
|
||||
<PropertyGroup> |
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework> |
|
||||
<AssemblyName>AbpDesk.ConsoleDemo</AssemblyName> |
|
||||
<OutputType>Exe</OutputType> |
|
||||
<PackageId>AbpDesk.ConsoleDemo</PackageId> |
|
||||
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> |
|
||||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
|
||||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
|
||||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
|
||||
<RootNamespace /> |
|
||||
</PropertyGroup> |
|
||||
|
|
||||
<ItemGroup> |
|
||||
<None Update="appsettings.json"> |
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
|
||||
</None> |
|
||||
</ItemGroup> |
|
||||
|
|
||||
<ItemGroup> |
|
||||
<ProjectReference Include="..\..\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" /> |
|
||||
<ProjectReference Include="..\..\Volo.Abp.Identity.Domain\Volo.Abp.Identity.Domain.csproj" /> |
|
||||
<ProjectReference Include="..\AbpDesk.Application\AbpDesk.Application.csproj" /> |
|
||||
<ProjectReference Include="..\AbpDesk.Application.Contracts\AbpDesk.Application.Contracts.csproj" /> |
|
||||
<ProjectReference Include="..\AbpDesk.EntityFrameworkCore\AbpDesk.EntityFrameworkCore.csproj" /> |
|
||||
<ProjectReference Include="..\..\Volo.Abp.Identity.EntityFrameworkCore\Volo.Abp.Identity.EntityFrameworkCore.csproj" /> |
|
||||
<ProjectReference Include="..\AbpDesk.MongoBlog\AbpDesk.MongoBlog.csproj" /> |
|
||||
</ItemGroup> |
|
||||
|
|
||||
<ItemGroup> |
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.1"> |
|
||||
<PrivateAssets>All</PrivateAssets> |
|
||||
</PackageReference> |
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.0.0" /> |
|
||||
</ItemGroup> |
|
||||
|
|
||||
<ItemGroup> |
|
||||
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" /> |
|
||||
</ItemGroup> |
|
||||
|
|
||||
</Project> |
|
||||
@ -1,38 +0,0 @@ |
|||||
using System.IO; |
|
||||
using AbpDesk.Blogging; |
|
||||
using AbpDesk.EntityFrameworkCore; |
|
||||
using Microsoft.Extensions.Configuration; |
|
||||
using Microsoft.Extensions.DependencyInjection; |
|
||||
using Volo.Abp.Autofac; |
|
||||
using Volo.Abp.Identity.EntityFrameworkCore; |
|
||||
using Volo.Abp.Modularity; |
|
||||
|
|
||||
namespace AbpDesk.ConsoleDemo |
|
||||
{ |
|
||||
[DependsOn( |
|
||||
typeof(AbpDeskApplicationModule), |
|
||||
typeof(AbpDeskEntityFrameworkCoreModule), |
|
||||
typeof(AbpIdentityEntityFrameworkCoreModule), |
|
||||
typeof(AbpDeskMongoBlogModule), |
|
||||
typeof(AbpAutofacModule))] |
|
||||
public class AbpDeskConsoleDemoModule : AbpModule |
|
||||
{ |
|
||||
public override void ConfigureServices(IServiceCollection services) |
|
||||
{ |
|
||||
var configuration = BuildConfiguration(Directory.GetCurrentDirectory()); |
|
||||
|
|
||||
AbpDeskDbConfigurer.Configure(services, configuration); |
|
||||
|
|
||||
services.AddAssemblyOf<AbpDeskConsoleDemoModule>(); |
|
||||
} |
|
||||
|
|
||||
private static IConfigurationRoot BuildConfiguration(string basePath) |
|
||||
{ |
|
||||
var builder = new ConfigurationBuilder() |
|
||||
.SetBasePath(basePath) |
|
||||
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true); |
|
||||
|
|
||||
return builder.Build(); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,47 +0,0 @@ |
|||||
using System; |
|
||||
using AbpDesk.Blogging; |
|
||||
using Volo.Abp.Domain.Repositories; |
|
||||
using Volo.Abp.Guids; |
|
||||
using Volo.Abp.Uow; |
|
||||
using Volo.Abp.DependencyInjection; |
|
||||
|
|
||||
namespace AbpDesk.ConsoleDemo |
|
||||
{ |
|
||||
public class BlogPostLister : ITransientDependency |
|
||||
{ |
|
||||
private readonly IRepository<BlogPost, Guid> _blogPostRepository; |
|
||||
private readonly IGuidGenerator _guidGenerator; |
|
||||
|
|
||||
public BlogPostLister( |
|
||||
IRepository<BlogPost, Guid> blogPostRepository, |
|
||||
IGuidGenerator guidGenerator) |
|
||||
{ |
|
||||
_blogPostRepository = blogPostRepository; |
|
||||
_guidGenerator = guidGenerator; |
|
||||
} |
|
||||
|
|
||||
[UnitOfWork] |
|
||||
public virtual void List() |
|
||||
{ |
|
||||
Console.WriteLine(); |
|
||||
Console.WriteLine("List of blog posts:"); |
|
||||
|
|
||||
//var blog = _blogPostRepository.FirstOrDefault(b => b.Title.StartsWith("Hello World 3!"));
|
|
||||
//blog.SetTitle(blog.Title + "'");
|
|
||||
//blog.Comments.Add(new BlogPostComment("@john", "good post! " + DateTime.Now.ToString(CultureInfo.InvariantCulture), star: (byte)RandomHelper.GetRandom(1, 6)));
|
|
||||
//_blogPostRepository.Update(blog);
|
|
||||
|
|
||||
//_blogPostRepository.Insert(new BlogPost(_guidGenerator.Create(), "Hello World 1!", DateTime.Now.ToString(CultureInfo.InvariantCulture)));
|
|
||||
|
|
||||
foreach (var blogPost in _blogPostRepository) |
|
||||
{ |
|
||||
Console.WriteLine("# " + blogPost); |
|
||||
|
|
||||
foreach (var comment in blogPost.Comments) |
|
||||
{ |
|
||||
Console.WriteLine(" - " + comment); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,76 +0,0 @@ |
|||||
using System; |
|
||||
using System.IO; |
|
||||
using Microsoft.Extensions.DependencyInjection; |
|
||||
using Volo.Abp; |
|
||||
using Volo.Abp.Modularity.PlugIns; |
|
||||
|
|
||||
namespace AbpDesk.ConsoleDemo |
|
||||
{ |
|
||||
public class Program |
|
||||
{ |
|
||||
public static void Main(string[] args) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
RunDemo(); |
|
||||
} |
|
||||
catch (Exception ex) |
|
||||
{ |
|
||||
Console.WriteLine("ERROR: " + ex.Message); |
|
||||
Console.ReadLine(); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
private static void RunDemo() |
|
||||
{ |
|
||||
using (var application = AbpApplicationFactory.Create<AbpDeskConsoleDemoModule>(options => |
|
||||
{ |
|
||||
options.UseAutofac(); |
|
||||
AddPlugIns(options); |
|
||||
})) |
|
||||
{ |
|
||||
application.Initialize(); |
|
||||
|
|
||||
RunListers(application); |
|
||||
|
|
||||
Console.WriteLine("Press ENTER to exit..."); |
|
||||
Console.ReadLine(); |
|
||||
|
|
||||
application.Shutdown(); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
private static void RunListers(IAbpApplication application) |
|
||||
{ |
|
||||
application |
|
||||
.ServiceProvider |
|
||||
.GetRequiredService<TicketLister>() |
|
||||
.List(); |
|
||||
|
|
||||
application |
|
||||
.ServiceProvider |
|
||||
.GetRequiredService<UserLister>() |
|
||||
.List(); |
|
||||
|
|
||||
application |
|
||||
.ServiceProvider |
|
||||
.GetRequiredService<BlogPostLister>() |
|
||||
.List(); |
|
||||
} |
|
||||
|
|
||||
private static void AddPlugIns(AbpApplicationCreationOptions options) |
|
||||
{ |
|
||||
options.PlugInSources.Add( |
|
||||
new FolderPlugInSource( |
|
||||
Path.Combine( |
|
||||
Directory.GetCurrentDirectory(), |
|
||||
@"..\AbpDesk.SamplePlugInModule\bin\Debug\netstandard1.6\" |
|
||||
) |
|
||||
) |
|
||||
{ |
|
||||
Filter = filePath => filePath.EndsWith("AbpDesk.SamplePlugInModule.dll") |
|
||||
} |
|
||||
); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,55 +0,0 @@ |
|||||
using System; |
|
||||
using AbpDesk.Tickets; |
|
||||
using AbpDesk.Tickets.Dtos; |
|
||||
using Volo.Abp.Threading; |
|
||||
using Volo.Abp.DependencyInjection; |
|
||||
|
|
||||
namespace AbpDesk.ConsoleDemo |
|
||||
{ |
|
||||
public class TicketLister : ITransientDependency |
|
||||
{ |
|
||||
private readonly ITicketAppService _ticketAppService; |
|
||||
|
|
||||
public TicketLister(ITicketAppService ticketAppService) |
|
||||
{ |
|
||||
_ticketAppService = ticketAppService; |
|
||||
} |
|
||||
|
|
||||
public void List() |
|
||||
{ |
|
||||
Console.WriteLine(); |
|
||||
Console.WriteLine("List of tickets:"); |
|
||||
|
|
||||
var result = AsyncHelper.RunSync(() => _ticketAppService.GetAll(new GetAllTicketsInput())); |
|
||||
|
|
||||
foreach (var ticket in result.Items) |
|
||||
{ |
|
||||
Console.WriteLine(ticket); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
//Uses TicketAppService instead of ITicketAppService.
|
|
||||
public class TicketLister2 : ITransientDependency |
|
||||
{ |
|
||||
private readonly TicketAppService _ticketAppService; |
|
||||
|
|
||||
public TicketLister2(TicketAppService ticketAppService) |
|
||||
{ |
|
||||
_ticketAppService = ticketAppService; |
|
||||
} |
|
||||
|
|
||||
public void List() |
|
||||
{ |
|
||||
Console.WriteLine(); |
|
||||
Console.WriteLine("List of tickets:"); |
|
||||
|
|
||||
var result = AsyncHelper.RunSync(() => _ticketAppService.GetAll(new GetAllTicketsInput())); |
|
||||
|
|
||||
foreach (var ticket in result.Items) |
|
||||
{ |
|
||||
Console.WriteLine(ticket); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,41 +0,0 @@ |
|||||
using System; |
|
||||
using System.Linq; |
|
||||
using Volo.Abp.DependencyInjection; |
|
||||
using Volo.Abp.Domain.Repositories; |
|
||||
using Volo.Abp.Identity; |
|
||||
using Volo.Abp.Threading; |
|
||||
using Volo.Abp.Uow; |
|
||||
|
|
||||
namespace AbpDesk.ConsoleDemo |
|
||||
{ |
|
||||
public class UserLister : ITransientDependency |
|
||||
{ |
|
||||
private readonly IdentityUserManager _userManager; |
|
||||
private readonly IRepository<IdentityUser, Guid> _userRepository; |
|
||||
|
|
||||
public UserLister( |
|
||||
IdentityUserManager userManager, |
|
||||
IRepository<IdentityUser, Guid> userRepository) |
|
||||
{ |
|
||||
_userManager = userManager; |
|
||||
_userRepository = userRepository; |
|
||||
} |
|
||||
|
|
||||
[UnitOfWork] |
|
||||
public virtual void List() |
|
||||
{ |
|
||||
Console.WriteLine(); |
|
||||
Console.WriteLine("List of users:"); |
|
||||
|
|
||||
foreach (var user in _userRepository.ToList()) |
|
||||
{ |
|
||||
Console.WriteLine("# " + user); |
|
||||
|
|
||||
foreach (var roleName in AsyncHelper.RunSync(() => _userManager.GetRolesAsync(user))) |
|
||||
{ |
|
||||
Console.WriteLine(" - " + roleName); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,18 +0,0 @@ |
|||||
using System.Reflection; |
|
||||
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.ConsoleDemo")] |
|
||||
[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("1a1575d7-e57e-4a40-8113-fd01bb1753d5")] |
|
||||
@ -1,25 +0,0 @@ |
|||||
{ |
|
||||
"ConnectionStrings": { |
|
||||
"Default": "Server=localhost;Database=AbpDesk;Trusted_Connection=True;", |
|
||||
"AbpDeskMongoBlog": "mongodb://127.0.0.1:27017|AbpDeskBlog" |
|
||||
}, |
|
||||
//Example tenant configuration, not used! |
|
||||
"Tenants": [ |
|
||||
{ |
|
||||
"Id": "2D8BF07D-50F4-4A70-805E-C7618F008043", |
|
||||
"Name": "Acme", |
|
||||
"ConnectionStrings": { |
|
||||
"Default": "...", |
|
||||
"AbpDeskMongoBlog": "..." |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
"Id": "33A01BA1-4106-41DA-AF34-28028FB9BD1D", |
|
||||
"Name": "Vlsft", |
|
||||
"ConnectionStrings": { |
|
||||
"Default": "...", |
|
||||
"AbpDeskMongoBlog": "..." |
|
||||
} |
|
||||
} |
|
||||
] |
|
||||
} |
|
||||
@ -1,22 +0,0 @@ |
|||||
<Project Sdk="Microsoft.NET.Sdk"> |
|
||||
|
|
||||
<PropertyGroup> |
|
||||
<TargetFramework>netstandard2.0</TargetFramework> |
|
||||
<AssemblyName>AbpDesk.Domain</AssemblyName> |
|
||||
<PackageId>AbpDesk.Domain</PackageId> |
|
||||
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> |
|
||||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
|
||||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
|
||||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
|
||||
<RootNamespace /> |
|
||||
</PropertyGroup> |
|
||||
|
|
||||
<ItemGroup> |
|
||||
<ProjectReference Include="..\..\Volo.Abp.Ddd.Domain\Volo.Abp.Ddd.Domain.csproj" /> |
|
||||
</ItemGroup> |
|
||||
|
|
||||
<ItemGroup> |
|
||||
<PackageReference Include="System.ComponentModel.Annotations" Version="4.4.1" /> |
|
||||
</ItemGroup> |
|
||||
|
|
||||
</Project> |
|
||||
@ -1,15 +0,0 @@ |
|||||
using Microsoft.Extensions.DependencyInjection; |
|
||||
using Volo.Abp.Domain; |
|
||||
using Volo.Abp.Modularity; |
|
||||
|
|
||||
namespace AbpDesk |
|
||||
{ |
|
||||
[DependsOn(typeof(AbpDddDomainModule))] |
|
||||
public class AbpDeskDomainModule : AbpModule |
|
||||
{ |
|
||||
public override void ConfigureServices(IServiceCollection services) |
|
||||
{ |
|
||||
services.AddAssemblyOf<AbpDeskDomainModule>(); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,36 +0,0 @@ |
|||||
using System; |
|
||||
using JetBrains.Annotations; |
|
||||
using Volo.Abp; |
|
||||
using Volo.Abp.Domain.Entities; |
|
||||
|
|
||||
namespace AbpDesk.Tickets |
|
||||
{ |
|
||||
public class Ticket : AggregateRoot<int>, IHasConcurrencyStamp |
|
||||
{ |
|
||||
public const int MaxTitleLength = 256; |
|
||||
|
|
||||
public const int MaxBodyLength = 64 * 1024; //64K
|
|
||||
|
|
||||
[NotNull] |
|
||||
public string Title { get; protected set; } |
|
||||
|
|
||||
[CanBeNull] |
|
||||
public string Body { get; protected set; } |
|
||||
|
|
||||
public string ConcurrencyStamp { get; set; } |
|
||||
|
|
||||
protected Ticket() |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public Ticket([NotNull] string title, [CanBeNull] string body = null) |
|
||||
{ |
|
||||
Check.NotNull(title, nameof(title)); |
|
||||
|
|
||||
Title = title; |
|
||||
Body = body; |
|
||||
ConcurrencyStamp = Guid.NewGuid().ToString(); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,18 +0,0 @@ |
|||||
using System.Reflection; |
|
||||
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")] |
|
||||
@ -1,32 +0,0 @@ |
|||||
<Project Sdk="Microsoft.NET.Sdk"> |
|
||||
|
|
||||
<PropertyGroup> |
|
||||
<TargetFramework>netstandard2.0</TargetFramework> |
|
||||
<AssemblyName>AbpDesk.EntityFrameworkCore</AssemblyName> |
|
||||
<PackageId>AbpDesk.EntityFrameworkCore</PackageId> |
|
||||
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> |
|
||||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
|
||||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
|
||||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
|
||||
<RootNamespace /> |
|
||||
</PropertyGroup> |
|
||||
|
|
||||
<ItemGroup> |
|
||||
<ProjectReference Include="..\..\Volo.Abp.MultiTenancy.EntityFrameworkCore\Volo.Abp.MultiTenancy.EntityFrameworkCore.csproj" /> |
|
||||
<ProjectReference Include="..\..\Volo.Abp.Permissions.EntityFrameworkCore\Volo.Abp.Permissions.EntityFrameworkCore.csproj" /> |
|
||||
<ProjectReference Include="..\AbpDesk.Domain\AbpDesk.Domain.csproj" /> |
|
||||
<ProjectReference Include="..\..\Volo.Abp.EntityFrameworkCore\Volo.Abp.EntityFrameworkCore.csproj" /> |
|
||||
</ItemGroup> |
|
||||
|
|
||||
<ItemGroup> |
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.0.1" /> |
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.1"> |
|
||||
<PrivateAssets>All</PrivateAssets> |
|
||||
</PackageReference> |
|
||||
</ItemGroup> |
|
||||
|
|
||||
<ItemGroup> |
|
||||
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" /> |
|
||||
</ItemGroup> |
|
||||
|
|
||||
</Project> |
|
||||
@ -1,37 +0,0 @@ |
|||||
using Microsoft.EntityFrameworkCore; |
|
||||
using Microsoft.Extensions.Configuration; |
|
||||
using Microsoft.Extensions.DependencyInjection; |
|
||||
using Volo.Abp.Data; |
|
||||
using Volo.Abp.EntityFrameworkCore; |
|
||||
|
|
||||
namespace AbpDesk.EntityFrameworkCore |
|
||||
{ |
|
||||
public static class AbpDeskDbConfigurer |
|
||||
{ |
|
||||
public static void Configure(IServiceCollection services, IConfigurationRoot configuration) |
|
||||
{ |
|
||||
//Configure DbConnectionOptions by configuration file (appsettings.json)
|
|
||||
services.Configure<DbConnectionOptions>(configuration); //TODO: Move to the application. No proper to be in EF Core package.
|
|
||||
|
|
||||
services.Configure<AbpDbContextOptions>(options => |
|
||||
{ |
|
||||
//Configures all dbcontextes to use Sql Server with calculated connection string
|
|
||||
options.Configure(context => |
|
||||
{ |
|
||||
//TODO: Create an extension method to AbpDbContextConfigurationContext to use SqlServer in single line call! Example:
|
|
||||
/* context.UseSqlServer(opional action to configure sqlserver) |
|
||||
* This internally makes the if below! |
|
||||
*/ |
|
||||
if (context.ExistingConnection != null) |
|
||||
{ |
|
||||
context.DbContextOptions.UseSqlServer(context.ExistingConnection); |
|
||||
} |
|
||||
else |
|
||||
{ |
|
||||
context.DbContextOptions.UseSqlServer(context.ConnectionString); |
|
||||
} |
|
||||
}); |
|
||||
}); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,46 +0,0 @@ |
|||||
using AbpDesk.Tickets; |
|
||||
using Microsoft.EntityFrameworkCore; |
|
||||
using Volo.Abp.Data; |
|
||||
using Volo.Abp.EntityFrameworkCore; |
|
||||
using Volo.Abp.MultiTenancy; |
|
||||
using Volo.Abp.MultiTenancy.EntityFrameworkCore; |
|
||||
using Volo.Abp.Permissions; |
|
||||
using Volo.Abp.Permissions.EntityFrameworkCore; |
|
||||
|
|
||||
namespace AbpDesk.EntityFrameworkCore |
|
||||
{ |
|
||||
[ConnectionStringName(ConnectionStrings.DefaultConnectionStringName)] //Explicitly declares this module always uses the default connection string
|
|
||||
public class AbpDeskDbContext : AbpDbContext<AbpDeskDbContext>, IMultiTenancyDbContext, IAbpPermissionsDbContext |
|
||||
{ |
|
||||
public DbSet<Ticket> Tickets { get; set; } |
|
||||
|
|
||||
public DbSet<Tenant> Tenants { get; set; } |
|
||||
|
|
||||
public DbSet<TenantConnectionString> TenantConnectionStrings { get; set; } |
|
||||
|
|
||||
public DbSet<PermissionGrant> PermissionGrants { get; set; } |
|
||||
|
|
||||
public AbpDeskDbContext(DbContextOptions<AbpDeskDbContext> options) |
|
||||
: base(options) |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
|
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder) |
|
||||
{ |
|
||||
base.OnModelCreating(modelBuilder); |
|
||||
|
|
||||
modelBuilder.ConfigureMultiTenancy(); |
|
||||
modelBuilder.ConfigureAbpPermissions(); |
|
||||
|
|
||||
//Use different classes to map each entity type, as a better practice?
|
|
||||
modelBuilder.Entity<Ticket>(b => |
|
||||
{ |
|
||||
b.ToTable("DskTickets"); |
|
||||
|
|
||||
b.Property(t => t.Title).HasMaxLength(Ticket.MaxTitleLength).IsRequired(); |
|
||||
b.Property(t => t.Body).HasMaxLength(Ticket.MaxBodyLength); |
|
||||
}); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,17 +0,0 @@ |
|||||
using Microsoft.EntityFrameworkCore; |
|
||||
using Microsoft.EntityFrameworkCore.Design; |
|
||||
|
|
||||
namespace AbpDesk.EntityFrameworkCore |
|
||||
{ |
|
||||
/* This class is needed for EF Core command line tooling */ |
|
||||
|
|
||||
public class AbpDeskDefaultDbContextFactory : IDesignTimeDbContextFactory<AbpDeskDbContext> |
|
||||
{ |
|
||||
public AbpDeskDbContext CreateDbContext(string[] args) |
|
||||
{ |
|
||||
var builder = new DbContextOptionsBuilder<AbpDeskDbContext>(); |
|
||||
builder.UseSqlServer("Server=localhost;Database=AbpDesk;Trusted_Connection=True;"); |
|
||||
return new AbpDeskDbContext(builder.Options); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,29 +0,0 @@ |
|||||
using Microsoft.Extensions.DependencyInjection; |
|
||||
using Volo.Abp.EntityFrameworkCore; |
|
||||
using Volo.Abp.Modularity; |
|
||||
using Volo.Abp.MultiTenancy.EntityFrameworkCore; |
|
||||
using Volo.Abp.Permissions.EntityFrameworkCore; |
|
||||
|
|
||||
namespace AbpDesk.EntityFrameworkCore |
|
||||
{ |
|
||||
[DependsOn( |
|
||||
typeof(AbpDeskDomainModule), |
|
||||
typeof(AbpEntityFrameworkCoreModule), |
|
||||
typeof(AbpMultiTenancyEntityFrameworkCoreModule), |
|
||||
typeof(AbpPermissionsEntityFrameworkCoreModule) |
|
||||
)] |
|
||||
public class AbpDeskEntityFrameworkCoreModule : AbpModule |
|
||||
{ |
|
||||
public override void ConfigureServices(IServiceCollection services) |
|
||||
{ |
|
||||
services.AddAbpDbContext<AbpDeskDbContext>(options => |
|
||||
{ |
|
||||
options.AddDefaultRepositories(); |
|
||||
options.ReplaceDbContext<IMultiTenancyDbContext>(); |
|
||||
options.ReplaceDbContext<IAbpPermissionsDbContext>(); |
|
||||
}); |
|
||||
|
|
||||
services.AddAssemblyOf<AbpDeskEntityFrameworkCoreModule>(); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,41 +0,0 @@ |
|||||
using System; |
|
||||
using Microsoft.EntityFrameworkCore; |
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure; |
|
||||
using Microsoft.EntityFrameworkCore.Metadata; |
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
|
||||
using AbpDesk.EntityFrameworkCore; |
|
||||
|
|
||||
namespace AbpDesk.EntityFrameworkCore.Migrations |
|
||||
{ |
|
||||
[DbContext(typeof(AbpDeskDbContext))] |
|
||||
[Migration("20170123122207_AbpDesk_Initial")] |
|
||||
partial class AbpDesk_Initial |
|
||||
{ |
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
|
||||
{ |
|
||||
modelBuilder |
|
||||
.HasAnnotation("ProductVersion", "1.1.0-rtm-22752") |
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); |
|
||||
|
|
||||
modelBuilder.Entity("AbpDesk.Tickets.Ticket", b => |
|
||||
{ |
|
||||
b.Property<int>("Id") |
|
||||
.ValueGeneratedOnAdd(); |
|
||||
|
|
||||
b.Property<string>("Body") |
|
||||
.HasMaxLength(65536); |
|
||||
|
|
||||
b.Property<string>("ConcurrencyStamp") |
|
||||
.IsConcurrencyToken(); |
|
||||
|
|
||||
b.Property<string>("Title") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(256); |
|
||||
|
|
||||
b.HasKey("Id"); |
|
||||
|
|
||||
b.ToTable("DskTickets"); |
|
||||
}); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,32 +0,0 @@ |
|||||
using Microsoft.EntityFrameworkCore.Migrations; |
|
||||
using Microsoft.EntityFrameworkCore.Metadata; |
|
||||
|
|
||||
namespace AbpDesk.EntityFrameworkCore.Migrations |
|
||||
{ |
|
||||
public partial class AbpDesk_Initial : Migration |
|
||||
{ |
|
||||
protected override void Up(MigrationBuilder migrationBuilder) |
|
||||
{ |
|
||||
migrationBuilder.CreateTable( |
|
||||
name: "DskTickets", |
|
||||
columns: table => new |
|
||||
{ |
|
||||
Id = table.Column<int>(nullable: false) |
|
||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), |
|
||||
Body = table.Column<string>(maxLength: 65536, nullable: true), |
|
||||
ConcurrencyStamp = table.Column<string>(nullable: true), |
|
||||
Title = table.Column<string>(maxLength: 256, nullable: false) |
|
||||
}, |
|
||||
constraints: table => |
|
||||
{ |
|
||||
table.PrimaryKey("PK_DskTickets", x => x.Id); |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
|
||||
{ |
|
||||
migrationBuilder.DropTable( |
|
||||
name: "DskTickets"); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,92 +0,0 @@ |
|||||
// <auto-generated />
|
|
||||
using AbpDesk.EntityFrameworkCore; |
|
||||
using Microsoft.EntityFrameworkCore; |
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure; |
|
||||
using Microsoft.EntityFrameworkCore.Metadata; |
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
|
||||
using Microsoft.EntityFrameworkCore.Storage; |
|
||||
using Microsoft.EntityFrameworkCore.Storage.Internal; |
|
||||
using System; |
|
||||
|
|
||||
namespace AbpDesk.EntityFrameworkCore.Migrations |
|
||||
{ |
|
||||
[DbContext(typeof(AbpDeskDbContext))] |
|
||||
[Migration("20180105184326_MultiTenancyModuleAdded")] |
|
||||
partial class MultiTenancyModuleAdded |
|
||||
{ |
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
|
||||
{ |
|
||||
#pragma warning disable 612, 618
|
|
||||
modelBuilder |
|
||||
.HasAnnotation("ProductVersion", "2.0.0-rtm-26452") |
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); |
|
||||
|
|
||||
modelBuilder.Entity("AbpDesk.Tickets.Ticket", b => |
|
||||
{ |
|
||||
b.Property<int>("Id") |
|
||||
.ValueGeneratedOnAdd(); |
|
||||
|
|
||||
b.Property<string>("Body") |
|
||||
.HasMaxLength(65536); |
|
||||
|
|
||||
b.Property<string>("ConcurrencyStamp") |
|
||||
.IsConcurrencyToken(); |
|
||||
|
|
||||
b.Property<string>("Title") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(256); |
|
||||
|
|
||||
b.HasKey("Id"); |
|
||||
|
|
||||
b.ToTable("DskTickets"); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("Volo.Abp.MultiTenancy.Tenant", b => |
|
||||
{ |
|
||||
b.Property<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd(); |
|
||||
|
|
||||
b.Property<string>("Name") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(64); |
|
||||
|
|
||||
b.HasKey("Id"); |
|
||||
|
|
||||
b.HasIndex("Name"); |
|
||||
|
|
||||
b.ToTable("MtTenants"); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("Volo.Abp.MultiTenancy.TenantConnectionString", b => |
|
||||
{ |
|
||||
b.Property<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd(); |
|
||||
|
|
||||
b.Property<string>("Name") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(256); |
|
||||
|
|
||||
b.Property<Guid>("TenantId"); |
|
||||
|
|
||||
b.Property<string>("Value") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(1024); |
|
||||
|
|
||||
b.HasKey("Id"); |
|
||||
|
|
||||
b.HasIndex("TenantId"); |
|
||||
|
|
||||
b.ToTable("MtTenantConnectionStrings"); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("Volo.Abp.MultiTenancy.TenantConnectionString", b => |
|
||||
{ |
|
||||
b.HasOne("Volo.Abp.MultiTenancy.Tenant") |
|
||||
.WithMany("ConnectionStrings") |
|
||||
.HasForeignKey("TenantId") |
|
||||
.OnDelete(DeleteBehavior.Cascade); |
|
||||
}); |
|
||||
#pragma warning restore 612, 618
|
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,62 +0,0 @@ |
|||||
using Microsoft.EntityFrameworkCore.Migrations; |
|
||||
using System; |
|
||||
|
|
||||
namespace AbpDesk.EntityFrameworkCore.Migrations |
|
||||
{ |
|
||||
public partial class MultiTenancyModuleAdded : Migration |
|
||||
{ |
|
||||
protected override void Up(MigrationBuilder migrationBuilder) |
|
||||
{ |
|
||||
migrationBuilder.CreateTable( |
|
||||
name: "MtTenants", |
|
||||
columns: table => new |
|
||||
{ |
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|
||||
Name = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false) |
|
||||
}, |
|
||||
constraints: table => |
|
||||
{ |
|
||||
table.PrimaryKey("PK_MtTenants", x => x.Id); |
|
||||
}); |
|
||||
|
|
||||
migrationBuilder.CreateTable( |
|
||||
name: "MtTenantConnectionStrings", |
|
||||
columns: table => new |
|
||||
{ |
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|
||||
Name = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false), |
|
||||
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|
||||
Value = table.Column<string>(type: "nvarchar(1024)", maxLength: 1024, nullable: false) |
|
||||
}, |
|
||||
constraints: table => |
|
||||
{ |
|
||||
table.PrimaryKey("PK_MtTenantConnectionStrings", x => x.Id); |
|
||||
table.ForeignKey( |
|
||||
name: "FK_MtTenantConnectionStrings_MtTenants_TenantId", |
|
||||
column: x => x.TenantId, |
|
||||
principalTable: "MtTenants", |
|
||||
principalColumn: "Id", |
|
||||
onDelete: ReferentialAction.Cascade); |
|
||||
}); |
|
||||
|
|
||||
migrationBuilder.CreateIndex( |
|
||||
name: "IX_MtTenantConnectionStrings_TenantId", |
|
||||
table: "MtTenantConnectionStrings", |
|
||||
column: "TenantId"); |
|
||||
|
|
||||
migrationBuilder.CreateIndex( |
|
||||
name: "IX_MtTenants_Name", |
|
||||
table: "MtTenants", |
|
||||
column: "Name"); |
|
||||
} |
|
||||
|
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
|
||||
{ |
|
||||
migrationBuilder.DropTable( |
|
||||
name: "MtTenantConnectionStrings"); |
|
||||
|
|
||||
migrationBuilder.DropTable( |
|
||||
name: "MtTenants"); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,111 +0,0 @@ |
|||||
// <auto-generated />
|
|
||||
using AbpDesk.EntityFrameworkCore; |
|
||||
using Microsoft.EntityFrameworkCore; |
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure; |
|
||||
using Microsoft.EntityFrameworkCore.Metadata; |
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
|
||||
using Microsoft.EntityFrameworkCore.Storage; |
|
||||
using Microsoft.EntityFrameworkCore.Storage.Internal; |
|
||||
using System; |
|
||||
|
|
||||
namespace AbpDesk.EntityFrameworkCore.Migrations |
|
||||
{ |
|
||||
[DbContext(typeof(AbpDeskDbContext))] |
|
||||
[Migration("20180215073249_Added_PermissionGrant_Entity")] |
|
||||
partial class Added_PermissionGrant_Entity |
|
||||
{ |
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
|
||||
{ |
|
||||
#pragma warning disable 612, 618
|
|
||||
modelBuilder |
|
||||
.HasAnnotation("ProductVersion", "2.0.1-rtm-125") |
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); |
|
||||
|
|
||||
modelBuilder.Entity("AbpDesk.Tickets.Ticket", b => |
|
||||
{ |
|
||||
b.Property<int>("Id") |
|
||||
.ValueGeneratedOnAdd(); |
|
||||
|
|
||||
b.Property<string>("Body") |
|
||||
.HasMaxLength(65536); |
|
||||
|
|
||||
b.Property<string>("ConcurrencyStamp") |
|
||||
.IsConcurrencyToken(); |
|
||||
|
|
||||
b.Property<string>("Title") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(256); |
|
||||
|
|
||||
b.HasKey("Id"); |
|
||||
|
|
||||
b.ToTable("DskTickets"); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("Volo.Abp.MultiTenancy.Tenant", b => |
|
||||
{ |
|
||||
b.Property<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd(); |
|
||||
|
|
||||
b.Property<string>("Name") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(64); |
|
||||
|
|
||||
b.HasKey("Id"); |
|
||||
|
|
||||
b.HasIndex("Name") |
|
||||
.IsUnique(); |
|
||||
|
|
||||
b.ToTable("MtTenants"); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("Volo.Abp.MultiTenancy.TenantConnectionString", b => |
|
||||
{ |
|
||||
b.Property<Guid>("TenantId"); |
|
||||
|
|
||||
b.Property<string>("Name") |
|
||||
.HasMaxLength(128); |
|
||||
|
|
||||
b.Property<string>("Value") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(1024); |
|
||||
|
|
||||
b.HasKey("TenantId", "Name"); |
|
||||
|
|
||||
b.ToTable("MtTenantConnectionStrings"); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("Volo.Abp.Permissions.PermissionGrant", b => |
|
||||
{ |
|
||||
b.Property<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd(); |
|
||||
|
|
||||
b.Property<string>("Name") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(128); |
|
||||
|
|
||||
b.Property<string>("ProviderKey") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(64); |
|
||||
|
|
||||
b.Property<string>("ProviderName") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(64); |
|
||||
|
|
||||
b.HasKey("Id"); |
|
||||
|
|
||||
b.HasIndex("Name", "ProviderName", "ProviderKey"); |
|
||||
|
|
||||
b.ToTable("AbpPermissionGrants"); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("Volo.Abp.MultiTenancy.TenantConnectionString", b => |
|
||||
{ |
|
||||
b.HasOne("Volo.Abp.MultiTenancy.Tenant") |
|
||||
.WithMany("ConnectionStrings") |
|
||||
.HasForeignKey("TenantId") |
|
||||
.OnDelete(DeleteBehavior.Cascade); |
|
||||
}); |
|
||||
#pragma warning restore 612, 618
|
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,108 +0,0 @@ |
|||||
using Microsoft.EntityFrameworkCore.Migrations; |
|
||||
using System; |
|
||||
|
|
||||
namespace AbpDesk.EntityFrameworkCore.Migrations |
|
||||
{ |
|
||||
public partial class Added_PermissionGrant_Entity : Migration |
|
||||
{ |
|
||||
protected override void Up(MigrationBuilder migrationBuilder) |
|
||||
{ |
|
||||
migrationBuilder.DropIndex( |
|
||||
name: "IX_MtTenants_Name", |
|
||||
table: "MtTenants"); |
|
||||
|
|
||||
migrationBuilder.DropPrimaryKey( |
|
||||
name: "PK_MtTenantConnectionStrings", |
|
||||
table: "MtTenantConnectionStrings"); |
|
||||
|
|
||||
migrationBuilder.DropIndex( |
|
||||
name: "IX_MtTenantConnectionStrings_TenantId", |
|
||||
table: "MtTenantConnectionStrings"); |
|
||||
|
|
||||
migrationBuilder.DropColumn( |
|
||||
name: "Id", |
|
||||
table: "MtTenantConnectionStrings"); |
|
||||
|
|
||||
migrationBuilder.AlterColumn<string>( |
|
||||
name: "Name", |
|
||||
table: "MtTenantConnectionStrings", |
|
||||
maxLength: 128, |
|
||||
nullable: false, |
|
||||
oldClrType: typeof(string), |
|
||||
oldMaxLength: 256); |
|
||||
|
|
||||
migrationBuilder.AddPrimaryKey( |
|
||||
name: "PK_MtTenantConnectionStrings", |
|
||||
table: "MtTenantConnectionStrings", |
|
||||
columns: new[] { "TenantId", "Name" }); |
|
||||
|
|
||||
migrationBuilder.CreateTable( |
|
||||
name: "AbpPermissionGrants", |
|
||||
columns: table => new |
|
||||
{ |
|
||||
Id = table.Column<Guid>(nullable: false), |
|
||||
Name = table.Column<string>(maxLength: 128, nullable: false), |
|
||||
ProviderKey = table.Column<string>(maxLength: 64, nullable: false), |
|
||||
ProviderName = table.Column<string>(maxLength: 64, nullable: false) |
|
||||
}, |
|
||||
constraints: table => |
|
||||
{ |
|
||||
table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id); |
|
||||
}); |
|
||||
|
|
||||
migrationBuilder.CreateIndex( |
|
||||
name: "IX_MtTenants_Name", |
|
||||
table: "MtTenants", |
|
||||
column: "Name", |
|
||||
unique: true); |
|
||||
|
|
||||
migrationBuilder.CreateIndex( |
|
||||
name: "IX_AbpPermissionGrants_Name_ProviderName_ProviderKey", |
|
||||
table: "AbpPermissionGrants", |
|
||||
columns: new[] { "Name", "ProviderName", "ProviderKey" }); |
|
||||
} |
|
||||
|
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
|
||||
{ |
|
||||
migrationBuilder.DropTable( |
|
||||
name: "AbpPermissionGrants"); |
|
||||
|
|
||||
migrationBuilder.DropIndex( |
|
||||
name: "IX_MtTenants_Name", |
|
||||
table: "MtTenants"); |
|
||||
|
|
||||
migrationBuilder.DropPrimaryKey( |
|
||||
name: "PK_MtTenantConnectionStrings", |
|
||||
table: "MtTenantConnectionStrings"); |
|
||||
|
|
||||
migrationBuilder.AlterColumn<string>( |
|
||||
name: "Name", |
|
||||
table: "MtTenantConnectionStrings", |
|
||||
maxLength: 256, |
|
||||
nullable: false, |
|
||||
oldClrType: typeof(string), |
|
||||
oldMaxLength: 128); |
|
||||
|
|
||||
migrationBuilder.AddColumn<Guid>( |
|
||||
name: "Id", |
|
||||
table: "MtTenantConnectionStrings", |
|
||||
nullable: false, |
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); |
|
||||
|
|
||||
migrationBuilder.AddPrimaryKey( |
|
||||
name: "PK_MtTenantConnectionStrings", |
|
||||
table: "MtTenantConnectionStrings", |
|
||||
column: "Id"); |
|
||||
|
|
||||
migrationBuilder.CreateIndex( |
|
||||
name: "IX_MtTenants_Name", |
|
||||
table: "MtTenants", |
|
||||
column: "Name"); |
|
||||
|
|
||||
migrationBuilder.CreateIndex( |
|
||||
name: "IX_MtTenantConnectionStrings_TenantId", |
|
||||
table: "MtTenantConnectionStrings", |
|
||||
column: "TenantId"); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,113 +0,0 @@ |
|||||
// <auto-generated />
|
|
||||
using AbpDesk.EntityFrameworkCore; |
|
||||
using Microsoft.EntityFrameworkCore; |
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure; |
|
||||
using Microsoft.EntityFrameworkCore.Metadata; |
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
|
||||
using Microsoft.EntityFrameworkCore.Storage; |
|
||||
using Microsoft.EntityFrameworkCore.Storage.Internal; |
|
||||
using System; |
|
||||
|
|
||||
namespace AbpDesk.EntityFrameworkCore.Migrations |
|
||||
{ |
|
||||
[DbContext(typeof(AbpDeskDbContext))] |
|
||||
[Migration("20180218143334_Made_Permission_Entity_MultiTenant")] |
|
||||
partial class Made_Permission_Entity_MultiTenant |
|
||||
{ |
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
|
||||
{ |
|
||||
#pragma warning disable 612, 618
|
|
||||
modelBuilder |
|
||||
.HasAnnotation("ProductVersion", "2.0.1-rtm-125") |
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); |
|
||||
|
|
||||
modelBuilder.Entity("AbpDesk.Tickets.Ticket", b => |
|
||||
{ |
|
||||
b.Property<int>("Id") |
|
||||
.ValueGeneratedOnAdd(); |
|
||||
|
|
||||
b.Property<string>("Body") |
|
||||
.HasMaxLength(65536); |
|
||||
|
|
||||
b.Property<string>("ConcurrencyStamp") |
|
||||
.IsConcurrencyToken(); |
|
||||
|
|
||||
b.Property<string>("Title") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(256); |
|
||||
|
|
||||
b.HasKey("Id"); |
|
||||
|
|
||||
b.ToTable("DskTickets"); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("Volo.Abp.MultiTenancy.Tenant", b => |
|
||||
{ |
|
||||
b.Property<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd(); |
|
||||
|
|
||||
b.Property<string>("Name") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(64); |
|
||||
|
|
||||
b.HasKey("Id"); |
|
||||
|
|
||||
b.HasIndex("Name") |
|
||||
.IsUnique(); |
|
||||
|
|
||||
b.ToTable("MtTenants"); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("Volo.Abp.MultiTenancy.TenantConnectionString", b => |
|
||||
{ |
|
||||
b.Property<Guid>("TenantId"); |
|
||||
|
|
||||
b.Property<string>("Name") |
|
||||
.HasMaxLength(128); |
|
||||
|
|
||||
b.Property<string>("Value") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(1024); |
|
||||
|
|
||||
b.HasKey("TenantId", "Name"); |
|
||||
|
|
||||
b.ToTable("MtTenantConnectionStrings"); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("Volo.Abp.Permissions.PermissionGrant", b => |
|
||||
{ |
|
||||
b.Property<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd(); |
|
||||
|
|
||||
b.Property<string>("Name") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(128); |
|
||||
|
|
||||
b.Property<string>("ProviderKey") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(64); |
|
||||
|
|
||||
b.Property<string>("ProviderName") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(64); |
|
||||
|
|
||||
b.Property<Guid?>("TenantId"); |
|
||||
|
|
||||
b.HasKey("Id"); |
|
||||
|
|
||||
b.HasIndex("Name", "ProviderName", "ProviderKey"); |
|
||||
|
|
||||
b.ToTable("AbpPermissionGrants"); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("Volo.Abp.MultiTenancy.TenantConnectionString", b => |
|
||||
{ |
|
||||
b.HasOne("Volo.Abp.MultiTenancy.Tenant") |
|
||||
.WithMany("ConnectionStrings") |
|
||||
.HasForeignKey("TenantId") |
|
||||
.OnDelete(DeleteBehavior.Cascade); |
|
||||
}); |
|
||||
#pragma warning restore 612, 618
|
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,23 +0,0 @@ |
|||||
using Microsoft.EntityFrameworkCore.Migrations; |
|
||||
using System; |
|
||||
|
|
||||
namespace AbpDesk.EntityFrameworkCore.Migrations |
|
||||
{ |
|
||||
public partial class Made_Permission_Entity_MultiTenant : Migration |
|
||||
{ |
|
||||
protected override void Up(MigrationBuilder migrationBuilder) |
|
||||
{ |
|
||||
migrationBuilder.AddColumn<Guid>( |
|
||||
name: "TenantId", |
|
||||
table: "AbpPermissionGrants", |
|
||||
nullable: true); |
|
||||
} |
|
||||
|
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
|
||||
{ |
|
||||
migrationBuilder.DropColumn( |
|
||||
name: "TenantId", |
|
||||
table: "AbpPermissionGrants"); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,112 +0,0 @@ |
|||||
// <auto-generated />
|
|
||||
using AbpDesk.EntityFrameworkCore; |
|
||||
using Microsoft.EntityFrameworkCore; |
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure; |
|
||||
using Microsoft.EntityFrameworkCore.Metadata; |
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
|
||||
using Microsoft.EntityFrameworkCore.Storage; |
|
||||
using Microsoft.EntityFrameworkCore.Storage.Internal; |
|
||||
using System; |
|
||||
|
|
||||
namespace AbpDesk.EntityFrameworkCore.Migrations |
|
||||
{ |
|
||||
[DbContext(typeof(AbpDeskDbContext))] |
|
||||
partial class AbpDeskDbContextModelSnapshot : ModelSnapshot |
|
||||
{ |
|
||||
protected override void BuildModel(ModelBuilder modelBuilder) |
|
||||
{ |
|
||||
#pragma warning disable 612, 618
|
|
||||
modelBuilder |
|
||||
.HasAnnotation("ProductVersion", "2.0.1-rtm-125") |
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); |
|
||||
|
|
||||
modelBuilder.Entity("AbpDesk.Tickets.Ticket", b => |
|
||||
{ |
|
||||
b.Property<int>("Id") |
|
||||
.ValueGeneratedOnAdd(); |
|
||||
|
|
||||
b.Property<string>("Body") |
|
||||
.HasMaxLength(65536); |
|
||||
|
|
||||
b.Property<string>("ConcurrencyStamp") |
|
||||
.IsConcurrencyToken(); |
|
||||
|
|
||||
b.Property<string>("Title") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(256); |
|
||||
|
|
||||
b.HasKey("Id"); |
|
||||
|
|
||||
b.ToTable("DskTickets"); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("Volo.Abp.MultiTenancy.Tenant", b => |
|
||||
{ |
|
||||
b.Property<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd(); |
|
||||
|
|
||||
b.Property<string>("Name") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(64); |
|
||||
|
|
||||
b.HasKey("Id"); |
|
||||
|
|
||||
b.HasIndex("Name") |
|
||||
.IsUnique(); |
|
||||
|
|
||||
b.ToTable("MtTenants"); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("Volo.Abp.MultiTenancy.TenantConnectionString", b => |
|
||||
{ |
|
||||
b.Property<Guid>("TenantId"); |
|
||||
|
|
||||
b.Property<string>("Name") |
|
||||
.HasMaxLength(128); |
|
||||
|
|
||||
b.Property<string>("Value") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(1024); |
|
||||
|
|
||||
b.HasKey("TenantId", "Name"); |
|
||||
|
|
||||
b.ToTable("MtTenantConnectionStrings"); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("Volo.Abp.Permissions.PermissionGrant", b => |
|
||||
{ |
|
||||
b.Property<Guid>("Id") |
|
||||
.ValueGeneratedOnAdd(); |
|
||||
|
|
||||
b.Property<string>("Name") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(128); |
|
||||
|
|
||||
b.Property<string>("ProviderKey") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(64); |
|
||||
|
|
||||
b.Property<string>("ProviderName") |
|
||||
.IsRequired() |
|
||||
.HasMaxLength(64); |
|
||||
|
|
||||
b.Property<Guid?>("TenantId"); |
|
||||
|
|
||||
b.HasKey("Id"); |
|
||||
|
|
||||
b.HasIndex("Name", "ProviderName", "ProviderKey"); |
|
||||
|
|
||||
b.ToTable("AbpPermissionGrants"); |
|
||||
}); |
|
||||
|
|
||||
modelBuilder.Entity("Volo.Abp.MultiTenancy.TenantConnectionString", b => |
|
||||
{ |
|
||||
b.HasOne("Volo.Abp.MultiTenancy.Tenant") |
|
||||
.WithMany("ConnectionStrings") |
|
||||
.HasForeignKey("TenantId") |
|
||||
.OnDelete(DeleteBehavior.Cascade); |
|
||||
}); |
|
||||
#pragma warning restore 612, 618
|
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,18 +0,0 @@ |
|||||
using System.Reflection; |
|
||||
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")] |
|
||||
@ -1,32 +0,0 @@ |
|||||
<Project Sdk="Microsoft.NET.Sdk"> |
|
||||
|
|
||||
<PropertyGroup> |
|
||||
<TargetFramework>netstandard2.0</TargetFramework> |
|
||||
<AssemblyName>AbpDesk.MongoBlog</AssemblyName> |
|
||||
<PackageId>AbpDesk.MongoBlog</PackageId> |
|
||||
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> |
|
||||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
|
||||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
|
||||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
|
||||
<RootNamespace /> |
|
||||
</PropertyGroup> |
|
||||
|
|
||||
<ItemGroup> |
|
||||
<EmbeddedResource Include="Areas\Blog\Controllers\PostsController.cs" /> |
|
||||
<EmbeddedResource Include="Areas\Blog\Views\Posts\Index.cshtml" /> |
|
||||
</ItemGroup> |
|
||||
|
|
||||
<ItemGroup> |
|
||||
<EmbeddedResource Include="wwwroot\modules\mongoblog\views\posts\index.scss" /> |
|
||||
</ItemGroup> |
|
||||
|
|
||||
<ItemGroup> |
|
||||
<ProjectReference Include="..\..\Volo.Abp.MongoDB\Volo.Abp.MongoDB.csproj" /> |
|
||||
<ProjectReference Include="..\..\Volo.Abp.AspNetCore.Mvc\Volo.Abp.AspNetCore.Mvc.csproj" /> |
|
||||
</ItemGroup> |
|
||||
|
|
||||
<Target Name="PostcompileScript" AfterTargets="Build"> |
|
||||
<Exec Command="xcopy /y $(TargetDir)AbpDesk.MongoBlog.dll ..\Web_PlugIns\" /> |
|
||||
</Target> |
|
||||
|
|
||||
</Project> |
|
||||
@ -1,91 +0,0 @@ |
|||||
using System; |
|
||||
using System.Linq; |
|
||||
using Microsoft.Extensions.DependencyInjection; |
|
||||
using Microsoft.Extensions.Logging; |
|
||||
using Volo.Abp; |
|
||||
using Volo.Abp.AspNetCore.Mvc; |
|
||||
using Volo.Abp.Domain.Repositories; |
|
||||
using Volo.Abp.Guids; |
|
||||
using Volo.Abp.Modularity; |
|
||||
using Volo.Abp.MongoDB; |
|
||||
using Volo.Abp.Uow; |
|
||||
using Volo.Abp.VirtualFileSystem; |
|
||||
|
|
||||
namespace AbpDesk.Blogging |
|
||||
{ |
|
||||
//TODO: Make this a plugin
|
|
||||
[DependsOn(typeof(AbpMongoDbModule), typeof(AbpAspNetCoreMvcModule))] |
|
||||
public class AbpDeskMongoBlogModule : AbpModule |
|
||||
{ |
|
||||
public override void ConfigureServices(IServiceCollection services) |
|
||||
{ |
|
||||
services.AddMongoDbContext<AbpDeskMongoDbContext>(options => |
|
||||
{ |
|
||||
options.AddDefaultRepositories(); |
|
||||
}); |
|
||||
|
|
||||
services.Configure<VirtualFileSystemOptions>(options => |
|
||||
{ |
|
||||
options.FileSets.AddEmbedded<AbpDeskMongoBlogModule>(); //TODO: Test empty base namespace!
|
|
||||
}); |
|
||||
|
|
||||
services.AddAssemblyOf<AbpDeskMongoBlogModule>(); |
|
||||
} |
|
||||
|
|
||||
public override void OnApplicationInitialization(ApplicationInitializationContext context) |
|
||||
{ |
|
||||
CreateSeedData(context); |
|
||||
} |
|
||||
|
|
||||
private static void CreateSeedData(ApplicationInitializationContext context) |
|
||||
{ |
|
||||
using (var scope = context.ServiceProvider.CreateScope()) |
|
||||
{ |
|
||||
var logger = context.ServiceProvider.GetRequiredService<ILogger<AbpDeskMongoBlogModule>>(); |
|
||||
|
|
||||
logger.LogInformation("Running seed data for mongo blog module..."); |
|
||||
|
|
||||
using (var uow = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>().Begin()) |
|
||||
{ |
|
||||
var blogPostRepository = scope.ServiceProvider.GetRequiredService<IRepository<BlogPost, Guid>>(); |
|
||||
if (blogPostRepository.Any()) |
|
||||
{ |
|
||||
logger.LogInformation($"No need to seed database since there are already {blogPostRepository.Count()} blog posts!"); |
|
||||
return; |
|
||||
} |
|
||||
|
|
||||
var guidGenerator = scope.ServiceProvider.GetRequiredService<IGuidGenerator>(); |
|
||||
|
|
||||
blogPostRepository.Insert( |
|
||||
new BlogPost( |
|
||||
guidGenerator.Create(), |
|
||||
"Demo blog post title one!", |
|
||||
"Sample body text for the first blog post" |
|
||||
) |
|
||||
); |
|
||||
|
|
||||
blogPostRepository.Insert( |
|
||||
new BlogPost( |
|
||||
guidGenerator.Create(), |
|
||||
"Demo blog post title second!", |
|
||||
"Sample body text for the second blog post" |
|
||||
) |
|
||||
{ |
|
||||
Comments = |
|
||||
{ |
|
||||
new BlogPostComment("John", "Hi, this is a good post! Thank you :)"), |
|
||||
new BlogPostComment("Adam", "You are adam! :s") |
|
||||
} |
|
||||
} |
|
||||
); |
|
||||
|
|
||||
logger.LogInformation("Inserted two blog post. completing the unit of work..."); |
|
||||
|
|
||||
uow.Complete(); |
|
||||
|
|
||||
logger.LogInformation("Completed!"); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,21 +0,0 @@ |
|||||
using System.Collections.Generic; |
|
||||
using Volo.Abp.Data; |
|
||||
using Volo.Abp.MongoDB; |
|
||||
|
|
||||
namespace AbpDesk.Blogging |
|
||||
{ |
|
||||
[ConnectionStringName(ConnectionStringName)] |
|
||||
public class AbpDeskMongoDbContext : AbpMongoDbContext |
|
||||
{ |
|
||||
public const string ConnectionStringName = "AbpDeskMongoBlog"; |
|
||||
|
|
||||
private static readonly MongoEntityMapping[] EntityCollectionTypes = { |
|
||||
new MongoEntityMapping(typeof(BlogPost), "BlogPosts") |
|
||||
}; |
|
||||
|
|
||||
public override IReadOnlyList<MongoEntityMapping> GetMappings() |
|
||||
{ |
|
||||
return EntityCollectionTypes; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,46 +0,0 @@ |
|||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using JetBrains.Annotations; |
|
||||
using Volo.Abp; |
|
||||
using Volo.Abp.Domain.Entities; |
|
||||
|
|
||||
namespace AbpDesk.Blogging |
|
||||
{ |
|
||||
public class BlogPost : AggregateRoot<Guid> |
|
||||
{ |
|
||||
public virtual string Title { get; protected set; } |
|
||||
|
|
||||
public virtual string Body { get; protected set; } |
|
||||
|
|
||||
public virtual ICollection<BlogPostComment> Comments { get; protected set; } |
|
||||
|
|
||||
protected BlogPost() |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public BlogPost(Guid id, [NotNull] string title, [NotNull] string body) |
|
||||
{ |
|
||||
Check.NotNull(title, nameof(title)); |
|
||||
Check.NotNull(body, nameof(body)); |
|
||||
|
|
||||
Id = id; |
|
||||
Title = title; |
|
||||
Body = body; |
|
||||
|
|
||||
Comments = new List<BlogPostComment>(); |
|
||||
} |
|
||||
|
|
||||
public void SetTitle([NotNull] string title) |
|
||||
{ |
|
||||
Check.NotNull(title, nameof(title)); |
|
||||
|
|
||||
Title = title; |
|
||||
} |
|
||||
|
|
||||
public override string ToString() |
|
||||
{ |
|
||||
return $"{base.ToString()}, Title = {Title}, Body = {Body.TruncateWithPostfix(32)}"; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,42 +0,0 @@ |
|||||
using System; |
|
||||
using JetBrains.Annotations; |
|
||||
using Volo.Abp.Domain.Entities; |
|
||||
|
|
||||
namespace AbpDesk.Blogging |
|
||||
{ |
|
||||
public class BlogPostComment : Entity<Guid> |
|
||||
{ |
|
||||
[NotNull] |
|
||||
public virtual string Name { get; protected set; } |
|
||||
|
|
||||
[CanBeNull] |
|
||||
public virtual string Email { get; protected set; } |
|
||||
|
|
||||
public virtual byte? Star { get; protected set; } |
|
||||
|
|
||||
[NotNull] |
|
||||
public virtual string Message { get; protected set; } |
|
||||
|
|
||||
protected BlogPostComment() |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
|
|
||||
public BlogPostComment(string name, string message, string email = null, byte? star = null) |
|
||||
{ |
|
||||
Name = name; |
|
||||
Email = email; |
|
||||
Message = message; |
|
||||
Star = star; |
|
||||
} |
|
||||
|
|
||||
public override string ToString() |
|
||||
{ |
|
||||
return $"{base.ToString()}, " + |
|
||||
$"Name = {Name}, " + |
|
||||
$"Email = {Email}, " + |
|
||||
$"Message = {Message}, " + |
|
||||
$"Star = {(Star.HasValue ? Star.Value.ToString() : "none")}"; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,26 +0,0 @@ |
|||||
using System; |
|
||||
using System.Linq; |
|
||||
using AbpDesk.Blogging; |
|
||||
using Microsoft.AspNetCore.Mvc; |
|
||||
using Volo.Abp.AspNetCore.Mvc; |
|
||||
using Volo.Abp.Domain.Repositories; |
|
||||
|
|
||||
namespace Areas.Blog.Controllers |
|
||||
{ |
|
||||
[Area("Blog")] |
|
||||
public class PostsController : AbpController |
|
||||
{ |
|
||||
private readonly IRepository<BlogPost, Guid> _blogPostRepository; |
|
||||
|
|
||||
public PostsController(IRepository<BlogPost, Guid> blogPostRepository) |
|
||||
{ |
|
||||
_blogPostRepository = blogPostRepository; |
|
||||
} |
|
||||
|
|
||||
public ActionResult Index() |
|
||||
{ |
|
||||
var posts = _blogPostRepository.ToList(); //TODO: async..?
|
|
||||
return View(posts); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,29 +0,0 @@ |
|||||
@model List<AbpDesk.Blogging.BlogPost> |
|
||||
|
|
||||
<h2>Blog Posts</h2> |
|
||||
|
|
||||
@section styles { |
|
||||
<link rel="stylesheet" type="text/css" href="~/modules/mongoblog/views/posts/Index.css" /> |
|
||||
} |
|
||||
|
|
||||
<ul class="blog-post-list"> |
|
||||
@foreach (var post in Model) |
|
||||
{ |
|
||||
<h3>@post.Title</h3> |
|
||||
<p>@post.Body</p> |
|
||||
if (!post.Comments.Any()) |
|
||||
{ |
|
||||
<p><em>No comment yet!</em></p> |
|
||||
} |
|
||||
else |
|
||||
{ |
|
||||
<div class="post-comments"> |
|
||||
<h5>Comments</h5> |
|
||||
@foreach (var comment in post.Comments) |
|
||||
{ |
|
||||
<p class="post-comment"><strong>@comment.Name</strong>: @comment.Message</p> |
|
||||
} |
|
||||
</div> |
|
||||
} |
|
||||
} |
|
||||
</ul> |
|
||||
@ -1,18 +0,0 @@ |
|||||
using System.Reflection; |
|
||||
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.MongoBlog")] |
|
||||
[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("63244dc7-34be-44e1-bf6f-f2672e59af36")] |
|
||||
@ -1,19 +0,0 @@ |
|||||
{ |
|
||||
"iisSettings": { |
|
||||
"windowsAuthentication": false, |
|
||||
"anonymousAuthentication": true, |
|
||||
"iisExpress": { |
|
||||
"applicationUrl": "http://localhost:54356/", |
|
||||
"sslPort": 0 |
|
||||
} |
|
||||
}, |
|
||||
"profiles": { |
|
||||
"IIS Express": { |
|
||||
"commandName": "IISExpress", |
|
||||
"launchBrowser": true, |
|
||||
"environmentVariables": { |
|
||||
"ASPNETCORE_ENVIRONMENT": "Development" |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,6 +0,0 @@ |
|||||
[ |
|
||||
{ |
|
||||
"outputFile": "wwwroot/modules/mongoblog/views/posts/index.css", |
|
||||
"inputFile": "wwwroot/modules/mongoblog/views/posts/index.scss" |
|
||||
} |
|
||||
] |
|
||||
@ -1,49 +0,0 @@ |
|||||
{ |
|
||||
"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 |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,7 +0,0 @@ |
|||||
.blog-post-list .post-comments { |
|
||||
margin-left: 10px; |
|
||||
border-left: 5px solid #ddd; |
|
||||
padding-left: 10px; } |
|
||||
.blog-post-list .post-comments .post-comment { |
|
||||
margin-bottom: 0.2em; } |
|
||||
|
|
||||
@ -1 +0,0 @@ |
|||||
.blog-post-list .post-comments{margin-left:10px;border-left:5px solid #ddd;padding-left:10px;}.blog-post-list .post-comments .post-comment{margin-bottom:.2em;} |
|
||||
@ -1,11 +0,0 @@ |
|||||
.blog-post-list { |
|
||||
.post-comments { |
|
||||
margin-left: 10px; |
|
||||
border-left: 5px solid #ddd; |
|
||||
padding-left: 10px; |
|
||||
|
|
||||
.post-comment { |
|
||||
margin-bottom: 0.2em; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,18 +0,0 @@ |
|||||
<Project Sdk="Microsoft.NET.Sdk"> |
|
||||
|
|
||||
<PropertyGroup> |
|
||||
<TargetFramework>netstandard2.0</TargetFramework> |
|
||||
<AssemblyName>AbpDesk.SamplePlugInModule</AssemblyName> |
|
||||
<PackageId>AbpDesk.SamplePlugInModule</PackageId> |
|
||||
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> |
|
||||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
|
||||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
|
||||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
|
||||
<RootNamespace>AbpDesk.SamplePlugInModule</RootNamespace> |
|
||||
</PropertyGroup> |
|
||||
|
|
||||
<ItemGroup> |
|
||||
<ProjectReference Include="..\..\Volo.Abp.Core\Volo.Abp.Core.csproj" /> |
|
||||
</ItemGroup> |
|
||||
|
|
||||
</Project> |
|
||||
@ -1,13 +0,0 @@ |
|||||
using Microsoft.Extensions.DependencyInjection; |
|
||||
using Volo.Abp.Modularity; |
|
||||
|
|
||||
namespace AbpDesk.SamplePlugInModule |
|
||||
{ |
|
||||
public class AbpDeskSamplePlugInModule : AbpModule |
|
||||
{ |
|
||||
public override void ConfigureServices(IServiceCollection services) |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,18 +0,0 @@ |
|||||
using System.Reflection; |
|
||||
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.SamplePlugInModule")] |
|
||||
[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("adfaf85b-b785-41ea-b57d-422775989fa6")] |
|
||||
@ -1,72 +0,0 @@ |
|||||
<Project Sdk="Microsoft.NET.Sdk.Web"> |
|
||||
|
|
||||
<PropertyGroup> |
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework> |
|
||||
<PreserveCompilationContext>true</PreserveCompilationContext> |
|
||||
<AssemblyName>AbpDesk.Web.Mvc</AssemblyName> |
|
||||
<OutputType>Exe</OutputType> |
|
||||
<PackageId>AbpDesk.Web.Mvc</PackageId> |
|
||||
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> |
|
||||
<RootNamespace>AbpDesk.Web.Mvc</RootNamespace> |
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> |
|
||||
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType> |
|
||||
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles> |
|
||||
</PropertyGroup> |
|
||||
|
|
||||
<ItemGroup> |
|
||||
<Compile Remove="Logs\**" /> |
|
||||
<Content Remove="Logs\**" /> |
|
||||
<EmbeddedResource Remove="Logs\**" /> |
|
||||
<None Remove="Logs\**" /> |
|
||||
</ItemGroup> |
|
||||
|
|
||||
<ItemGroup> |
|
||||
<None Update="wwwroot\**\*;Areas\**\*;Views\**\*;Dockerfile"> |
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> |
|
||||
</None> |
|
||||
</ItemGroup> |
|
||||
|
|
||||
<ItemGroup> |
|
||||
<ProjectReference Include="..\..\Volo.Abp.Account.Web\Volo.Abp.Account.Web.csproj" /> |
|
||||
<ProjectReference Include="..\..\Volo.Abp.AspNetCore.MultiTenancy\Volo.Abp.AspNetCore.MultiTenancy.csproj" /> |
|
||||
<ProjectReference Include="..\..\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" /> |
|
||||
<ProjectReference Include="..\..\Volo.Abp.Identity.Application\Volo.Abp.Identity.Application.csproj" /> |
|
||||
<ProjectReference Include="..\..\Volo.Abp.Identity.EntityFrameworkCore\Volo.Abp.Identity.EntityFrameworkCore.csproj" /> |
|
||||
<ProjectReference Include="..\..\Volo.Abp.IdentityServer.Domain\Volo.Abp.IdentityServer.Domain.csproj" /> |
|
||||
<ProjectReference Include="..\..\Volo.Abp.IdentityServer.EntityFrameworkCore\Volo.Abp.IdentityServer.EntityFrameworkCore.csproj" /> |
|
||||
<ProjectReference Include="..\..\Volo.Abp.MultiTenancy.Application\Volo.Abp.MultiTenancy.Application.csproj" /> |
|
||||
<ProjectReference Include="..\..\Volo.Abp.MultiTenancy.Web\Volo.Abp.MultiTenancy.Web.csproj" /> |
|
||||
<ProjectReference Include="..\..\Volo.Abp.Permissions.Application\Volo.Abp.Permissions.Application.csproj" /> |
|
||||
<ProjectReference Include="..\AbpDesk.Application.Contracts\AbpDesk.Application.Contracts.csproj" /> |
|
||||
<ProjectReference Include="..\..\Volo.Abp.AspNetCore.Mvc\Volo.Abp.AspNetCore.Mvc.csproj" /> |
|
||||
<ProjectReference Include="..\AbpDesk.EntityFrameworkCore\AbpDesk.EntityFrameworkCore.csproj" /> |
|
||||
<ProjectReference Include="..\AbpDesk.Application\AbpDesk.Application.csproj" /> |
|
||||
<ProjectReference Include="..\..\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.csproj" /> |
|
||||
<ProjectReference Include="..\..\Volo.Abp.AspNetCore.EmbeddedFiles\Volo.Abp.AspNetCore.EmbeddedFiles.csproj" /> |
|
||||
<ProjectReference Include="..\..\Volo.Abp.Identity.Web\Volo.Abp.Identity.Web.csproj" /> |
|
||||
<ProjectReference Include="..\..\Volo.Abp.MongoDB\Volo.Abp.MongoDB.csproj" /> |
|
||||
</ItemGroup> |
|
||||
|
|
||||
<ItemGroup> |
|
||||
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="2.3.0" /> |
|
||||
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.0" /> |
|
||||
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="2.0.1" /> |
|
||||
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="2.0.1" /> |
|
||||
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.0.1" /> |
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.0.0" /> |
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.0.0" /> |
|
||||
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.0.1" /> |
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.0.0" /> |
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.0.0" /> |
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.1"> |
|
||||
<PrivateAssets>All</PrivateAssets> |
|
||||
</PackageReference> |
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="2.0.1" /> |
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.2" /> |
|
||||
<PackageReference Include="Serilog.Extensions.Logging" Version="2.0.2" /> |
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="4.0.0" /> |
|
||||
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.1" /> |
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.Facebook" Version="2.0.1" /> |
|
||||
</ItemGroup> |
|
||||
|
|
||||
</Project> |
|
||||
@ -1,208 +0,0 @@ |
|||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
using System.Globalization; |
|
||||
using System.IO; |
|
||||
using AbpDesk.EntityFrameworkCore; |
|
||||
using AbpDesk.Web.Mvc.Navigation; |
|
||||
using AbpDesk.Web.Mvc.Permissions; |
|
||||
using Microsoft.AspNetCore.Builder; |
|
||||
using Microsoft.AspNetCore.Hosting; |
|
||||
using Microsoft.AspNetCore.Localization; |
|
||||
using Microsoft.Extensions.Configuration; |
|
||||
using Microsoft.Extensions.DependencyInjection; |
|
||||
using Volo.Abp; |
|
||||
using Volo.Abp.Account.Web; |
|
||||
using Volo.Abp.AspNetCore.EmbeddedFiles; |
|
||||
using Volo.Abp.AspNetCore.Modularity; |
|
||||
using Volo.Abp.AspNetCore.MultiTenancy; |
|
||||
using Volo.Abp.AspNetCore.Mvc; |
|
||||
using Volo.Abp.AspNetCore.Mvc.Bundling; |
|
||||
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap; |
|
||||
using Volo.Abp.Authorization.Permissions; |
|
||||
using Volo.Abp.Autofac; |
|
||||
using Volo.Abp.Identity; |
|
||||
using Volo.Abp.Identity.EntityFrameworkCore; |
|
||||
using Volo.Abp.Identity.Web; |
|
||||
using Volo.Abp.IdentityServer; |
|
||||
using Volo.Abp.IdentityServer.EntityFrameworkCore; |
|
||||
using Volo.Abp.Modularity; |
|
||||
using Volo.Abp.Ui.Navigation; |
|
||||
using Volo.Abp.VirtualFileSystem; |
|
||||
using Volo.Abp.IdentityServer.Jwt; |
|
||||
using Volo.Abp.MultiTenancy; |
|
||||
using Volo.Abp.MultiTenancy.Web; |
|
||||
using Volo.Abp.Permissions; |
|
||||
using Volo.Abp.Permissions.Web; |
|
||||
|
|
||||
namespace AbpDesk.Web.Mvc |
|
||||
{ |
|
||||
[DependsOn( |
|
||||
typeof(AbpAspNetCoreEmbeddedFilesModule), |
|
||||
typeof(AbpAspNetCoreMvcUiBootstrapModule), |
|
||||
typeof(AbpDeskApplicationModule), |
|
||||
typeof(AbpDeskEntityFrameworkCoreModule), |
|
||||
typeof(AbpIdentityApplicationModule), |
|
||||
typeof(AbpIdentityEntityFrameworkCoreModule), |
|
||||
typeof(AbpIdentityWebModule), |
|
||||
typeof(AbpAccountWebModule), |
|
||||
typeof(AbpAutofacModule), |
|
||||
typeof(AbpIdentityServerDomainModule), |
|
||||
typeof(AbpIdentityServerEntityFrameworkCoreModule), |
|
||||
typeof(AbpAspNetCoreMultiTenancyModule), |
|
||||
typeof(AbpMultiTenancyWebModule), |
|
||||
typeof(AbpMultiTenancyApplicationModule), |
|
||||
typeof(AbpPermissionsApplicationModule) |
|
||||
)] |
|
||||
public class AbpDeskWebMvcModule : AbpModule //TODO: Rename to AbpDeskWebModule, change default namespace to AbpDesk.Web
|
|
||||
{ |
|
||||
public override void PreConfigureServices(IServiceCollection services) |
|
||||
{ |
|
||||
services.PreConfigure<IMvcBuilder>(builder => |
|
||||
{ |
|
||||
builder |
|
||||
.AddRazorPagesOptions(options => |
|
||||
{ |
|
||||
options.Conventions.AuthorizeFolder("/App"); |
|
||||
}); |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
public override void ConfigureServices(IServiceCollection services) |
|
||||
{ |
|
||||
var hostingEnvironment = services.GetSingletonInstance<IHostingEnvironment>(); |
|
||||
var configuration = BuildConfiguration(hostingEnvironment); |
|
||||
|
|
||||
AbpDeskDbConfigurer.Configure(services, configuration); |
|
||||
|
|
||||
services.Configure<NavigationOptions>(options => |
|
||||
{ |
|
||||
options.MenuContributors.Add(new MainMenuContributor()); |
|
||||
}); |
|
||||
|
|
||||
services.Configure<PermissionOptions>(options => |
|
||||
{ |
|
||||
options.DefinitionProviders.Add<AbpDeskPermissionDefinitionProvider>(); |
|
||||
}); |
|
||||
|
|
||||
//services.Configure<RemoteServiceOptions>(configuration); //Needed when we use Volo.Abp.Identity.HttpApi.Client
|
|
||||
|
|
||||
var authentication = services.AddAuthentication(); |
|
||||
|
|
||||
services.AddAuthorization(options => |
|
||||
{ |
|
||||
options.AddPolicy("RequirePhoneNumber", policy => |
|
||||
{ |
|
||||
policy.RequireClaim("phone_number"); |
|
||||
}); |
|
||||
}); |
|
||||
|
|
||||
authentication.AddIdentityServerAuthentication("Bearer", options => |
|
||||
{ |
|
||||
options.Authority = "http://localhost:59980"; |
|
||||
options.RequireHttpsMetadata = false; |
|
||||
|
|
||||
options.ApiName = "api1"; |
|
||||
}); |
|
||||
|
|
||||
////Adding Facebook authentication (TODO: Move to Account module as much as possible)
|
|
||||
//if (bool.Parse(configuration["Authentication:Facebook:IsEnabled"]))
|
|
||||
//{
|
|
||||
// authentication.AddFacebook(options =>
|
|
||||
// {
|
|
||||
// options.AppId = configuration["Authentication:Facebook:AppId"];
|
|
||||
// options.AppSecret = configuration["Authentication:Facebook:AppSecret"];
|
|
||||
|
|
||||
// options.Scope.Add("email");
|
|
||||
// options.Scope.Add("public_profile");
|
|
||||
// });
|
|
||||
//}
|
|
||||
|
|
||||
services.AddAssemblyOf<AbpDeskWebMvcModule>(); |
|
||||
|
|
||||
services.Configure<BundlingOptions>(options => |
|
||||
{ |
|
||||
//TODO: To the framework!
|
|
||||
options.ScriptBundles.Add("GlobalScripts", new[] |
|
||||
{ |
|
||||
"/Abp/ApplicationConfigurationScript?_v=" + DateTime.Now.Ticks, |
|
||||
"/Abp/ServiceProxyScript?_v=" + DateTime.Now.Ticks |
|
||||
}); |
|
||||
}); |
|
||||
|
|
||||
services.Configure<AbpAspNetCoreMvcOptions>(options => |
|
||||
{ |
|
||||
options.ConventionalControllers.Create(typeof(AbpDeskApplicationModule).Assembly); |
|
||||
}); |
|
||||
|
|
||||
if (hostingEnvironment.IsDevelopment()) |
|
||||
{ |
|
||||
services.Configure<VirtualFileSystemOptions>(options => |
|
||||
{ |
|
||||
options.FileSets.ReplaceEmbeddedByPyhsical<AbpAspNetCoreMvcUiModule>(Path.Combine(hostingEnvironment.ContentRootPath, "..\\..\\Volo.Abp.AspNetCore.Mvc.UI")); |
|
||||
options.FileSets.ReplaceEmbeddedByPyhsical<AbpAspNetCoreMvcUiBootstrapModule>(Path.Combine(hostingEnvironment.ContentRootPath, "..\\..\\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap")); |
|
||||
options.FileSets.ReplaceEmbeddedByPyhsical<AbpAccountWebModule>(Path.Combine(hostingEnvironment.ContentRootPath, "..\\..\\Volo.Abp.Account.Web")); |
|
||||
options.FileSets.ReplaceEmbeddedByPyhsical<AbpIdentityWebModule>(Path.Combine(hostingEnvironment.ContentRootPath, "..\\..\\Volo.Abp.Identity.Web")); |
|
||||
options.FileSets.ReplaceEmbeddedByPyhsical<AbpMultiTenancyWebModule>(Path.Combine(hostingEnvironment.ContentRootPath, "..\\..\\Volo.Abp.MultiTenancy.Web")); |
|
||||
options.FileSets.ReplaceEmbeddedByPyhsical<AbpPermissionsWebModule>(Path.Combine(hostingEnvironment.ContentRootPath, "..\\..\\Volo.Abp.Permissions.Web")); |
|
||||
}); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public override void OnApplicationInitialization(ApplicationInitializationContext context) |
|
||||
{ |
|
||||
var app = context.GetApplicationBuilder(); |
|
||||
|
|
||||
if (context.GetEnvironment().IsDevelopment()) |
|
||||
{ |
|
||||
app.UseDeveloperExceptionPage(); |
|
||||
} |
|
||||
|
|
||||
app.UseStaticFiles(); |
|
||||
app.UseVirtualFiles(); |
|
||||
|
|
||||
app.UseMultiTenancy(); |
|
||||
|
|
||||
app.UseIdentityServer(); |
|
||||
|
|
||||
app.UseAuthentication(); |
|
||||
|
|
||||
app.UseJwtTokenMiddleware("Bearer"); //TODO: It would be better without that, however it requires to use Bearer as default auth schema.
|
|
||||
|
|
||||
var cultures = new List<CultureInfo> |
|
||||
{ |
|
||||
new CultureInfo("en"), |
|
||||
new CultureInfo("tr") |
|
||||
}; |
|
||||
|
|
||||
//TODO: Should we add this to the framework, or left it to the application?
|
|
||||
//TODO: Should we add this as the first middleware (to support localization in all middlewares too)?
|
|
||||
app.UseRequestLocalization(new RequestLocalizationOptions |
|
||||
{ |
|
||||
DefaultRequestCulture = new RequestCulture("en"), |
|
||||
SupportedCultures = cultures, |
|
||||
SupportedUICultures = cultures |
|
||||
}); |
|
||||
|
|
||||
app.UseMvc(routes => |
|
||||
{ |
|
||||
routes.MapRoute( |
|
||||
name: "defaultWithArea", |
|
||||
template: "{area}/{controller=Home}/{action=Index}/{id?}"); |
|
||||
|
|
||||
routes.MapRoute( |
|
||||
name: "default", |
|
||||
template: "{controller=Home}/{action=Index}/{id?}"); |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
private static IConfigurationRoot BuildConfiguration(IHostingEnvironment env) |
|
||||
{ |
|
||||
var builder = new ConfigurationBuilder() |
|
||||
.SetBasePath(env.ContentRootPath) |
|
||||
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) |
|
||||
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); |
|
||||
|
|
||||
return builder.Build(); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,4 +0,0 @@ |
|||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers |
|
||||
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI |
|
||||
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap |
|
||||
@addTagHelper *, AbpDesk.Web.Mvc |
|
||||
@ -1,3 +0,0 @@ |
|||||
@{ |
|
||||
Layout = "~/Views/Shared/_AppLayout.cshtml"; |
|
||||
} |
|
||||
@ -1,23 +0,0 @@ |
|||||
using System.Linq; |
|
||||
using Microsoft.AspNetCore.Authorization; |
|
||||
using Microsoft.AspNetCore.Mvc; |
|
||||
using Volo.Abp.AspNetCore.Mvc; |
|
||||
|
|
||||
namespace AbpDesk.Web.Mvc.Controllers |
|
||||
{ |
|
||||
public class AuthTestController : AbpController |
|
||||
{ |
|
||||
private readonly IAuthorizationService _authorizationService; |
|
||||
|
|
||||
public AuthTestController(IAuthorizationService authorizationService) |
|
||||
{ |
|
||||
_authorizationService = authorizationService; |
|
||||
} |
|
||||
|
|
||||
[Authorize(Policy = "RequirePhoneNumber")] |
|
||||
public ContentResult PhoneNumberIsRequired() |
|
||||
{ |
|
||||
return Content("OK: " + User.Claims.First(c => c.Type == "phone_number")?.Value); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,59 +0,0 @@ |
|||||
using System.Threading.Tasks; |
|
||||
using IdentityServer4.Models; |
|
||||
using IdentityServer4.Stores; |
|
||||
using Microsoft.AspNetCore.Mvc; |
|
||||
using Volo.Abp.AspNetCore.Mvc; |
|
||||
using Volo.Abp.IdentityServer.ApiResources; |
|
||||
using Volo.Abp.IdentityServer.Clients; |
|
||||
using ApiResource = Volo.Abp.IdentityServer.ApiResources.ApiResource; |
|
||||
using Client = Volo.Abp.IdentityServer.Clients.Client; |
|
||||
|
|
||||
namespace AbpDesk.Web.Mvc.Controllers |
|
||||
{ |
|
||||
[Route("identity-server-test")] |
|
||||
public class IdentityServerTestController : AbpController |
|
||||
{ |
|
||||
private readonly IClientRepository _clientRepository; |
|
||||
private readonly IApiResourceRepository _apiResourceRepository; |
|
||||
private readonly IResourceStore _resourceStore; |
|
||||
|
|
||||
public IdentityServerTestController( |
|
||||
IClientRepository clientRepository, |
|
||||
IApiResourceRepository apiResourceRepository, |
|
||||
IResourceStore resourceStore) |
|
||||
{ |
|
||||
_clientRepository = clientRepository; |
|
||||
_apiResourceRepository = apiResourceRepository; |
|
||||
_resourceStore = resourceStore; |
|
||||
} |
|
||||
|
|
||||
[HttpGet] |
|
||||
public async Task<IActionResult> Get() |
|
||||
{ |
|
||||
return Content("Resources: " + (await _resourceStore.FindApiResourceAsync("api1")).Name); |
|
||||
} |
|
||||
|
|
||||
[HttpGet] |
|
||||
[Route("create")] |
|
||||
public async Task<IActionResult> CreateClient(string clientId) |
|
||||
{ |
|
||||
var apiResource = await _apiResourceRepository.FindByNameAsync("api1"); |
|
||||
|
|
||||
if (apiResource == null) |
|
||||
{ |
|
||||
apiResource = new ApiResource(GuidGenerator.Create(), "api1"); |
|
||||
await _apiResourceRepository.InsertAsync(apiResource); |
|
||||
} |
|
||||
|
|
||||
var client = new Client(GuidGenerator.Create(), clientId); |
|
||||
|
|
||||
client.AddGrantTypes(GrantTypes.ClientCredentials); |
|
||||
client.AddSecret("secret".Sha256()); |
|
||||
client.AddScope("api1"); |
|
||||
|
|
||||
await _clientRepository.InsertAsync(client); |
|
||||
|
|
||||
return Content("OK: " + client.Id); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,18 +0,0 @@ |
|||||
using System.Linq; |
|
||||
using Microsoft.AspNetCore.Authorization; |
|
||||
using Microsoft.AspNetCore.Mvc; |
|
||||
using Volo.Abp.AspNetCore.Mvc; |
|
||||
|
|
||||
namespace AbpDesk.Web.Mvc.Controllers |
|
||||
{ |
|
||||
[Route("identity-test")] |
|
||||
[Authorize] |
|
||||
public class IdentityTestController : AbpController |
|
||||
{ |
|
||||
[HttpGet] |
|
||||
public IActionResult Get() |
|
||||
{ |
|
||||
return new JsonResult(from c in User.Claims select new { c.Type, c.Value }); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,66 +0,0 @@ |
|||||
using System; |
|
||||
using System.Threading.Tasks; |
|
||||
using Microsoft.AspNetCore.Http; |
|
||||
using Microsoft.AspNetCore.Mvc; |
|
||||
using Microsoft.Extensions.Options; |
|
||||
using Volo.Abp.AspNetCore.MultiTenancy; |
|
||||
using Volo.Abp.AspNetCore.Mvc; |
|
||||
using Volo.Abp.MultiTenancy; |
|
||||
using Volo.Abp.Ui; |
|
||||
|
|
||||
namespace AbpDesk.Web.Mvc.Controllers |
|
||||
{ |
|
||||
/* TODO: This is temporary solution to switch tenant. |
|
||||
*/ |
|
||||
|
|
||||
public class MultiTenancyController : AbpController |
|
||||
{ |
|
||||
private readonly ITenantStore _tenantStore; |
|
||||
private readonly AspNetCoreMultiTenancyOptions _options; |
|
||||
|
|
||||
public MultiTenancyController(ITenantStore tenantStore, IOptions<AspNetCoreMultiTenancyOptions> options) |
|
||||
{ |
|
||||
_tenantStore = tenantStore; |
|
||||
_options = options.Value; |
|
||||
} |
|
||||
|
|
||||
public async Task<ActionResult> SwitchTenant(string tenant = "") |
|
||||
{ |
|
||||
if (tenant.IsNullOrEmpty()) |
|
||||
{ |
|
||||
HttpContext.Response.Cookies.Delete(_options.TenantKey); |
|
||||
} |
|
||||
else |
|
||||
{ |
|
||||
var tenantInfo = await FindTenantAsync(tenant); |
|
||||
if (tenantInfo == null) |
|
||||
{ |
|
||||
throw new UserFriendlyException("Unknown tenant: " + tenant); |
|
||||
} |
|
||||
|
|
||||
HttpContext.Response.Cookies.Append( |
|
||||
_options.TenantKey, |
|
||||
tenantInfo.Id.ToString(), |
|
||||
new CookieOptions |
|
||||
{ |
|
||||
Expires = DateTimeOffset.Now.AddYears(1) |
|
||||
} |
|
||||
); |
|
||||
} |
|
||||
|
|
||||
return Redirect("/"); |
|
||||
} |
|
||||
|
|
||||
private async Task<TenantInfo> FindTenantAsync(string tenantIdOrName) |
|
||||
{ |
|
||||
if (Guid.TryParse(tenantIdOrName, out var parsedTenantId)) |
|
||||
{ |
|
||||
return await _tenantStore.FindAsync(parsedTenantId); |
|
||||
} |
|
||||
else |
|
||||
{ |
|
||||
return await _tenantStore.FindAsync(tenantIdOrName); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,9 +0,0 @@ |
|||||
FROM microsoft/aspnetcore:2.0 |
|
||||
|
|
||||
WORKDIR /app |
|
||||
COPY . . |
|
||||
|
|
||||
RUN mkdir /Web_PlugIns |
|
||||
RUN mv /app/PlugIns/*.* /Web_PlugIns |
|
||||
|
|
||||
ENTRYPOINT ["dotnet", "AbpDesk.Web.Mvc.dll"] |
|
||||
@ -1,37 +0,0 @@ |
|||||
using System.Threading.Tasks; |
|
||||
using Volo.Abp.Ui.Navigation; |
|
||||
|
|
||||
namespace AbpDesk.Web.Mvc.Navigation |
|
||||
{ |
|
||||
public class MainMenuContributor : IMenuContributor |
|
||||
{ |
|
||||
public Task ConfigureMenuAsync(MenuConfigurationContext context) |
|
||||
{ |
|
||||
if (context.Menu.Name != StandardMenus.Main) |
|
||||
{ |
|
||||
return Task.CompletedTask; |
|
||||
} |
|
||||
|
|
||||
context.Menu.DisplayName = "Main Menu"; |
|
||||
|
|
||||
context.Menu.Items.Insert(0, new ApplicationMenuItem("Home", "Home", url: "/")); |
|
||||
|
|
||||
context.Menu |
|
||||
.AddItem( |
|
||||
new ApplicationMenuItem("TicketManagement", "Ticket Management") |
|
||||
.AddItem( |
|
||||
new ApplicationMenuItem("TicketManagement.Tickets", "Tickets", url: "/App/Tickets") |
|
||||
) |
|
||||
).AddItem( |
|
||||
new ApplicationMenuItem("TodoList", "Todo List", url: "/App/Todo") |
|
||||
); |
|
||||
|
|
||||
//Disabled blog module. This should be inside the module!
|
|
||||
//.AddItem(
|
|
||||
// new ApplicationMenuItem("Blog", "Blog", url: "/Blog/Posts")
|
|
||||
//);
|
|
||||
|
|
||||
return Task.CompletedTask; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,37 +0,0 @@ |
|||||
@page |
|
||||
@using AbpDesk.Web.Mvc.Pages.App.Tickets |
|
||||
@using Volo.Abp.Users |
|
||||
@model AbpDesk.Web.Mvc.Pages.App.Tickets.IndexModel |
|
||||
@inject ICurrentUser CurrentUser; |
|
||||
|
|
||||
@section styles |
|
||||
{ |
|
||||
<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> |
|
||||
|
|
||||
<p> |
|
||||
Roles: @CurrentUser.Roles.JoinAsString(", ") <br /> |
|
||||
IsInRole Supporter: @User.IsInRole("Supporter") <br /> |
|
||||
IsInRole Supporter: @CurrentUser.IsInRole("Supporter") |
|
||||
</p> |
|
||||
|
|
||||
<h4>Claims</h4> |
|
||||
|
|
||||
<ul> |
|
||||
@foreach (var claim in User.Claims) |
|
||||
{ |
|
||||
<li>@claim.Type : @claim.Value</li> |
|
||||
} |
|
||||
</ul> |
|
||||
@ -1,26 +0,0 @@ |
|||||
using System.Collections.Generic; |
|
||||
using System.Threading.Tasks; |
|
||||
using AbpDesk.Tickets; |
|
||||
using AbpDesk.Tickets.Dtos; |
|
||||
using Volo.Abp.AspNetCore.Mvc.RazorPages; |
|
||||
|
|
||||
namespace AbpDesk.Web.Mvc.Pages.App.Tickets |
|
||||
{ |
|
||||
public class IndexModel : AbpPageModel |
|
||||
{ |
|
||||
public IReadOnlyList<TicketDto> Tickets { get; set; } |
|
||||
|
|
||||
private readonly ITicketAppService _ticketAppService; |
|
||||
|
|
||||
public IndexModel(ITicketAppService ticketAppService) |
|
||||
{ |
|
||||
_ticketAppService = ticketAppService; |
|
||||
} |
|
||||
|
|
||||
public async Task OnGetAsync(GetAllTicketsInput input) |
|
||||
{ |
|
||||
var result = await _ticketAppService.GetAll(input); |
|
||||
Tickets = result.Items; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,16 +0,0 @@ |
|||||
@page |
|
||||
@using AbpDesk.Web.Mvc.Pages.App.Todo |
|
||||
@model IndexModel |
|
||||
<h2>TODO application!</h2> |
|
||||
|
|
||||
<div id="TodoApp"> |
|
||||
<ol> |
|
||||
<li v-for="todo in todos"> |
|
||||
{{ todo.text }} |
|
||||
</li> |
|
||||
</ol> |
|
||||
</div> |
|
||||
|
|
||||
@section scripts { |
|
||||
<script src="~/pages/app/todo/index.js"></script> |
|
||||
} |
|
||||
@ -1,12 +0,0 @@ |
|||||
using Volo.Abp.AspNetCore.Mvc.RazorPages; |
|
||||
|
|
||||
namespace AbpDesk.Web.Mvc.Pages.App.Todo |
|
||||
{ |
|
||||
public class IndexModel : AbpPageModel |
|
||||
{ |
|
||||
public void OnGet() |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,3 +0,0 @@ |
|||||
@page |
|
||||
@model AbpDesk.Web.Mvc.Pages.IndexModel |
|
||||
<h2>Home page!</h2> |
|
||||
@ -1,12 +0,0 @@ |
|||||
using Volo.Abp.AspNetCore.Mvc.RazorPages; |
|
||||
|
|
||||
namespace AbpDesk.Web.Mvc.Pages |
|
||||
{ |
|
||||
public class IndexModel : AbpPageModel |
|
||||
{ |
|
||||
public void OnGet() |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,4 +0,0 @@ |
|||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers |
|
||||
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI |
|
||||
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap |
|
||||
@addTagHelper *, AbpDesk.Web.Mvc |
|
||||
@ -1,4 +0,0 @@ |
|||||
@{ |
|
||||
//TODO: Move this to ~/Pages/Abp/_AppLayout.cshtml..? |
|
||||
Layout = "~/Views/Shared/_AppLayout.cshtml"; |
|
||||
} |
|
||||
@ -1,20 +0,0 @@ |
|||||
using Volo.Abp.Authorization.Permissions; |
|
||||
|
|
||||
namespace AbpDesk.Web.Mvc.Permissions |
|
||||
{ |
|
||||
public class AbpDeskPermissionDefinitionProvider : PermissionDefinitionProvider |
|
||||
{ |
|
||||
public override void Define(IPermissionDefinitionContext context) |
|
||||
{ |
|
||||
var abpDeskGroup = context.AddGroup("AbpDesk"); |
|
||||
|
|
||||
var tickets = abpDeskGroup.AddPermission("AbpDesk.Tickets"); |
|
||||
tickets.AddChild("AbpDesk.Tickets.Reply"); |
|
||||
tickets.AddChild("AbpDesk.Tickets.Close"); |
|
||||
|
|
||||
var customers = abpDeskGroup.AddPermission("AbpDesk.Customers"); |
|
||||
customers.AddChild("AbpDesk.Customers.Create"); |
|
||||
customers.AddChild("AbpDesk.Customers.Delete"); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,20 +0,0 @@ |
|||||
using System.IO; |
|
||||
using Microsoft.AspNetCore.Hosting; |
|
||||
|
|
||||
namespace AbpDesk.Web.Mvc |
|
||||
{ |
|
||||
public class Program |
|
||||
{ |
|
||||
public static void Main(string[] args) |
|
||||
{ |
|
||||
var host = new WebHostBuilder() |
|
||||
.UseKestrel() |
|
||||
.UseContentRoot(Directory.GetCurrentDirectory()) |
|
||||
.UseIISIntegration() |
|
||||
.UseStartup<Startup>() |
|
||||
.Build(); |
|
||||
|
|
||||
host.Run(); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,27 +0,0 @@ |
|||||
{ |
|
||||
"iisSettings": { |
|
||||
"windowsAuthentication": false, |
|
||||
"anonymousAuthentication": true, |
|
||||
"iisExpress": { |
|
||||
"applicationUrl": "http://localhost:59980/", |
|
||||
"sslPort": 0 |
|
||||
} |
|
||||
}, |
|
||||
"profiles": { |
|
||||
"IIS Express": { |
|
||||
"commandName": "IISExpress", |
|
||||
"launchBrowser": true, |
|
||||
"environmentVariables": { |
|
||||
"ASPNETCORE_ENVIRONMENT": "Development" |
|
||||
} |
|
||||
}, |
|
||||
"AbpDesk.Web.Mvc": { |
|
||||
"commandName": "Project", |
|
||||
"launchBrowser": true, |
|
||||
"launchUrl": "http://localhost:59980", |
|
||||
"environmentVariables": { |
|
||||
"ASPNETCORE_ENVIRONMENT": "Development" |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,56 +0,0 @@ |
|||||
using System; |
|
||||
using Microsoft.AspNetCore.Builder; |
|
||||
using Microsoft.AspNetCore.Hosting; |
|
||||
using Microsoft.Extensions.DependencyInjection; |
|
||||
using Microsoft.Extensions.Logging; |
|
||||
using Serilog; |
|
||||
using Volo.Abp; |
|
||||
|
|
||||
namespace AbpDesk.Web.Mvc |
|
||||
{ |
|
||||
public class Startup |
|
||||
{ |
|
||||
private readonly IHostingEnvironment _env; |
|
||||
|
|
||||
public Startup(IHostingEnvironment env) |
|
||||
{ |
|
||||
_env = env; |
|
||||
} |
|
||||
|
|
||||
public IServiceProvider ConfigureServices(IServiceCollection services) |
|
||||
{ |
|
||||
services.AddApplication<AbpDeskWebMvcModule>(options => |
|
||||
{ |
|
||||
options.UseAutofac(); |
|
||||
|
|
||||
/* @halil: I added Abp.MongoDb package as a dependency to the main application in order to use the blog plugin. |
|
||||
* Otherwise, we should add all dependencies (Recursively) into plugin folder |
|
||||
* and load in correct order. We should carefully think on that problem in the future. |
|
||||
* NOTE: Disabled |
|
||||
*/ |
|
||||
//options.PlugInSources.AddFolder(
|
|
||||
// Path.Combine(
|
|
||||
// _env.ContentRootPath,
|
|
||||
// @"../Web_PlugIns/")
|
|
||||
//);
|
|
||||
}); |
|
||||
|
|
||||
//TODO: This is needed because ASP.NET Core does not use IServiceProviderFactory!
|
|
||||
return services.BuildServiceProviderFromFactory(); |
|
||||
} |
|
||||
|
|
||||
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IApplicationLifetime appLifetime) |
|
||||
{ |
|
||||
loggerFactory |
|
||||
.AddConsole() |
|
||||
.AddDebug() |
|
||||
.AddSerilog(new LoggerConfiguration() |
|
||||
.Enrich.FromLogContext() |
|
||||
.WriteTo.File("Logs/logs.txt") |
|
||||
.CreateLogger() |
|
||||
); |
|
||||
|
|
||||
app.InitializeApplication(); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,4 +0,0 @@ |
|||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers |
|
||||
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI |
|
||||
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap |
|
||||
@addTagHelper *, AbpDesk.Web.Mvc |
|
||||
@ -1,3 +0,0 @@ |
|||||
@{ |
|
||||
Layout = "~/Views/Shared/_AppLayout.cshtml"; |
|
||||
} |
|
||||
@ -1,11 +0,0 @@ |
|||||
{ |
|
||||
"ConnectionStrings": { |
|
||||
"Default": "Server=10.0.75.1;Database=AbpDesk;User=sa;Password=123qwe;", |
|
||||
"AbpDeskMongoBlog": "mongodb://outputs_mongodb_1:27017|AbpDeskBlog" |
|
||||
}, |
|
||||
"RemoteServices": { |
|
||||
"AbpIdentity": { |
|
||||
"BaseUrl": "http://outputs_abpidentity_httpapihost_1/" |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,28 +0,0 @@ |
|||||
{ |
|
||||
"ConnectionStrings": { |
|
||||
"Default": "Server=localhost;Database=AbpDesk;Trusted_Connection=True;", |
|
||||
"AbpDeskMongoBlog": "mongodb://127.0.0.1:27017|AbpDeskBlog" |
|
||||
}, |
|
||||
"RemoteServices": { |
|
||||
"AbpIdentity": { |
|
||||
"BaseUrl": "http://localhost:63290/" |
|
||||
} |
|
||||
}, |
|
||||
"Authentication": { |
|
||||
"Facebook": { |
|
||||
"IsEnabled": "true", |
|
||||
"AppId": "911417875702990", |
|
||||
"AppSecret": "adea0bff222ae340d8fb0ce3e6275d6b" |
|
||||
} |
|
||||
}, |
|
||||
"Tenants": [ |
|
||||
{ |
|
||||
"Id": "446a5211-3d72-4339-9adc-845151f8ada0", |
|
||||
"Name": "acme" |
|
||||
}, |
|
||||
{ |
|
||||
"Id": "25388015-ef1c-4355-9c18-f6b6ddbaf89d", |
|
||||
"Name": "volosoft" |
|
||||
} |
|
||||
] |
|
||||
} |
|
||||
@ -1,6 +0,0 @@ |
|||||
[ |
|
||||
{ |
|
||||
"outputFile": "wwwroot/global-styles.css", |
|
||||
"inputFile": "wwwroot/global-styles.scss" |
|
||||
} |
|
||||
] |
|
||||
@ -1,49 +0,0 @@ |
|||||
{ |
|
||||
"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 |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1 +0,0 @@ |
|||||
{"KeyId":"3b003a0fc7d8278f13f59d44f4620374","Parameters":{"D":"Qravv6bNhcfweciZna68hlflA8ygXVgoycYFC/oSG0Ulxr7iN1WtpJEau80OReBKVuRqqvxepzJcNv9CqMGvs9+bDrymk9DDdH46ybFKZB2MaufaBuwbuiJi5qCsGmaDvjzf1dwPyGS+7OEa28GDw7ibwwkf6sMJcIBWGQrAZ6O+/Ka8ouF8Zdn+6Igv4rK+RVtKQbjYeJ9CvhOZFXSuLl1XVAM01bGwvQSh8BwMC7i1g7gKypvTG31OSlG3ZzIoF7uuoXaC/WWbGvryvPUzFbgCLO8tQu4/Kdy9NsU3C3M/adUtRxLtVNvD29o8dDZT8NM2UTotfgGg3v72ktmnjQ==","DP":"cQ4XqOgPQAOO4dqg3yFH/xFoXQx/5/q4oGtFZYDTSOyrRL/LopZHrr53ys7Uble7+dDa6PPYBgY/C2/SwLBaUF9FpM27Kp7D+3yUKFbKtW8uke+UEM6MgcfjBdwEFVV4CqqHzgD8JvtZ1xhBvx6yUJuHcxxuWKlElXhsTVJKwwE=","DQ":"ktpqqgnwT2Rr9Eb0Kkyg5LZgsO75Pu+0u1q4WhZ7ZzOMJqquCf7hw7ucaWPLq8Ipzn5Hu5CO2gT+URjMGkJNQA+728tFnFkST9wFeqp1hQh5ZxgYsONiH9e/Nw6iauI07i2TYt7pFhIYUOg52/SvHrAzPyEYznCw3BZrR4rEjJk=","Exponent":"AQAB","InverseQ":"hkiDiH926FhARZnVhV5sDnbjxGTdQl8ErZ+qOdBE2vVP6IwNj14dkw+ON4XeIyM/CE3RYmhd8I68JCDNVd6J4hE4NIe4xr+ykmVHYLWQhZ/k4QippwabZ3SK9dkcosQF6BP3lNSgW0UxomdgMKQcsQqccroKEq52Ccr3dUVXICg=","Modulus":"7fgl4D1Emkq+KRAj+u7g7e8hrEhYT19ZRVu1LVdZpx8vDUmuBLVCrNdm6VPIeV5YvrRLELiAknujOMytnIwtY6D1beOtdunEE1z32QsFxizYa9lVaL1rwEURnLQ51sP2bJsxNZnHaJQFGCzOc1i8V551V8eG43asoSbQKFz8Aa6A5UdZaecWSF9WoIkWH/xdi2Ecun69HAS8LiS2S3yKgqyLJivZM72lMUgTWyklh8WMscMb2pRTHspV2oqlIRBo4bRbLgYRJ+6pOMvtge5CgWMupolpy0BTpQrRLPYK9oiZ9iP1/Hdrlu8U0G6XL1rz0kkfqOU10AtlYZe01b0zXQ==","P":"+pWvk2Q5+YN0IikHJkCdpeZMUM3Tkj08FEJETRNU3Rcrpg1wyFQJdqIib28XzWdua5vilBNnAwhbBw4dO978rn1riHq8VQD1JSFh1+vwlzhG76M89KnP7v/DuILbTT4tKU28VWjQsT4RVlI5Rqc3REaUoQDYAmvARCFDGOxCrYs=","Q":"8xyreLJWnAFQoVJjLhK/eNE+GdABidksHz47k1p9imeKAv4xpFx4jfAec4VSiXCvK/KW9+fbPA+S4hEa/5oICKvvALFZavL7A4htnQjflgnEc+QqlR7TjnVgMILyBB3mf4mlNjR7kfwcDwGLRBjMx8mxadj+NlREri4Jw6q4D7c="}} |
|
||||
@ -1,12 +0,0 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||
<configuration> |
|
||||
<!-- |
|
||||
Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380 |
|
||||
--> |
|
||||
<system.webServer> |
|
||||
<handlers> |
|
||||
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" /> |
|
||||
</handlers> |
|
||||
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" startupTimeLimit="3600" requestTimeout="23:00:00" /> |
|
||||
</system.webServer> |
|
||||
</configuration> |
|
||||
@ -1,5 +0,0 @@ |
|||||
ul.ticket-list { |
|
||||
list-style: none; } |
|
||||
ul.ticket-list li { |
|
||||
border-bottom: 1px solid #d0d0d0; } |
|
||||
|
|
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue