using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using New_College.IServices;
using New_College.Model;
using New_College.Model.ViewModels;
namespace New_College.Api.Controllers.Front
{
[Route("api/front/[controller]/[action]")]
[ApiController]
public class VipController : ControllerBase
{
private readonly IV_VipCardTypeServices v_VipCardTypeServices;
private readonly IV_VipCardInfoServices v_VipCardInfoServices;
public VipController(IV_VipCardTypeServices IV_VipCardTypeServices,
IV_VipCardInfoServices IV_VipCardInfoServices)
{
v_VipCardTypeServices = IV_VipCardTypeServices;
v_VipCardInfoServices = IV_VipCardInfoServices;
}
///
/// 获取Vip卡列表
///
///
[HttpGet]
public async Task>> GetVipCardTypeList()
{
var result = await v_VipCardTypeServices.GetVipCardTypeList();
return new MessageModel>()
{
success = true,
msg = "获取成功",
response = result
};
}
///
/// 绑定卡
///
///
///
[HttpPost]
[Authorize]
public async Task> BindCardInfo(VipCardQuery query)
{
return await v_VipCardInfoServices.BindCardInfo(query);
}
///
/// 开放绑卡
///
///
///
[HttpPost]
[Authorize]
public async Task> OpenBindCardInfo(OpenVipCardRequest query)
{
return await v_VipCardInfoServices.OpenBindCardInfo(query);
}
///
/// 获取vip信息 传用户Id
///
///
///
[HttpGet]
[Authorize]
public async Task> GetVipInfo([FromQuery] IdQuery query)
{
return await v_VipCardInfoServices.GetVipInfo(query);
}
}
}