Parcourir la Source

Demo项目调整
上传ServiceTaskScheduling项目

yuqian il y a 8 ans
Parent
commit
69d34368d5

+ 2 - 0
.gitignore

3
 Demo/WebApplication2/bin/
3
 Demo/WebApplication2/bin/
4
 Demo/WebApplication2/obj/
4
 Demo/WebApplication2/obj/
5
 .vs/
5
 .vs/
6
+/ServiceTaskScheduling/obj
7
+/ServiceTaskScheduling/bin/Release/netcoreapp2.0

+ 1 - 1
Demo/WebApplication1/Controllers/ValuesController.cs

77
 
77
 
78
 
78
 
79
 
79
 
80
-        public void HttpGetExport()
80
+        private void HttpGetExport()
81
         {
81
         {
82
             try
82
             try
83
             {
83
             {

+ 0 - 1
Demo/WebApplication1/WebApplication1.csproj

10
 
10
 
11
   <ItemGroup>
11
   <ItemGroup>
12
     <PackageReference Include="HangFire" Version="1.6.17" />
12
     <PackageReference Include="HangFire" Version="1.6.17" />
13
-    <PackageReference Include="Hangfire.Autofac.Core" Version="1.0.1" />
14
     <PackageReference Include="Hangfire.Redis.StackExchange.StrongName" Version="1.7.0" />
13
     <PackageReference Include="Hangfire.Redis.StackExchange.StrongName" Version="1.7.0" />
15
     <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.3" />
14
     <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.3" />
16
     <PackageReference Include="NLog.Web.AspNetCore" Version="4.4.1" />
15
     <PackageReference Include="NLog.Web.AspNetCore" Version="4.4.1" />

+ 1 - 1
Demo/WebApplication1/appsettings.json

13
     }
13
     }
14
   },
14
   },
15
   "ConnectionStrings": {
15
   "ConnectionStrings": {
16
-    "hangfire.redis": "localhost,abortConnect=false",
16
+    "hangfire.redis": "192.168.1.27,abortConnect=false",
17
     "hangfire.sqlserver": "Data Source=.;User ID=sa;pwd=123456;Initial Catalog=HangFire;"
17
     "hangfire.sqlserver": "Data Source=.;User ID=sa;pwd=123456;Initial Catalog=HangFire;"
18
   }
18
   }
19
 }
19
 }

+ 6 - 0
ServiceTaskScheduling.sln

9
 EndProject
9
 EndProject
10
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApplication2", "Demo\WebApplication2\WebApplication2.csproj", "{02F04742-7885-447C-99FD-233141CD5592}"
10
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApplication2", "Demo\WebApplication2\WebApplication2.csproj", "{02F04742-7885-447C-99FD-233141CD5592}"
11
 EndProject
11
 EndProject
12
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceTaskScheduling", "ServiceTaskScheduling\ServiceTaskScheduling.csproj", "{13851DA1-187D-408E-8E2A-2C5C2680B032}"
13
+EndProject
12
 Global
14
 Global
13
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
15
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
14
 		Debug|Any CPU = Debug|Any CPU
16
 		Debug|Any CPU = Debug|Any CPU
23
 		{02F04742-7885-447C-99FD-233141CD5592}.Debug|Any CPU.Build.0 = Debug|Any CPU
25
 		{02F04742-7885-447C-99FD-233141CD5592}.Debug|Any CPU.Build.0 = Debug|Any CPU
24
 		{02F04742-7885-447C-99FD-233141CD5592}.Release|Any CPU.ActiveCfg = Release|Any CPU
26
 		{02F04742-7885-447C-99FD-233141CD5592}.Release|Any CPU.ActiveCfg = Release|Any CPU
25
 		{02F04742-7885-447C-99FD-233141CD5592}.Release|Any CPU.Build.0 = Release|Any CPU
27
 		{02F04742-7885-447C-99FD-233141CD5592}.Release|Any CPU.Build.0 = Release|Any CPU
28
+		{13851DA1-187D-408E-8E2A-2C5C2680B032}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29
+		{13851DA1-187D-408E-8E2A-2C5C2680B032}.Debug|Any CPU.Build.0 = Debug|Any CPU
30
+		{13851DA1-187D-408E-8E2A-2C5C2680B032}.Release|Any CPU.ActiveCfg = Release|Any CPU
31
+		{13851DA1-187D-408E-8E2A-2C5C2680B032}.Release|Any CPU.Build.0 = Release|Any CPU
26
 	EndGlobalSection
32
 	EndGlobalSection
27
 	GlobalSection(SolutionProperties) = preSolution
33
 	GlobalSection(SolutionProperties) = preSolution
28
 		HideSolutionNode = FALSE
34
 		HideSolutionNode = FALSE

+ 44 - 0
ServiceTaskScheduling/Controllers/ValuesController.cs

