17c2958b9c
Build and Deploy to Production / build-and-deploy (push) Successful in 1m37s
- Add AppVersion entity with CurrentVersion, MinRequiredVersion, RequiresFullCacheClear - Add GetAppVersion query to check app version and compare with client version - Add GetAllAppVersions query for admin panel - Add UpdateAppVersion command to update/create app versions - Add appversion.proto for gRPC communication - Add AppVersionService for gRPC endpoints - Add database migration for AppVersions table
33 lines
1.4 KiB
C#
33 lines
1.4 KiB
C#
using CMSMicroservice.Protobuf.Protos.AppVersion;
|
|
using CMSMicroservice.WebApi.Common.Services;
|
|
using CMSMicroservice.Application.AppVersionCQ.Queries.GetAppVersion;
|
|
using CMSMicroservice.Application.AppVersionCQ.Queries.GetAllAppVersions;
|
|
using CMSMicroservice.Application.AppVersionCQ.Commands.UpdateAppVersion;
|
|
|
|
namespace CMSMicroservice.WebApi.Services;
|
|
|
|
public class AppVersionService : AppVersionContract.AppVersionContractBase
|
|
{
|
|
private readonly IDispatchRequestToCQRS _dispatchRequestToCQRS;
|
|
|
|
public AppVersionService(IDispatchRequestToCQRS dispatchRequestToCQRS)
|
|
{
|
|
_dispatchRequestToCQRS = dispatchRequestToCQRS;
|
|
}
|
|
|
|
public override async Task<GetAppVersionResponse> GetAppVersion(GetAppVersionRequest request, ServerCallContext context)
|
|
{
|
|
return await _dispatchRequestToCQRS.Handle<GetAppVersionRequest, GetAppVersionQuery, GetAppVersionResponse>(request, context);
|
|
}
|
|
|
|
public override async Task<Empty> UpdateAppVersion(UpdateAppVersionRequest request, ServerCallContext context)
|
|
{
|
|
return await _dispatchRequestToCQRS.Handle<UpdateAppVersionRequest, UpdateAppVersionCommand>(request, context);
|
|
}
|
|
|
|
public override async Task<GetAllAppVersionsResponse> GetAllAppVersions(GetAllAppVersionsRequest request, ServerCallContext context)
|
|
{
|
|
return await _dispatchRequestToCQRS.Handle<GetAllAppVersionsRequest, GetAllAppVersionsQuery, GetAllAppVersionsResponse>(request, context);
|
|
}
|
|
}
|