IndexService.cs 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. using Microsoft.AspNetCore.Authorization;
  2. using Microsoft.AspNetCore.Mvc;
  3. using NPOI.SS.Formula.PTG;
  4. using SkiaSharp;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Text.RegularExpressions;
  10. using System.Threading.Tasks;
  11. using ZhonTai.Admin.Core.Attributes;
  12. using ZhonTai.Admin.Core.Consts;
  13. using ZhonTai.Admin.Core.Dto;
  14. using ZhonTai.Admin.Services.DiTuiAPI.Dto;
  15. using ZhonTai.DynamicApi;
  16. using ZhonTai.DynamicApi.Attributes;
  17. namespace ZhonTai.Admin.Services.DiTuiAPI
  18. {
  19. /// <summary>
  20. /// 首页接口
  21. /// </summary>
  22. /// <returns></returns>
  23. [DynamicApi(Area = AdminConsts.DiTuiName)]
  24. public class IndexService : BaseService, IIndexService, IDynamicApi
  25. {
  26. /// <summary>
  27. /// 首页信息
  28. /// </summary>
  29. /// <returns></returns>
  30. [HttpGet]
  31. [NoOprationLog]
  32. public async Task<IndexOutput> IndexAsync()
  33. {
  34. IndexOutput indexOutPut = new IndexOutput();
  35. indexOutPut.Name = "99地推";
  36. indexOutPut.Tips = "推广要求:杜绝任何虚假、作弊、违法行为!";
  37. List<Imgs> imgsList = new List<Imgs>();
  38. imgsList.Add(new Imgs(
  39. "https://test-dt.zhongjie51.com/assetsImg/lunbo1.png",
  40. "1",
  41. "11",
  42. "2023-01-11 11:11:11",
  43. "2023-11-11 11:11:11",
  44. "99"
  45. ));
  46. imgsList.Add(new Imgs(
  47. "https://test-dt.zhongjie51.com/assetsImg/lunbo2.png",
  48. "2",
  49. "222",
  50. "2023-02-02 12:12:12",
  51. "2023-12-22 14:59:49",
  52. "99"
  53. ));
  54. imgsList.Add(new Imgs(
  55. "https://test-dt.zhongjie51.com/assetsImg/lunbo3.png",
  56. "3",
  57. "333",
  58. "2023-03-03 12:12:12",
  59. "2023-12-30 14:59:49",
  60. "99"
  61. ));
  62. indexOutPut.Imgs = imgsList;
  63. List<Notices> notices = new List<Notices>();
  64. List<string> tags = new List<string>();
  65. tags.Add("最新");
  66. tags.Add("重要");
  67. List<string> importentTags = new List<string>();
  68. importentTags.Add("重要");
  69. notices.Add(new Notices(tags,"平台悬赏任务、游戏试玩任务上线通知…","11"));
  70. notices.Add(new Notices(importentTags, "快手极速版直推版价格政策调整通知", "22"));
  71. notices.Add(new Notices(tags, "12月平台项目重要通知请注意查看!12月平台项目重要通知请注意查看!", "33"));
  72. indexOutPut.Notices = notices;
  73. List<Settlement> settlements = new List<Settlement>();
  74. settlements.Add(new Settlement("抖音电商1分购-高价版", "未结算"));
  75. settlements.Add(new Settlement("京喜特价-发货版", "已结算至03月20日"));
  76. settlements.Add(new Settlement("抖音电商1分购-稳定版", "已结算至03月20日"));
  77. settlements.Add(new Settlement("兴业数字人民币", "已结算至03月20日"));
  78. settlements.Add(new Settlement("抖音极速地推版", "已结算至03月20日"));
  79. settlements.Add(new Settlement("易行通ETC(自助发货)", "已结算至03月20日"));
  80. settlements.Add(new Settlement("抖美团外卖-关注公众号", "已结算至03月20日"));
  81. settlements.Add(new Settlement("抖音电商1分购-高价版", "已结算至03月20日"));
  82. settlements.Add(new Settlement("抖音电商1分购-高价版", "已结算至03月20日"));
  83. ;
  84. indexOutPut.settlement = settlements;
  85. return indexOutPut;
  86. }
  87. /// <summary>
  88. /// 首页项目
  89. /// </summary>
  90. /// <returns></returns>
  91. [HttpGet]
  92. [NoOprationLog]
  93. public async Task<ProjectOutput> ProjectAsync(string Status)
  94. {
  95. bool flag = true;
  96. if(Status == "2,5" || Status == "5,2")
  97. {
  98. flag = true;
  99. }
  100. else if(Status != "4" || !IsInt(Status))
  101. {
  102. throw ResultOutput.Exception($"参数不正确");
  103. }
  104. else
  105. {
  106. flag = false;
  107. }
  108. //return
  109. //throw ResultOutput.Exception($"错误提示");
  110. ProjectOutput projectOutput = new ProjectOutput();
  111. List<ProjectOutPut> projectOutPuts = new List<ProjectOutPut>();
  112. if(flag)
  113. {
  114. projectOutPuts.Add(
  115. new ProjectOutPut(
  116. 414497860591685,
  117. "快手极速版",
  118. "https://test-dt.zhongjie51.com/assetsImg/ks_logo.png",
  119. "快手极速版APP的新用户,全国可做",
  120. "热门,高佣,简单,T+1",
  121. "立即推广",
  122. "2"
  123. )
  124. );
  125. projectOutPuts.Add(
  126. new ProjectOutPut(
  127. 414497860591686,
  128. "京东白条",
  129. "https://test-dt.zhongjie51.com/assetsImg/jd_logo.png",
  130. "全国可做。用户激活白条后并下单支付10元..",
  131. "最新,简单,热门,推荐",
  132. "名额已满",
  133. "5"
  134. )
  135. );
  136. projectOutPuts.Add(
  137. new ProjectOutPut(
  138. 414497860591687,
  139. "点淘拉新",
  140. "https://test-dt.zhongjie51.com/assetsImg/dt_logo.png",
  141. "全国可做。点淘手机端新用户,官方直推",
  142. "热门,赚钱,官方,简单",
  143. "立即推广",
  144. "2"
  145. )
  146. );
  147. }
  148. else
  149. {
  150. projectOutPuts.Add(
  151. new ProjectOutPut(
  152. 414497860591688,
  153. "点淘拉新(暂停)",
  154. "https://test-dt.zhongjie51.com/assetsImg/dt_logo.png",
  155. "全国可做。点淘手机端新用户,官方直推",
  156. "热门,赚钱,官方,简单",
  157. "项目暂停",
  158. "4"
  159. )
  160. );
  161. projectOutPuts.Add(
  162. new ProjectOutPut(
  163. 414497860591689,
  164. "京东白条",
  165. "https://test-dt.zhongjie51.com/assetsImg/jd_logo.png",
  166. "全国可做。用户激活白条后并下单支付10元..",
  167. "最新,简单,热门,推荐",
  168. "项目暂停",
  169. "4"
  170. )
  171. );
  172. }
  173. projectOutput.Count = projectOutPuts.Count.ToString();
  174. projectOutput.Projects = projectOutPuts;
  175. return projectOutput;
  176. }
  177. private static bool IsInt(string inString)
  178. {
  179. Regex regex = new Regex("^[0-9]*[1-9][0-9]*$");
  180. return regex.IsMatch(inString.Trim());
  181. }
  182. }
  183. }