2025-04-17 20:28:50 +08:00

34 lines
868 B
C#

using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
namespace JiShe.CollectBus.Samples;
[Area(CollectBusRemoteServiceConsts.ModuleName)]
[RemoteService(Name = CollectBusRemoteServiceConsts.RemoteServiceName)]
[Route("api/CollectBus/sample")]
public class SampleController : CollectBusController, ISampleAppService
{
private readonly ISampleAppService _sampleAppService;
public SampleController(ISampleAppService sampleAppService)
{
_sampleAppService = sampleAppService;
}
[HttpGet]
public async Task<SampleDto> GetAsync()
{
return await _sampleAppService.GetAsync();
}
[HttpGet]
[Route("authorized")]
[Authorize]
public async Task<SampleDto> GetAuthorizedAsync()
{
return await _sampleAppService.GetAsync();
}
}