arthur.wu ae3894879b Fixed compile error for deploy tool | hai 1 ano | |
---|---|---|
Tools | hai 1 ano | |
src | hai 1 ano | |
.gitignore | hai 1 ano | |
Clear-Not-Recommended.ps1 | %!s(int64=2) %!d(string=hai) anos | |
Publish.ps1 | hai 1 ano | |
README.md | %!s(int64=3) %!d(string=hai) anos | |
clone&pull tool.bat | hai 1 ano |
Wing is an JsonRPC service framework
The project structure is shown below
Service publishing and registry
The service framework is used for registration and is run by the AppWorkerCenter invocation
using AppFramework.JsonRpc.Driver;
using System.Threading.Tasks;
using TestRpc.Entity;
namespace TestRpc.Service
{
public interface INewService
{
Task<int> Add(AddRequest request);
}
}
using AppFramework.JsonRpc.Driver.Validator;
using System.Text.Json.Serialization;
namespace TestRpc.Entity
{
public class AddRequest
{
public string A { get; set; }
public string B { get; set; }
}
}
using AppFramework.JsonRpc.Driver;
using System.Threading.Tasks;
using TestRpc.Entity;
namespace TestRpc.Service
{
public class NewService : BaseRpcService, INewService
{
public async Task<int> Add(AddRequest request)
{
var result = int.Parse(request.A)+int.Parse(request.B);
return await Task.FromResult(result);
}
}
}
using AppFramework.Common.Loader;
using System;
using TestRpc.Service;
namespace TestRpc.ServiceLoader
{
public class NewServiceLoader : IServiceLoader
{
public object CreateService()
{
return new NewService();
}
public Type GetServiceType()
{
return typeof(INewService);
}
}
}
cd AppWorkerCenter/WingCloudServer
dotnet build
copy ../TestRpc.dll AppWorkerCenter/WingCloudServer/bin/Debug/net5.0/NetService/TestRpc.dll
dotnet run
Automatic service restart
SMS sending program
Static file server
Email template