MessageUtil.cs 831 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace NettyClient.proto
  7. {
  8. public class MessageUtil
  9. {
  10. //public static Message generateMessage(string cmd, int taskId, string content) {
  11. // Message msg = new Message();
  12. // msg.Cmd = cmd;
  13. // msg.TaskId = taskId;
  14. // msg.Content = content;
  15. // return msg;
  16. //}
  17. public static Google.Protobuf.WellKnownTypes.Message generateMessageStr(string cmd, string taskId, string content)
  18. {
  19. Google.Protobuf.WellKnownTypes.Message msg = new Google.Protobuf.WellKnownTypes.Message();
  20. msg.Cmd = cmd;
  21. msg.TaskId = taskId;
  22. msg.Content = content;
  23. return msg;
  24. }
  25. }
  26. }