mirror of https://github.com/abpframework/abp.git
10 changed files with 177 additions and 22 deletions
@ -1,16 +1,16 @@ |
|||||
<Project Sdk="Microsoft.NET.Sdk"> |
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
|
||||
<Import Project="..\..\..\..\common.props" /> |
<Import Project="..\..\..\..\common.props" /> |
||||
<Import Project="..\..\..\..\configureawait.props" /> |
<Import Project="..\..\..\..\configureawait.props" /> |
||||
|
|
||||
<PropertyGroup> |
<PropertyGroup> |
||||
<TargetFramework>netcoreapp3.1</TargetFramework> |
<TargetFramework>netcoreapp3.1</TargetFramework> |
||||
<RootNamespace /> |
<RootNamespace /> |
||||
</PropertyGroup> |
</PropertyGroup> |
||||
|
|
||||
<ItemGroup> |
<ItemGroup> |
||||
<ProjectReference Include="..\Volo.CmsKit.Common.HttpApi\Volo.CmsKit.Common.HttpApi.csproj" /> |
<ProjectReference Include="..\Volo.CmsKit.Common.HttpApi\Volo.CmsKit.Common.HttpApi.csproj" /> |
||||
<ProjectReference Include="..\Volo.CmsKit.Public.Application.Contracts\Volo.CmsKit.Public.Application.Contracts.csproj" /> |
<ProjectReference Include="..\Volo.CmsKit.Public.Application.Contracts\Volo.CmsKit.Public.Application.Contracts.csproj" /> |
||||
</ItemGroup> |
</ItemGroup> |
||||
|
|
||||
</Project> |
</Project> |
||||
|
|||||
@ -0,0 +1,59 @@ |
|||||
|
using System; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Volo.Abp; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
using Volo.Abp.GlobalFeatures; |
||||
|
using Volo.CmsKit.GlobalFeatures; |
||||
|
|
||||
|
namespace Volo.CmsKit.Public.Ratings |
||||
|
{ |
||||
|
[RequiresGlobalFeature(typeof(RatingsFeature))] |
||||
|
[RemoteService(Name = CmsKitPublicRemoteServiceConsts.RemoteServiceName)] |
||||
|
[Area("cms-kit")] |
||||
|
[Route("api/cms-kit-public/ratings")] |
||||
|
public class RatingPublicController : CmsKitPublicControllerBase, IRatingPublicAppService |
||||
|
{ |
||||
|
protected IRatingPublicAppService RatingPublicAppService { get; } |
||||
|
|
||||
|
public RatingPublicController(IRatingPublicAppService ratingPublicAppService) |
||||
|
{ |
||||
|
RatingPublicAppService = ratingPublicAppService; |
||||
|
} |
||||
|
|
||||
|
[HttpGet] |
||||
|
[Route("{entityType}/{entityId}")] |
||||
|
public virtual Task<ListResultDto<RatingDto>> GetListAsync(string entityType, string entityId) |
||||
|
{ |
||||
|
return RatingPublicAppService.GetListAsync(entityType, entityId); |
||||
|
} |
||||
|
|
||||
|
[HttpPut] |
||||
|
[Route("{entityType}/{entityId}")] |
||||
|
public virtual Task<RatingDto> CreateAsync(string entityType, string entityId, CreateRatingInput input) |
||||
|
{ |
||||
|
return RatingPublicAppService.CreateAsync(entityType, entityId, input); |
||||
|
} |
||||
|
|
||||
|
[HttpPut] |
||||
|
[Route("{id}")] |
||||
|
public virtual Task<RatingDto> UpdateAsync(Guid id, UpdateRatingInput input) |
||||
|
{ |
||||
|
return RatingPublicAppService.UpdateAsync(id, input); |
||||
|
} |
||||
|
|
||||
|
[HttpDelete] |
||||
|
[Route("{id}")] |
||||
|
public Task DeleteAsync(Guid id) |
||||
|
{ |
||||
|
return RatingPublicAppService.DeleteAsync(id); |
||||
|
} |
||||
|
|
||||
|
[HttpGet] |
||||
|
[Route("{entityType}/{entityId}")] |
||||
|
public Task<RatingDto> GetCurrentUserRatingAsync(string entityType, string entityId) |
||||
|
{ |
||||
|
return RatingPublicAppService.GetCurrentUserRatingAsync(entityType, entityId); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue