CustomerController.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using Microsoft.AspNetCore.Mvc;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Threading.Tasks;
  6. using XYY.Core.Standard.Mvc;
  7. using XYY.Service.Standard.Customer;
  8. namespace XYY.Api.Customer.Controllers
  9. {
  10. [Route("api/[controller]/[action]")]
  11. [ApiController]
  12. public class CustomerController : ApiControllerBase
  13. {
  14. ICustomerService _customerService;
  15. public CustomerController(ICustomerService customerService)
  16. {
  17. _customerService = customerService;
  18. }
  19. public async Task<IActionResult> AlertFreezeCustomer(int? days)
  20. {
  21. if (days == null || days.Value <= 0)
  22. days = 3;
  23. await _customerService.AlertFreezeCustomer(days.Value);
  24. return Ok();
  25. }
  26. /// <summary>
  27. /// 多少天内不再通知
  28. /// </summary>
  29. /// <returns></returns>
  30. public async Task<string> NoAlertFreezedUntil(string customerIds, int days)
  31. {
  32. await _customerService.NoAlertFreezedUntil(customerIds, days);
  33. return "操作成功,请返回";
  34. }
  35. /// <summary>
  36. /// 延期冻结多少天
  37. /// </summary>
  38. /// <param name="days"></param>
  39. /// <returns></returns>
  40. public async Task<string> DelayFreezed(string customerIds, int days)
  41. {
  42. await _customerService.DelayFreezed(customerIds, days);
  43. return "操作成功,请返回";
  44. }
  45. }
  46. }