SjhandkjihController.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using CP.Model;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Net;
  6. using System.Net.Http;
  7. using System.Web.Http;
  8. namespace CP.Api.Controllers
  9. {
  10. public class SjhandkjihController : BaseApi
  11. {
  12. /// <summary>
  13. /// 手机站试机号开机号列表
  14. /// </summary>
  15. /// <param name="ename">彩种英文名称</param>
  16. /// <param name="n">条数</param>
  17. /// <param name="qi">期数 type大于0的时候必须传入</param>
  18. /// <param name="type">0 默认 1 历史</param>
  19. /// <returns></returns>
  20. [HttpGet]
  21. public ApiList<ApisjhandkjihModel> Get(string ename, int n = 10, int qi = 0, int type = 0)
  22. {
  23. if (string.IsNullOrWhiteSpace(ename))
  24. {
  25. return ResponseList(new List<ApisjhandkjihModel>(), 101, "name为空");
  26. }
  27. if (n < 0)
  28. {
  29. return ResponseList(new List<ApisjhandkjihModel>(), 101, "n不能小于0");
  30. }
  31. if (type > 0 && qi<=0)
  32. {
  33. return ResponseList(new List<ApisjhandkjihModel>(), 101, "type大于0是必须传期数");
  34. }
  35. List<ApisjhandkjihModel> data = Kjh.Getsjhandkjih(ename, n, qi, type);
  36. return ResponseList(data);
  37. }
  38. }
  39. }