Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. // inherit AlertServiceBase
  2. public class AlertServiceImpl : AlertService.AlertServiceBase
  3. {
  4. // write customize logic for the method
  5. public override Task<AlertResponse> SendAlert(AlertRequest request, ServerCallContext context)
  6. {
  7. // print out want we recieved from request
  8. Console.WriteLine($"[Alert Request], {request.DateTime}, Uid = {request.Uid}, Message = {request.MsgValue}.");
  9.  
  10. // do something .... and response
  11. var response = new AlertResponse()
  12. {
  13. Ack = request.Uid,
  14. ReturnCode = ReturCodeEnum.Checking.ToString(),
  15. };
  16.  
  17. return Task.FromResult(response);
  18. }
  19. }
  20.  
  21.  
  22. public enum ReturCodeEnum
  23. {
  24. Release,
  25. Checking,
  26. Reboot,
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement