Created
July 12, 2019 01:27
-
-
Save tocalai/df1d6db2e0cd3d0fb7a78c953c1b3f9b to your computer and use it in GitHub Desktop.
inherit AlertServiceBase for writing customize logic
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
// inherit AlertServiceBase | |
public class AlertServiceImpl : AlertService.AlertServiceBase | |
{ | |
// write customize logic for the method | |
public override Task<AlertResponse> SendAlert(AlertRequest request, ServerCallContext context) | |
{ | |
// print out want we recieved from request | |
Console.WriteLine($"[Alert Request], {request.DateTime}, Uid = {request.Uid}, Message = {request.MsgValue}."); | |
// do something .... and response | |
var response = new AlertResponse() | |
{ | |
Ack = request.Uid, | |
ReturnCode = ReturCodeEnum.Checking.ToString(), | |
}; | |
return Task.FromResult(response); | |
} | |
} | |
public enum ReturCodeEnum | |
{ | |
Release, | |
Checking, | |
Reboot, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment