Ver código fonte

首页项目 接口

lifa 2 anos atrás
pai
commit
3f1c274f3e

+ 1 - 1
src/platform/ZhonTai.Admin/Domain/Platform/PlatformUserEntity.cs

@@ -49,7 +49,7 @@ namespace ZhonTai.Admin.Domain.Platform
 
         /// <summary>
         /// 角色 
-        /// 通过后台开通的是平台管理员1  注册是下级2
+        /// 通过后台开通的是平台管理员2  注册是下级20
         /// </summary>
         public string Role { get; set; }
 

+ 12 - 1
src/platform/ZhonTai.Admin/Domain/User/UserType.cs

@@ -23,5 +23,16 @@ public enum UserType
     /// <summary>
     /// 平台管理员
     /// </summary>
-    PlatformAdmin = 100
+    PlatformAdmin = 100,
+
+    /// <summary>
+    /// 前端管理员
+    /// </summary>
+    FrontendManager = 2,
+
+    /// <summary>
+    /// 前端用户
+    /// </summary>
+    FrontendUser = 20,
+
 }

+ 33 - 4
src/platform/ZhonTai.Admin/Services/DiTuiAPI/Dto/IndexOutput.cs

@@ -60,7 +60,7 @@ namespace ZhonTai.Admin.Services.DiTuiAPI.Dto
     /// </summary>
     public class Imgs
     {
-        public Imgs(string imgUrl,string jumpType,string jumpParam,string workTime, string failureTime, string sort)
+        public Imgs(string imgUrl, string jumpType, string jumpParam, string workTime, string failureTime, string sort)
         {
             ImgUrl = imgUrl;
             JumpType = jumpType;
@@ -106,8 +106,8 @@ namespace ZhonTai.Admin.Services.DiTuiAPI.Dto
     ///  公告
     /// </summary>
     public class Notices
-    { 
-        public Notices(List<string>tags,string title,string id)
+    {
+        public Notices(List<string> tags, string title, string id)
         {
             Tags = tags;
             Title = title;
@@ -117,7 +117,7 @@ namespace ZhonTai.Admin.Services.DiTuiAPI.Dto
         ///  标签
         /// </summary>
         public List<string> Tags { get; set; }
-        
+
         /// <summary>
         /// 标题
         /// </summary>
@@ -130,4 +130,33 @@ namespace ZhonTai.Admin.Services.DiTuiAPI.Dto
     }
 
 
+    public class ProjectOutput
+    {
+        public string Count { get; set; }
+        public List<ProjectOutPut> Projects { get; set; }
+    }
+
+    public class ProjectOutPut
+    {
+        public ProjectOutPut(long id,string name, string logo, string tips,string hotWords,string statusWords,string statusValue)
+        {
+            Id = id;
+            Name = name;
+            Logo = logo;
+            Tips = tips;
+            HotWords = hotWords;
+            StatusWords = statusWords;
+            StatusValue = statusValue;
+        }
+
+        public long Id { get; set; }
+        public string Name { get; set; }
+        public string Logo { get; set; }
+        public string Tips { get; set; }
+        public string HotWords { get; set; }
+        public string StatusWords { get; set; }
+        public string StatusValue { get; set; }
+
+    }
+
 }

+ 3 - 0
src/platform/ZhonTai.Admin/Services/DiTuiAPI/IIndexService.cs

@@ -10,5 +10,8 @@ namespace ZhonTai.Admin.Services.DiTuiAPI
     public interface IIndexService
     {
         Task<IndexOutput> IndexAsync();
+
+        Task<ProjectOutput> ProjectAsync(string Status);
+
     }
 }

+ 105 - 0
src/platform/ZhonTai.Admin/Services/DiTuiAPI/IndexService.cs

@@ -6,9 +6,11 @@ using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using System.Text.RegularExpressions;
 using System.Threading.Tasks;
 using ZhonTai.Admin.Core.Attributes;
 using ZhonTai.Admin.Core.Consts;
+using ZhonTai.Admin.Core.Dto;
 using ZhonTai.Admin.Services.DiTuiAPI.Dto;
 using ZhonTai.DynamicApi;
 using ZhonTai.DynamicApi.Attributes;
@@ -91,5 +93,108 @@ namespace ZhonTai.Admin.Services.DiTuiAPI
             return indexOutPut;
         }
 
+        /// <summary>
+        /// 首页项目
+        /// </summary>
+        /// <returns></returns>
+        [HttpGet]
+        [NoOprationLog]
+        public async Task<ProjectOutput> ProjectAsync(string Status)
+        {
+            bool flag = true;
+            if(Status == "2,5" || Status == "5,2")
+            {
+                flag = true;
+            }
+            else if(Status != "4" || !IsInt(Status))
+
+            {
+                throw ResultOutput.Exception($"参数不正确");
+            }
+            else
+            {
+                flag = false;
+            }
+            //return 
+            //throw ResultOutput.Exception($"错误提示");
+            ProjectOutput projectOutput = new ProjectOutput();
+
+            List<ProjectOutPut> projectOutPuts = new List<ProjectOutPut>();
+
+            if(flag)
+            {
+                projectOutPuts.Add(
+                new ProjectOutPut(
+                    414497860591685,
+                    "快手极速版",
+                    "https://test-dt.zhongjie51.com/assetsImg/ks_logo.png",
+                    "快手极速版APP的新用户,全国可做",
+                    "热门,高佣,简单,T+1",
+                    "立即推广",
+                    "2"
+                    )
+                );
+
+                projectOutPuts.Add(
+                    new ProjectOutPut(
+                        414497860591686,
+                        "京东白条",
+                        "https://test-dt.zhongjie51.com/assetsImg/jd_logo.png",
+                        "全国可做。用户激活白条后并下单支付10元..",
+                        "最新,简单,热门,推荐",
+                        "名额已满",
+                        "5"
+                        )
+                    );
+                projectOutPuts.Add(
+                    new ProjectOutPut(
+                        414497860591687,
+                        "点淘拉新",
+                        "https://test-dt.zhongjie51.com/assetsImg/dt_logo.png",
+                        "全国可做。点淘手机端新用户,官方直推",
+                        "热门,赚钱,官方,简单",
+                        "立即推广",
+                        "2"
+                        )
+                    );
+            }
+            else
+            {
+                projectOutPuts.Add(
+                new ProjectOutPut(
+                    414497860591688,
+                    "点淘拉新(暂停)",
+                    "https://test-dt.zhongjie51.com/assetsImg/dt_logo.png",
+                    "全国可做。点淘手机端新用户,官方直推",
+                    "热门,赚钱,官方,简单",
+                    "项目暂停",
+                    "4"
+                    )
+                );
+                projectOutPuts.Add(
+                    new ProjectOutPut(
+                        414497860591689,
+                        "京东白条",
+                        "https://test-dt.zhongjie51.com/assetsImg/jd_logo.png",
+                        "全国可做。用户激活白条后并下单支付10元..",
+                        "最新,简单,热门,推荐",
+                        "项目暂停",
+                        "4"
+                        )
+                    );
+            }
+            
+            
+            projectOutput.Count = projectOutPuts.Count.ToString();
+            projectOutput.Projects = projectOutPuts;
+
+            return projectOutput;
+        }
+
+        private static bool IsInt(string inString)
+        {
+            Regex regex = new Regex("^[0-9]*[1-9][0-9]*$");
+            return regex.IsMatch(inString.Trim());
+        }
     }
 }

