You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.1 KiB
38 lines
1.1 KiB
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.Extensions.Configuration;
|
|
using System.Threading.Tasks;
|
|
using Volo.Abp.AspNetCore.Mvc;
|
|
|
|
namespace CompanyNameProjectName.PublicApi.Host.Controllers
|
|
{
|
|
[Route("api/[controller]")]
|
|
[ApiController]
|
|
public class SampleController : AbpController
|
|
{
|
|
private readonly IConfiguration _configuration;
|
|
|
|
public SampleController(
|
|
IConfiguration configuration)
|
|
{
|
|
_configuration = configuration;
|
|
|
|
}
|
|
|
|
[HttpGet("write")]
|
|
[Authorize(Policy = CompanyNameProjectNamePublicApiConsts.Policy_Write)]
|
|
public async Task<IActionResult> WriteAsync()
|
|
{
|
|
await Task.CompletedTask;
|
|
return Ok("Write权限通过");
|
|
}
|
|
|
|
[HttpGet("read")]
|
|
[Authorize(Policy = CompanyNameProjectNamePublicApiConsts.Policy_Read)]
|
|
public async Task<IActionResult> ReadAsync()
|
|
{
|
|
await Task.CompletedTask;
|
|
return Ok("Read权限通过");
|
|
}
|
|
}
|
|
}
|
|
|