12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- using System.Collections.Generic;
- using System.Threading.Tasks;
- using GxPress.Repository.Interface.VipEquity;
- using GxPress.Request.VipEquity;
- using GxPress.Result.VipEquity;
- using Microsoft.AspNetCore.Authorization;
- using Microsoft.AspNetCore.Mvc;
- namespace GxPress.Api.AdminControllers
- {
- /// <summary>
- /// VIP权益
- /// </summary>
- [Route("api/admin/vip-equity")]
- [ApiController]
- [Authorize]
- public class AdminVipEquityController : Controller
- {
- private readonly IVipEquityRepository vipEquityRepository;
- public AdminVipEquityController(IVipEquityRepository vipEquityRepository)
- {
- this.vipEquityRepository = vipEquityRepository;
- }
- /// <summary>
- /// 获取列表
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public async Task<IEnumerable<VipEquityResult>> GetAllAsync()
- {
- return await vipEquityRepository.GetAllAsync();
- }
- /// <summary>
- /// 修改
- /// </summary>
- /// <param name="request"></param>
- /// <returns></returns>
- [HttpPut]
- public async Task<bool> UpdateAsync(VipEquityUpdateRequest request)
- {
- return await vipEquityRepository.UpdateAsync(request);
- }
- /// <summary>
- /// 添加
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- [HttpPost]
- public async Task<bool> InsertAsync(Entity.tede2.VipEquity.VipEquity model)
- {
- return await vipEquityRepository.InsertAsync(model);
- }
- /// <summary>
- /// 根据ID删除
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- [HttpDelete("{id}")]
- public async Task<bool> DeleteAsync(int id)
- {
- return await vipEquityRepository.DeleteAsync(id);
- }
- }
- }
|