using System.ComponentModel.DataAnnotations;
using Dlhis.Canteen.Setting.Response;
using Dlhis.Canteen.Setting.Services;
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Dlhis.Canteen.Setting.Controllers;
///
/// 钱包
///
[Authorize]
[Route("api/[controller]")]
[ApiController]
public class WalletsController : ControllerBase
{
private readonly IWalletService _walletService;
public WalletsController(IWalletService walletService)
{
_walletService = walletService;
}
///
/// 钱包列表
///
///
[HttpGet("list")]
public async Task> GetListAsync()
{
return await _walletService.GetListAsync();
}
///
/// 余额
///
/// 钱包code
///
[HttpGet("balance")]
[IgnoreTenant]
public async Task GetBalanceAsync([Required] string walletCode)
{
return await _walletService.GetBalanceAsync(walletCode);
}
}