Skip to content

Instantly share code, notes, and snippets.

@tocalai
Created July 12, 2019 01:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tocalai/df1d6db2e0cd3d0fb7a78c953c1b3f9b to your computer and use it in GitHub Desktop.
Save tocalai/df1d6db2e0cd3d0fb7a78c953c1b3f9b to your computer and use it in GitHub Desktop.
inherit AlertServiceBase for writing customize logic
// 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