1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Threading.Tasks;
5
+using Microsoft.AspNetCore.Mvc;
6
+
7
+namespace ServiceTaskScheduling.Controllers
8
+{
9
+    [Route("api/[controller]")]
10
+    public class ValuesController : Controller
11
+    {
12
+        // GET api/values
13
+        [HttpGet]
14
+        public IEnumerable<string> Get()
15
+        {
16
+            return new string[] { "value1", "value2" };
17
+        }
18
+
19
+        // GET api/values/5
20
+        [HttpGet("{id}")]
21
+        public string Get(int id)
22
+        {
23
+            return "value";
24
+        }
25
+
26
+        // POST api/values
27
+        [HttpPost]
28
+        public void Post([FromBody]string value)
29
+        {
30
+        }
31
+
32
+        // PUT api/values/5
33
+        [HttpPut("{id}")]
34
+        public void Put(int id, [FromBody]string value)
35
+        {
36
+        }
37
+
38
+        // DELETE api/values/5
39
+        [HttpDelete("{id}")]
40
+        public void Delete(int id)
41
+        {
42
+        }
43
+    }
44
+}

+ 25 - 0
ServiceTaskScheduling/Program.cs

1
+using System;
2
+using System.Collections.Generic;
3
+using System.IO;
4
+using System.Linq;
5
+using System.Threading.Tasks;
6
+using Microsoft.AspNetCore;
7
+using Microsoft.AspNetCore.Hosting;
8
+using Microsoft.Extensions.Configuration;
9
+using Microsoft.Extensions.Logging;
10
+
11
+namespace ServiceTaskScheduling
12
+{
13
+    public class Program
14
+    {
15
+        public static void Main(string[] args)
16
+        {
17
+            BuildWebHost(args).Run();
18
+        }
19
+
20
+        public static IWebHost BuildWebHost(string[] args) =>
21
+            WebHost.CreateDefaultBuilder(args)
22
+                .UseStartup<Startup>()
23
+                .Build();
24
+    }
25
+}

+ 29 - 0
ServiceTaskScheduling/Properties/launchSettings.json

1
+{
2
+  "iisSettings": {
3
+    "windowsAuthentication": false,
4
+    "anonymousAuthentication": true,
5
+    "iisExpress": {
6
+      "applicationUrl": "http://localhost:28876/",
7
+      "sslPort": 0
8
+    }
9
+  },
10
+  "profiles": {
11
+    "IIS Express": {
12
+      "commandName": "IISExpress",
13
+      "launchBrowser": true,
14
+      "launchUrl": "api/values",
15
+      "environmentVariables": {
16
+        "ASPNETCORE_ENVIRONMENT": "Development"
17
+      }
18
+    },
19
+    "ServiceTaskScheduling": {
20
+      "commandName": "Project",
21
+      "launchBrowser": true,
22
+      "launchUrl": "api/values",
23
+      "environmentVariables": {
24
+        "ASPNETCORE_ENVIRONMENT": "Development"
25
+      },
26
+      "applicationUrl": "http://localhost:28877/"
27
+    }
28
+  }
29
+}

+ 19 - 0
ServiceTaskScheduling/ServiceTaskScheduling.csproj

1
+<Project Sdk="Microsoft.NET.Sdk.Web">
2
+
3
+  <PropertyGroup>
4
+    <TargetFramework>netcoreapp2.0</TargetFramework>
5
+  </PropertyGroup>
6
+
7
+  <ItemGroup>
8
+    <Folder Include="wwwroot\" />
9
+  </ItemGroup>
10
+
11
+  <ItemGroup>
12
+    <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
13
+  </ItemGroup>
14
+
15
+  <ItemGroup>
16
+    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
17
+  </ItemGroup>
18
+
19
+</Project>

+ 40 - 0
ServiceTaskScheduling/Startup.cs

1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Threading.Tasks;
5
+using Microsoft.AspNetCore.Builder;
6
+using Microsoft.AspNetCore.Hosting;
7
+using Microsoft.Extensions.Configuration;
8
+using Microsoft.Extensions.DependencyInjection;
9
+using Microsoft.Extensions.Logging;
10
+using Microsoft.Extensions.Options;
11
+
12
+namespace ServiceTaskScheduling
13
+{
14
+    public class Startup
15
+    {
16
+        public Startup(IConfiguration configuration)
17
+        {
18
+            Configuration = configuration;
19
+        }
20
+
21
+        public IConfiguration Configuration { get; }
22
+
23
+        // This method gets called by the runtime. Use this method to add services to the container.
24
+        public void ConfigureServices(IServiceCollection services)
25
+        {
26
+            services.AddMvc();
27
+        }
28
+
29
+        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
30
+        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
31
+        {
32
+            if (env.IsDevelopment())
33
+            {
34
+                app.UseDeveloperExceptionPage();
35
+            }
36
+
37
+            app.UseMvc();
38
+        }
39
+    }
40
+}

+ 10 - 0
ServiceTaskScheduling/appsettings.Development.json

1
+{
2
+  "Logging": {
3
+    "IncludeScopes": false,
4
+    "LogLevel": {
5
+      "Default": "Debug",
6
+      "System": "Information",
7
+      "Microsoft": "Information"
8
+    }
9
+  }
10
+}

+ 15 - 0
ServiceTaskScheduling/appsettings.json

1
+{
2
+  "Logging": {
3
+    "IncludeScopes": false,
4
+    "Debug": {
5
+      "LogLevel": {
6
+        "Default": "Warning"
7
+      }
8
+    },
9
+    "Console": {
10
+      "LogLevel": {
11
+        "Default": "Warning"
12
+      }
13
+    }
14
+  }
15
+}