40 lines
947 B
C#
40 lines
947 B
C#
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Threading.Tasks;
|
|||
|
|
using JiShe.CollectBus.FreeSql;
|
|||
|
|
using JiShe.CollectBus.PrepayModel;
|
|||
|
|
using Microsoft.AspNetCore.Authorization;
|
|||
|
|
|
|||
|
|
namespace JiShe.CollectBus.Samples;
|
|||
|
|
|
|||
|
|
public class SampleAppService : CollectBusAppService, ISampleAppService
|
|||
|
|
{
|
|||
|
|
public Task<SampleDto> GetAsync()
|
|||
|
|
{
|
|||
|
|
return Task.FromResult(
|
|||
|
|
new SampleDto
|
|||
|
|
{
|
|||
|
|
Value = 42
|
|||
|
|
}
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[Authorize]
|
|||
|
|
public Task<SampleDto> GetAuthorizedAsync()
|
|||
|
|
{
|
|||
|
|
return Task.FromResult(
|
|||
|
|
new SampleDto
|
|||
|
|
{
|
|||
|
|
Value = 42
|
|||
|
|
}
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[AllowAnonymous]
|
|||
|
|
public async Task<List<Vi_BaseAmmeterInfo>> Test()
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
var ammeterList = await SqlProvider.Instance.Change(DbEnum.PrepayDB).Select<Vi_BaseAmmeterInfo>().Where(d => d.TB_CustomerID == 5).Take(10).ToListAsync();
|
|||
|
|
return ammeterList;
|
|||
|
|
}
|
|||
|
|
}
|