OneController.cs 1022 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. /// <summary>
  11. /// 获取指定期数开奖号
  12. /// </summary>
  13. public class OneController : BaseApi
  14. {
  15. /// <summary>
  16. /// 获取指定期数开奖号
  17. /// </summary>
  18. /// <param name="ename">英文名称</param>
  19. /// <param name="qi">期数 不传或者为0获取最近期</param>
  20. /// <returns></returns>
  21. [HttpGet]
  22. public ApiOne<ApiModel> Get(string ename, int qi = 0)
  23. {
  24. if (string.IsNullOrWhiteSpace(ename))
  25. {
  26. return ResponseOne<ApiModel>(null, 101, "name为空");
  27. }
  28. if (qi < 0)
  29. {
  30. return ResponseOne<ApiModel>(null, 101, "qi不能小于0");
  31. }
  32. ApiModel data = Kjh.GetOne(ename, qi);
  33. return ResponseOne(data);
  34. }
  35. }
  36. }