-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update service for smalltalk api
- Loading branch information
1 parent
15a1906
commit 75b0b81
Showing
14 changed files
with
175 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/Services/smalltalk/O2NextGen.SmallTalk.Api/.config/dotnet-tools.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"version": 1, | ||
"isRoot": true, | ||
"tools": { | ||
"dotnet-ef": { | ||
"version": "6.0.3", | ||
"commands": [ | ||
"dotnet-ef" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 24 additions & 21 deletions
45
src/Services/smalltalk/O2NextGen.SmallTalk.Api/O2NextGen.SmallTalk.Api.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,31 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp2.2</TargetFramework> | ||
<UserSecretsId>3e239bd5-b8d6-455f-8e46-ea4782668914</UserSecretsId> | ||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> | ||
<DockerfileContext>..\..\..</DockerfileContext> | ||
<DockerComposeProjectPath>..\..\..\docker-compose.dcproj</DockerComposeProjectPath> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<TargetFramework>netcoreapp2.2</TargetFramework> | ||
<UserSecretsId>3e239bd5-b8d6-455f-8e46-ea4782668914</UserSecretsId> | ||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> | ||
<DockerfileContext>..\..\..</DockerfileContext> | ||
<DockerComposeProjectPath>..\..\..\docker-compose.dcproj</DockerComposeProjectPath> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Folder Include="wwwroot\" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Folder Include="wwwroot\" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.App" /> | ||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.14.0" /> | ||
<PackageReference Include="Microsoft.Extensions.Options" Version="2.2.0" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.App" /> | ||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.14.0" /> | ||
<PackageReference Include="Microsoft.Extensions.Options" Version="2.2.0" /> | ||
<PackageReference Include="Microsoft.Extensions.Http.Polly"> | ||
<Version>2.2.0</Version> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\..\SDKs\O2NG.Sdk.NetCore\O2NG.Sdk.NetCore.Models\O2NextGen.Sdk.NetCore.Models.csproj" /> | ||
<ProjectReference Include="..\O2NextGen.SmallTalk.Business\O2NextGen.SmallTalk.Business.csproj" /> | ||
<ProjectReference Include="..\O2NextGen.SmallTalk.Data\O2NextGen.SmallTalk.Data.csproj" /> | ||
<ProjectReference Include="..\O2NextGen.SmallTalk.Impl\O2NextGen.SmallTalk.Impl.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\..\SDKs\O2NG.Sdk.NetCore\O2NG.Sdk.NetCore.Models\O2NextGen.Sdk.NetCore.Models.csproj" /> | ||
<ProjectReference Include="..\O2NextGen.SmallTalk.Business\O2NextGen.SmallTalk.Business.csproj" /> | ||
<ProjectReference Include="..\O2NextGen.SmallTalk.Data\O2NextGen.SmallTalk.Data.csproj" /> | ||
<ProjectReference Include="..\O2NextGen.SmallTalk.Impl\O2NextGen.SmallTalk.Impl.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
26 changes: 26 additions & 0 deletions
26
src/Services/smalltalk/O2NextGen.SmallTalk.Api/Services/SignalRService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using System.Net.Http; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace O2NextGen.SmallTalk.Api.Services | ||
{ | ||
public class SignalRService: ISignalRService | ||
{ | ||
private readonly HttpClient _httpClient; | ||
public SignalRService(HttpClient httpClient) | ||
{ | ||
_httpClient = httpClient ?? throw new ArgumentNullException(nameof(httpClient)); | ||
} | ||
|
||
public async Task GetAsync(CancellationToken ct) | ||
{ | ||
await _httpClient.GetAsync($"api/chat", ct); | ||
} | ||
} | ||
|
||
public interface ISignalRService | ||
{ | ||
Task GetAsync(CancellationToken ct); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 11 additions & 5 deletions
16
src/Services/smalltalk/O2NextGen.SmallTalk.SignalrHub/Controllers/ChatController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,28 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.SignalR; | ||
using O2NextGen.SmallTalk.SignalrHub.Hubs; | ||
using System.Threading.Tasks; | ||
|
||
namespace O2NextGen.SmallTalk.SignalrHub.Controllers | ||
{ | ||
[Route("api/chat")] | ||
[ApiController] | ||
public class ChatController : ControllerBase | ||
{ | ||
private readonly IChatHub chatHub; | ||
private IHubContext<ChatHub> _hubContext; | ||
|
||
public ChatController(IChatHub chatHub) | ||
public ChatController(IHubContext<ChatHub> chatHub) | ||
{ | ||
this.chatHub = chatHub; | ||
this._hubContext = chatHub; | ||
} | ||
[HttpGet] | ||
public void Test() | ||
public async Task<IActionResult> Test() | ||
{ | ||
chatHub.UpdateMessages(); | ||
//await chatHub.UpdateMessages(); | ||
await _hubContext.Clients | ||
.Group("Denis") | ||
.SendAsync("OnUpdateMessage"); | ||
return Ok("Ok"); | ||
} | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
src/Services/smalltalk/O2NextGen.SmallTalk.SignalrHub/Controllers/ValuesController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System.Collections.Generic; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace O2NextGen.SmallTalk.SignalrHub.Controllers | ||
{ | ||
[Route("api/[controller]")] | ||
[ApiController] | ||
public class ValuesController : ControllerBase | ||
{ | ||
// GET api/values | ||
[HttpGet] | ||
public ActionResult<IEnumerable<string>> Get() | ||
{ | ||
return new string[] { "value1", "value2" }; | ||
} | ||
|
||
// GET api/values/5 | ||
[HttpGet("{id}")] | ||
public ActionResult<string> Get(int id) | ||
{ | ||
return "value"; | ||
} | ||
|
||
// POST api/values | ||
[HttpPost] | ||
public void Post([FromBody] string value) | ||
{ | ||
} | ||
|
||
// PUT api/values/5 | ||
[HttpPut("{id}")] | ||
public void Put(int id, [FromBody] string value) | ||
{ | ||
} | ||
|
||
// DELETE api/values/5 | ||
[HttpDelete("{id}")] | ||
public void Delete(int id) | ||
{ | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters