using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using New_College.IServices;
using New_College.Model;
using New_College.Model.Models;
using New_College.Model.ViewModels;
using New_College.Model.ViewModels.Query;
namespace New_College.Api.Controllers.Back
{
[Route("api/back/[controller]/[action]")]
[ApiController]
public class VipCardController : ControllerBase
{
private readonly IV_VipCardInfoServices iV_VipCardInfoServices;
private readonly IV_VipCardTypeServices iV_VipCardTypeServices;
private readonly IV_OrderInfoServices iV_OrderInfoServices;
public VipCardController(IV_VipCardInfoServices IV_VipCardInfoServices, IV_VipCardTypeServices IV_VipCardTypeServices, IV_OrderInfoServices IV_OrderInfoServices)
{
iV_VipCardInfoServices = IV_VipCardInfoServices;
iV_VipCardTypeServices = IV_VipCardTypeServices;
iV_OrderInfoServices= IV_OrderInfoServices;
}
///
/// 生成卡信息
///
///
///
[HttpPost]
public async Task>> AutoVipCardInfo([FromBody] AutoVipInfoQuery query)
{
return await iV_VipCardInfoServices.AutoVipCardInfo(query);
}
///
/// 获取分页
///
///
///
[HttpGet]
public async Task>> GetVipCardInfoByPage([FromQuery] VipCardInfoSearchQuery query)
{
return await iV_VipCardInfoServices.GetVipCardInfoByPage(query);
}
///
/// 获取单个
///
///
///
[HttpGet]
public async Task> GetVipCardInfoOne([FromQuery] IdQuery query)
{
return await iV_VipCardInfoServices.GetVipCardInfoOne(query);
}
///
/// 添加
///
///
///
[HttpPost]
public async Task> AddVipCardInfo([FromBody] VipCardInfoQuery query)
{
return await iV_VipCardInfoServices.AddVipCardInfo(query);
}
///
/// 修改
///
///
///
[HttpPut]
public async Task> UpdateVipCardInfo(VipCardInfoQuery query)
{
return await iV_VipCardInfoServices.UpdateVipCardInfo(query);
}
///
/// 删除
///
///
///
[HttpPost]
public async Task> DeleteVipCardInfo([FromBody] IdQuery query)
{
return await iV_VipCardInfoServices.DeleteVipCardInfo(query);
}
///
/// 获取vipcardTypeList
///
///
[HttpPost]
public async Task> GetVipCardType()
{
return await iV_VipCardTypeServices.GetVipCardType();
}
}
}