Procházet zdrojové kódy

Demo项目调整
上传ServiceTaskScheduling项目

yuqian %!s(int64=8) %!d(string=před) roky
rodič
revize
69d34368d5

+ 2 - 0
.gitignore

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

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

@@ -77,7 +77,7 @@ namespace WebApplication1.Controllers
77 77
 
78 78
 
79 79
 
80
-        public void HttpGetExport()
80
+        private void HttpGetExport()
81 81
         {
82 82
             try
83 83
             {

+ 0 - 1
Demo/WebApplication1/WebApplication1.csproj

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

+ 1 - 1
Demo/WebApplication1/appsettings.json

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

+ 6 - 0
ServiceTaskScheduling.sln

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

+ 44 - 0
ServiceTaskScheduling/Controllers/ValuesController.cs

@@ -0,0 +1,44 @@
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

@@ -0,0 +1,25 @@
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

@@ -0,0 +1,29 @@
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

@@ -0,0 +1,19 @@
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

@@ -0,0 +1,40 @@
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

@@ -0,0 +1,10 @@
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

@@ -0,0 +1,15 @@
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
+}