public IActionResult Add(string Exchange, string Topic)
 {
     if (string.IsNullOrWhiteSpace(Topic))
     {
         return(Json(new { Success = false, Message = "请选择一个Topic!" }));
     }
     MessageCenterManager.Add(Exchange, Topic);
     return(Json(new { Success = true, Message = "订阅成功!" }));
 }
Beispiel #2
0
 public IActionResult AddConsumer([FromBody] ApiRequestModel <string> requestModel)
 {
     if (VerifyRequestModel(requestModel))
     {
         var exchange_topic = requestModel.Data;
         var et             = exchange_topic.Split('&', StringSplitOptions.RemoveEmptyEntries);
         if (string.IsNullOrWhiteSpace(exchange_topic))
         {
             return(Json(new { Success = false, Message = "请选择一个Topic!" }));
         }
         MessageCenterManager.Add(et[0], et[1]);
         return(Json(new { Success = true, Message = "订阅成功!" }));
     }
     return(Json(new { Success = false, Message = "非法请求" }));
 }