+ 17 - 1
src/platform/ZhonTai.Admin/ZhonTai.Admin.xml

@@ -2971,7 +2971,7 @@
         <member name="P:ZhonTai.Admin.Domain.Platform.PlatformUserEntity.Role">
             <summary>
             角色 
-            通过后台开通的是平台管理员1  注册是下级2
+            通过后台开通的是平台管理员2  注册是下级20
             </summary>
         </member>
         <member name="P:ZhonTai.Admin.Domain.Platform.PlatformUserEntity.InviteCode">
@@ -3842,6 +3842,16 @@
             平台管理员
             </summary>
         </member>
+        <member name="F:ZhonTai.Admin.Domain.User.UserType.FrontendManager">
+            <summary>
+            前端管理员
+            </summary>
+        </member>
+        <member name="F:ZhonTai.Admin.Domain.User.UserType.FrontendUser">
+            <summary>
+            前端用户
+            </summary>
+        </member>
         <member name="T:ZhonTai.Admin.Domain.User.StaffAddInput">
             <summary>
             员工添加
@@ -5357,6 +5367,12 @@
             </summary>
             <returns></returns>
         </member>
+        <member name="M:ZhonTai.Admin.Services.DiTuiAPI.IndexService.ProjectAsync(System.String)">
+            <summary>
+            首页项目
+            </summary>
+            <returns></returns>
+        </member>
         <member name="T:ZhonTai.Admin.Services.DiTuiAPI.ProjectsService">
             <summary>
             项目接口