|
@@ -10,6 +10,7 @@ import com.fdkankan.manage.common.FilePath;
|
|
|
import com.fdkankan.manage.httpClient.service.LaserService;
|
|
|
import com.fdkankan.manage.util.Dateutils;
|
|
|
import com.fdkankan.manage.util.RsaUtils;
|
|
|
+import com.fdkankan.rabbitmq.util.RabbitMqProducer;
|
|
|
import org.apache.http.HttpEntity;
|
|
|
import org.apache.http.HttpResponse;
|
|
|
import org.apache.http.client.methods.HttpPost;
|
|
@@ -27,29 +28,13 @@ import java.util.*;
|
|
|
@RestController
|
|
|
public class TestController {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ RabbitMqProducer rabbitMqProducer;
|
|
|
@RequestMapping("/test")
|
|
|
public ResultData test(){
|
|
|
+ rabbitMqProducer.sendByWorkQueue("fanout-exchange-iterrupt-calling","","xxxxxxx");
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
|
|
|
- public static void main(String[] args) throws IOException {
|
|
|
- String url = "http://192.168.0.25/service/manage/external/getByRyId";
|
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
- jsonObject.put("ryId","13800138001");
|
|
|
- String encipher = RsaUtils.encipher(jsonObject.toJSONString());
|
|
|
-
|
|
|
- HttpPost httpPost = new HttpPost(url);
|
|
|
- CloseableHttpClient client = HttpClients.createDefault();
|
|
|
- StringEntity entity = new StringEntity(encipher,"utf-8");
|
|
|
- entity.setContentEncoding("utf-8");
|
|
|
- entity.setContentType("application/json");
|
|
|
- httpPost.setEntity(entity);
|
|
|
- HttpResponse response = client.execute(httpPost);
|
|
|
- if(response.getStatusLine().getStatusCode() == 200){
|
|
|
- HttpEntity httpEntity = response.getEntity();
|
|
|
- String result = EntityUtils.toString(httpEntity, "utf-8");
|
|
|
- System.out.println(result);
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
}
|