updall httpClient and pool
This commit is contained in:
parent
555a4b65b9
commit
323766a218
@ -1,178 +1,219 @@
|
||||
<mxfile host="65bd71144e">
|
||||
<diagram id="OUCQybPowJdnNh2YIqGc" name="第 1 页">
|
||||
<mxGraphModel dx="1173" dy="766" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||
<mxGraphModel dx="880" dy="766" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0"/>
|
||||
<mxCell id="1" parent="0"/>
|
||||
<mxCell id="2" value="" style="ellipse;html=1;shape=startState;fillColor=#000000;strokeColor=#ff0000;" vertex="1" parent="1">
|
||||
<mxGeometry x="399" y="70" width="30" height="30" as="geometry"/>
|
||||
<mxCell id="2" value="" style="ellipse;html=1;shape=startState;fillColor=#000000;strokeColor=#ff0000;" parent="1" vertex="1">
|
||||
<mxGeometry x="388" y="260" width="30" height="30" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="3" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;" edge="1" source="2" parent="1" target="5">
|
||||
<mxCell id="3" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;" parent="1" source="2" target="5" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="414" y="250" as="targetPoint"/>
|
||||
<mxPoint x="403" y="440" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="4" value="创建订单" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="3">
|
||||
<mxCell id="4" value="创建订单" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="3" vertex="1" connectable="0">
|
||||
<mxGeometry x="-0.1879" y="-1" relative="1" as="geometry">
|
||||
<mxPoint as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="5" value="未支付" style="rounded=1;whiteSpace=wrap;html=1;arcSize=40;fontColor=#000000;fillColor=#ffffc0;strokeColor=#ff0000;" vertex="1" parent="1">
|
||||
<mxGeometry x="354" y="180" width="120" height="40" as="geometry"/>
|
||||
<mxCell id="5" value="未支付" style="rounded=1;whiteSpace=wrap;html=1;arcSize=40;fontColor=#000000;fillColor=#ffffc0;strokeColor=#ff0000;" parent="1" vertex="1">
|
||||
<mxGeometry x="343" y="370" width="120" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="6" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" source="5" parent="1" target="8">
|
||||
<mxCell id="6" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="5" target="8" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="414" y="350" as="targetPoint"/>
|
||||
<mxPoint x="462" y="540" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="7" value="支付" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="6">
|
||||
<mxCell id="7" value="支付" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="6" vertex="1" connectable="0">
|
||||
<mxGeometry x="-0.2513" y="-1" relative="1" as="geometry">
|
||||
<mxPoint x="1" y="13" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="8" value="已支付" style="rounded=1;whiteSpace=wrap;html=1;arcSize=40;fontColor=#000000;fillColor=#ffffc0;strokeColor=#ff0000;" vertex="1" parent="1">
|
||||
<mxGeometry x="354" y="320" width="120" height="40" as="geometry"/>
|
||||
<mxCell id="8" value="已支付" style="rounded=1;whiteSpace=wrap;html=1;arcSize=40;fontColor=#000000;fillColor=#ffffc0;strokeColor=#ff0000;" parent="1" vertex="1">
|
||||
<mxGeometry x="343" y="490" width="120" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="9" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;" edge="1" source="8" parent="1" target="14">
|
||||
<mxCell id="9" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;exitX=0;exitY=0.25;exitDx=0;exitDy=0;entryX=1;entryY=0.25;entryDx=0;entryDy=0;" parent="1" source="8" target="14" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="240" y="400" as="targetPoint"/>
|
||||
<mxPoint x="288" y="590" as="targetPoint"/>
|
||||
<mxPoint x="343" y="510" as="sourcePoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="10" value="申请开票" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="9">
|
||||
<mxCell id="10" value="申请开票" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="9" vertex="1" connectable="0">
|
||||
<mxGeometry x="-0.2606" relative="1" as="geometry">
|
||||
<mxPoint x="-7" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="13" value="" style="ellipse;html=1;shape=endState;fillColor=#000000;strokeColor=#ff0000;" vertex="1" parent="1">
|
||||
<mxGeometry x="300" y="680" width="30" height="30" as="geometry"/>
|
||||
<mxCell id="13" value="" style="ellipse;html=1;shape=endState;fillColor=#000000;strokeColor=#ff0000;" parent="1" vertex="1">
|
||||
<mxGeometry x="388" y="595" width="30" height="30" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="14" value="待开票" style="rounded=1;whiteSpace=wrap;html=1;arcSize=40;fontColor=#000000;fillColor=#ffffc0;strokeColor=#ff0000;" vertex="1" parent="1">
|
||||
<mxGeometry x="165" y="410" width="120" height="40" as="geometry"/>
|
||||
<mxCell id="14" value="待开票" style="rounded=1;whiteSpace=wrap;html=1;arcSize=40;fontColor=#000000;fillColor=#ffffc0;strokeColor=#ff0000;" parent="1" vertex="1">
|
||||
<mxGeometry x="129" y="490" width="120" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="15" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;" edge="1" source="14" parent="1" target="17">
|
||||
<mxCell id="15" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" parent="1" source="14" target="17" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="225" y="540" as="targetPoint"/>
|
||||
<mxPoint x="273" y="730" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="16" value="同意开票" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="15">
|
||||
<mxCell id="16" value="同意开票" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="15" vertex="1" connectable="0">
|
||||
<mxGeometry x="-0.2741" y="1" relative="1" as="geometry">
|
||||
<mxPoint as="offset"/>
|
||||
<mxPoint x="-1" y="8" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="17" value="已开票" style="rounded=1;whiteSpace=wrap;html=1;arcSize=40;fontColor=#000000;fillColor=#ffffc0;strokeColor=#ff0000;" vertex="1" parent="1">
|
||||
<mxGeometry x="165" y="550" width="120" height="40" as="geometry"/>
|
||||
<mxCell id="17" value="已开票" style="rounded=1;whiteSpace=wrap;html=1;arcSize=40;fontColor=#000000;fillColor=#ffffc0;strokeColor=#ff0000;" parent="1" vertex="1">
|
||||
<mxGeometry x="129" y="590" width="120" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="18" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" source="17" parent="1" target="13">
|
||||
<mxCell id="18" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="17" target="13" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="225" y="650" as="targetPoint"/>
|
||||
<Array as="points">
|
||||
<mxPoint x="225" y="695"/>
|
||||
</Array>
|
||||
<mxPoint x="273" y="840" as="targetPoint"/>
|
||||
<Array as="points"/>
|
||||
<mxPoint x="299" y="800" as="sourcePoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="19" value="下载发票" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="18">
|
||||
<mxCell id="19" value="下载发票" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="18" vertex="1" connectable="0">
|
||||
<mxGeometry x="-0.2583" y="-1" relative="1" as="geometry">
|
||||
<mxPoint x="1" y="-7" as="offset"/>
|
||||
<mxPoint x="-12" y="-1" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="21" value="开票失败" style="rounded=1;whiteSpace=wrap;html=1;arcSize=40;fontColor=#000000;fillColor=#ffffc0;strokeColor=#ff0000;" vertex="1" parent="1">
|
||||
<mxGeometry x="10" y="470" width="120" height="40" as="geometry"/>
|
||||
<mxCell id="21" value="开票失败" style="rounded=1;whiteSpace=wrap;html=1;arcSize=40;fontColor=#000000;fillColor=#ffffc0;strokeColor=#ff0000;" parent="1" vertex="1">
|
||||
<mxGeometry x="129" y="370" width="120" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="22" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=0.75;entryY=0;entryDx=0;entryDy=0;" edge="1" source="14" parent="1" target="21">
|
||||
<mxCell id="22" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;exitX=0.75;exitY=0;exitDx=0;exitDy=0;entryX=0.75;entryY=1;entryDx=0;entryDy=0;" parent="1" source="14" target="21" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="430" y="560" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="23" value="不同意开票" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="22">
|
||||
<mxGeometry x="-0.1415" y="-1" relative="1" as="geometry">
|
||||
<mxPoint x="3" y="1" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="25" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;entryX=0.25;entryY=0;entryDx=0;entryDy=0;exitX=0.25;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="21" target="14">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="430" y="560" as="targetPoint"/>
|
||||
<mxPoint x="295" y="440" as="sourcePoint"/>
|
||||
<mxPoint x="478" y="750" as="targetPoint"/>
|
||||
<Array as="points">
|
||||
<mxPoint x="40" y="380"/>
|
||||
<mxPoint x="195" y="380"/>
|
||||
<mxPoint x="219" y="410"/>
|
||||
<mxPoint x="219" y="410"/>
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="26" value="再次申请开票" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="25">
|
||||
<mxCell id="23" value="不同意开票" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="22" vertex="1" connectable="0">
|
||||
<mxGeometry x="-0.1415" y="-1" relative="1" as="geometry">
|
||||
<mxPoint x="19" y="-1" as="offset"/>
|
||||
<mxPoint x="-1" y="13" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="27" value="待退款" style="rounded=1;whiteSpace=wrap;html=1;arcSize=40;fontColor=#000000;fillColor=#ffffc0;strokeColor=#ff0000;" vertex="1" parent="1">
|
||||
<mxGeometry x="354" y="440" width="120" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="28" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" source="27" parent="1" target="32">
|
||||
<mxCell id="25" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;exitX=0.25;exitY=1;exitDx=0;exitDy=0;entryX=0.25;entryY=0;entryDx=0;entryDy=0;" parent="1" source="21" target="14" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="414" y="510" as="targetPoint"/>
|
||||
<mxPoint x="149" y="580" as="targetPoint"/>
|
||||
<mxPoint x="79" y="440" as="sourcePoint"/>
|
||||
<Array as="points">
|
||||
<mxPoint x="159" y="460"/>
|
||||
<mxPoint x="159" y="460"/>
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="34" value="同意退款" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="28">
|
||||
<mxCell id="26" value="再次申请开票" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="25" vertex="1" connectable="0">
|
||||
<mxGeometry x="-0.1415" y="-1" relative="1" as="geometry">
|
||||
<mxPoint x="5" y="-1" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="27" value="待退款" style="rounded=1;whiteSpace=wrap;html=1;arcSize=40;fontColor=#000000;fillColor=#ffffc0;strokeColor=#ff0000;" parent="1" vertex="1">
|
||||
<mxGeometry x="579" y="490" width="120" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="28" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" parent="1" source="27" target="32" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="462" y="700" as="targetPoint"/>
|
||||
<mxPoint x="579" y="650" as="sourcePoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="34" value="同意退款" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="28" vertex="1" connectable="0">
|
||||
<mxGeometry x="-0.2333" y="-2" relative="1" as="geometry">
|
||||
<mxPoint x="-2" y="3" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="30" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="8" target="27">
|
||||
<mxCell id="30" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;movable=1;resizable=1;rotatable=1;deletable=1;editable=1;connectable=1;exitX=1;exitY=0.75;exitDx=0;exitDy=0;entryX=0;entryY=0.75;entryDx=0;entryDy=0;" parent="1" source="8" target="27" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="424" y="520" as="targetPoint"/>
|
||||
<mxPoint x="424" y="460" as="sourcePoint"/>
|
||||
<Array as="points">
|
||||
<mxPoint x="414" y="390"/>
|
||||
<mxPoint x="414" y="390"/>
|
||||
</Array>
|
||||
<mxPoint x="499" y="550" as="targetPoint"/>
|
||||
<mxPoint x="669" y="570" as="sourcePoint"/>
|
||||
<Array as="points"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="31" value="申请退款" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="30">
|
||||
<mxCell id="31" value="申请退款" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="30" vertex="1" connectable="0">
|
||||
<mxGeometry x="0.2333" relative="1" as="geometry">
|
||||
<mxPoint as="offset"/>
|
||||
<mxPoint x="-28" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="32" value="已退款" style="rounded=1;whiteSpace=wrap;html=1;arcSize=40;fontColor=#000000;fillColor=#ffffc0;strokeColor=#ff0000;" vertex="1" parent="1">
|
||||
<mxGeometry x="354" y="550" width="120" height="40" as="geometry"/>
|
||||
<mxCell id="32" value="已退款" style="rounded=1;whiteSpace=wrap;html=1;arcSize=40;fontColor=#000000;fillColor=#ffffc0;strokeColor=#ff0000;" parent="1" vertex="1">
|
||||
<mxGeometry x="579" y="590" width="120" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="33" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" source="32" parent="1" target="13">
|
||||
<mxCell id="33" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;entryX=1;entryY=0.5;entryDx=0;entryDy=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="32" target="13" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="414" y="640" as="targetPoint"/>
|
||||
<Array as="points">
|
||||
<mxPoint x="414" y="695"/>
|
||||
</Array>
|
||||
<mxPoint x="462" y="830" as="targetPoint"/>
|
||||
<Array as="points"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="35" value="退款到账" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="33">
|
||||
<mxCell id="35" value="退款到账" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="33" vertex="1" connectable="0">
|
||||
<mxGeometry x="0.0112" y="3" relative="1" as="geometry">
|
||||
<mxPoint x="-3" y="-41" as="offset"/>
|
||||
<mxPoint x="30" y="-3" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="36" value="退款失败" style="rounded=1;whiteSpace=wrap;html=1;arcSize=40;fontColor=#000000;fillColor=#ffffc0;strokeColor=#ff0000;" vertex="1" parent="1">
|
||||
<mxGeometry x="580" y="510" width="120" height="40" as="geometry"/>
|
||||
<mxCell id="36" value="退款失败" style="rounded=1;whiteSpace=wrap;html=1;arcSize=40;fontColor=#000000;fillColor=#ffffc0;strokeColor=#ff0000;" parent="1" vertex="1">
|
||||
<mxGeometry x="579" y="370" width="120" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="37" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0.25;entryY=0;entryDx=0;entryDy=0;" edge="1" source="27" parent="1" target="36">
|
||||
<mxCell id="37" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;exitX=0.75;exitY=0;exitDx=0;exitDy=0;entryX=0.75;entryY=1;entryDx=0;entryDy=0;" parent="1" source="27" target="36" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="640" y="610" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="38" value="拒绝退款" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="37">
|
||||
<mxGeometry x="-0.4012" y="2" relative="1" as="geometry">
|
||||
<mxPoint as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="40" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;entryX=0.75;entryY=0;entryDx=0;entryDy=0;exitX=0.75;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="36" target="27">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="650" y="520" as="targetPoint"/>
|
||||
<mxPoint x="690" y="400" as="sourcePoint"/>
|
||||
<mxPoint x="688" y="800" as="targetPoint"/>
|
||||
<Array as="points">
|
||||
<mxPoint x="670" y="400"/>
|
||||
<mxPoint x="444" y="400"/>
|
||||
<mxPoint x="669" y="460"/>
|
||||
<mxPoint x="669" y="460"/>
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="41" value="再次申请退款" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="40">
|
||||
<mxCell id="38" value="拒绝退款" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="37" vertex="1" connectable="0">
|
||||
<mxGeometry x="-0.4012" y="2" relative="1" as="geometry">
|
||||
<mxPoint x="-75" y="-2" as="offset"/>
|
||||
<mxPoint x="2" y="-16" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="40" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;entryX=0.25;entryY=0;entryDx=0;entryDy=0;exitX=0.25;exitY=1;exitDx=0;exitDy=0;" parent="1" source="36" target="27" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="698" y="710" as="targetPoint"/>
|
||||
<mxPoint x="738" y="590" as="sourcePoint"/>
|
||||
<Array as="points">
|
||||
<mxPoint x="609" y="470"/>
|
||||
<mxPoint x="609" y="470"/>
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="41" value="再次申请退款" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="40" vertex="1" connectable="0">
|
||||
<mxGeometry x="-0.4012" y="2" relative="1" as="geometry">
|
||||
<mxPoint x="-12" y="16" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="43" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;movable=1;resizable=1;rotatable=1;deletable=1;editable=1;connectable=1;entryX=1;entryY=0.25;entryDx=0;entryDy=0;exitX=0;exitY=0.25;exitDx=0;exitDy=0;" edge="1" parent="1" source="27" target="8">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="442" y="640" as="targetPoint"/>
|
||||
<mxPoint x="539" y="500" as="sourcePoint"/>
|
||||
<Array as="points">
|
||||
<mxPoint x="539" y="500"/>
|
||||
<mxPoint x="539" y="500"/>
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="44" value="撤销申请退款" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="43">
|
||||
<mxGeometry x="0.2333" relative="1" as="geometry">
|
||||
<mxPoint x="12" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="45" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;entryX=0;entryY=0.75;entryDx=0;entryDy=0;exitX=1;exitY=0.75;exitDx=0;exitDy=0;" edge="1" parent="1" source="14" target="8">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="349" y="610" as="targetPoint"/>
|
||||
<mxPoint x="359" y="550" as="sourcePoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="46" value="撤销申请开票" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="45">
|
||||
<mxGeometry x="-0.2606" relative="1" as="geometry">
|
||||
<mxPoint x="6" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="49" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="8" target="13">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="413" y="500" as="targetPoint"/>
|
||||
<mxPoint x="413" y="420" as="sourcePoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="50" value="不支持开发票" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="49">
|
||||
<mxGeometry x="-0.2513" y="-1" relative="1" as="geometry">
|
||||
<mxPoint x="1" y="6" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
</root>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<mxfile host="65bd71144e">
|
||||
<diagram id="PZYBk4sDCuIX38xMYcUk" name="第 1 页">
|
||||
<mxGraphModel dx="751" dy="766" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||
<mxGraphModel dx="880" dy="766" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0"/>
|
||||
<mxCell id="1" parent="0"/>
|
||||
@ -8,28 +8,28 @@
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="2" value="标记有RateLimiter注解的方法会被RateLimiterAspect拦截" style="html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="160" y="80" width="380" height="50" as="geometry"/>
|
||||
<mxGeometry x="224" y="80" width="380" height="50" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="6" value="" style="edgeStyle=none;html=1;" parent="1" source="3" target="5" edge="1">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="3" value="获取注解上的时间和次数" style="html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="160" y="150" width="380" height="50" as="geometry"/>
|
||||
<mxGeometry x="224" y="150" width="380" height="50" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="8" value="" style="edgeStyle=none;html=1;" parent="1" source="5" target="7" edge="1">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="5" value="&nbsp;通过拼接{KEY}-{IP/USERID/DEPTID}-{ClassName}-{MethodName}形成rediskey" style="html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="100" y="230" width="500" height="50" as="geometry"/>
|
||||
<mxGeometry x="164" y="230" width="500" height="50" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="10" value="" style="edgeStyle=none;html=1;" parent="1" source="7" target="9" edge="1">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="7" value="通过redisTemplate.excute来检测time时间内最大请求次数" style="html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="100" y="310" width="500" height="50" as="geometry"/>
|
||||
<mxGeometry x="164" y="310" width="500" height="50" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="9" value="通过返回的number再次确认请求次数" style="html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="100" y="390" width="500" height="50" as="geometry"/>
|
||||
<mxGeometry x="164" y="390" width="500" height="50" as="geometry"/>
|
||||
</mxCell>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
|
@ -0,0 +1,324 @@
|
||||
package com.ruoyi.common.utils.http;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.client.ClientProtocolException;
|
||||
import org.apache.http.client.config.RequestConfig;
|
||||
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.conn.ssl.DefaultHostnameVerifier;
|
||||
import org.apache.http.conn.util.PublicSuffixMatcher;
|
||||
import org.apache.http.conn.util.PublicSuffixMatcherLoader;
|
||||
import org.apache.http.entity.ContentType;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
|
||||
public class HttpClientUtil {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(HttpClientUtil.class);
|
||||
/**
|
||||
* 默认参数设置
|
||||
* setConnectTimeout:设置连接超时时间,单位毫秒。
|
||||
* setConnectionRequestTimeout:设置从connect Manager获取Connection 超时时间,单位毫秒。
|
||||
* setSocketTimeout:请求获取数据的超时时间,单位毫秒。访问一个接口,多少时间内无法返回数据,就直接放弃此次调用。 暂时定义15分钟
|
||||
*/
|
||||
private static RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(600000)
|
||||
.setConnectTimeout(600000)
|
||||
.setConnectionRequestTimeout(600000).build();
|
||||
|
||||
private static CloseableHttpClient client = SpringUtils.getBean("closeableHttpClient");
|
||||
|
||||
/**
|
||||
* 发送 post请求
|
||||
*
|
||||
* @param httpUrl 地址
|
||||
*/
|
||||
public static String sendHttpPost(String httpUrl) {
|
||||
HttpPost httpPost = new HttpPost(httpUrl);// 创建httpPost
|
||||
return sendHttpPost(httpPost);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送 post请求
|
||||
*
|
||||
* @param httpUrl 地址
|
||||
* @param params 参数(格式:key1=value1&key2=value2)
|
||||
*/
|
||||
public static String sendHttpPost(String httpUrl, String params) {
|
||||
HttpPost httpPost = new HttpPost(httpUrl);// 创建httpPost
|
||||
try {
|
||||
// 设置参数
|
||||
StringEntity stringEntity = new StringEntity(params, "UTF-8");
|
||||
stringEntity.setContentType("application/x-www-form-urlencoded");
|
||||
httpPost.setEntity(stringEntity);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return sendHttpPost(httpPost);
|
||||
}
|
||||
|
||||
public static String sendHttpPost(String httpUrl, Object object) {
|
||||
HttpPost httpPost = new HttpPost(httpUrl);// 创建httpPost
|
||||
String jsonString = JSON.toJSONString(object);
|
||||
httpPost.setHeader("Accept", ContentType.APPLICATION_JSON.getMimeType());
|
||||
httpPost.setHeader("Content-Type", ContentType.APPLICATION_JSON.getMimeType());
|
||||
log.debug(jsonString);
|
||||
try {
|
||||
|
||||
// 设置参数
|
||||
StringEntity stringEntity = new StringEntity(jsonString, ContentType.APPLICATION_JSON);
|
||||
|
||||
httpPost.setEntity(stringEntity);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return sendHttpPost(httpPost);
|
||||
}
|
||||
|
||||
public static String sendHttpPost(String httpUrl, Object data, Map<String, String> headersMap) {
|
||||
HttpPost httpPost = new HttpPost(httpUrl);// 创建httpPost
|
||||
String jsonString = JSON.toJSONString(data);
|
||||
httpPost.setHeader("Accept", ContentType.APPLICATION_JSON.getMimeType());
|
||||
httpPost.setHeader("Content-Type", ContentType.APPLICATION_JSON.getMimeType());
|
||||
for (String keySet : headersMap.keySet()) {
|
||||
httpPost.setHeader(keySet, headersMap.get(keySet));
|
||||
}
|
||||
log.debug(jsonString);
|
||||
try {
|
||||
// 设置参数
|
||||
StringEntity stringEntity = new StringEntity(jsonString, ContentType.APPLICATION_JSON);
|
||||
|
||||
httpPost.setEntity(stringEntity);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return sendHttpPost(httpPost);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送 post请求
|
||||
*
|
||||
* @param httpUrl 地址
|
||||
* @param maps 参数
|
||||
*/
|
||||
public static String sendHttpPost(String httpUrl, Map<String, String> maps) {
|
||||
HttpPost httpPost = new HttpPost(httpUrl);// 创建httpPost
|
||||
// 创建参数队列
|
||||
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
|
||||
for (String key : maps.keySet()) {
|
||||
nameValuePairs.add(new BasicNameValuePair(key, maps.get(key)));
|
||||
}
|
||||
try {
|
||||
httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs, "UTF-8"));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return sendHttpPost(httpPost);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送 get请求
|
||||
*
|
||||
* @param httpUrl
|
||||
*/
|
||||
public static String sendHttpGet(String httpUrl) {
|
||||
HttpGet httpGet = new HttpGet(httpUrl);// 创建get请求
|
||||
return sendHttpGet(httpGet);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送 get请求Https
|
||||
*
|
||||
* @param httpUrl
|
||||
*/
|
||||
public static String sendHttpsGet(String httpUrl) {
|
||||
HttpGet httpGet = new HttpGet(httpUrl);// 创建get请求
|
||||
return sendHttpsGet(httpGet);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送Post请求
|
||||
*
|
||||
* @param httpPost
|
||||
* @return
|
||||
*/
|
||||
private static String sendHttpPost(HttpPost httpPost) {
|
||||
CloseableHttpClient httpClient = null;
|
||||
CloseableHttpResponse response = null;
|
||||
HttpEntity entity = null;
|
||||
String responseContent = null;
|
||||
try {
|
||||
// 创建默认的httpClient实例
|
||||
// httpClient = HttpClients.createDefault();
|
||||
httpPost.setConfig(requestConfig);
|
||||
// 执行请求
|
||||
long execStart = System.currentTimeMillis();
|
||||
response = client.execute(httpPost);
|
||||
long execEnd = System.currentTimeMillis();
|
||||
log.debug("=================执行post请求耗时:" + (execEnd - execStart) + "ms");
|
||||
long getStart = System.currentTimeMillis();
|
||||
entity = response.getEntity();
|
||||
responseContent = EntityUtils.toString(entity, "UTF-8");
|
||||
long getEnd = System.currentTimeMillis();
|
||||
log.debug("=================获取响应结果耗时:" + (getEnd - getStart) + "ms");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
// 关闭连接,释放资源
|
||||
if (response != null) {
|
||||
response.close();
|
||||
}
|
||||
if (httpClient != null) {
|
||||
httpClient.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return responseContent;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送Get请求
|
||||
*
|
||||
* @param httpGet
|
||||
* @return
|
||||
*/
|
||||
private static String sendHttpGet(HttpGet httpGet) {
|
||||
CloseableHttpClient httpClient = null;
|
||||
CloseableHttpResponse response = null;
|
||||
HttpEntity entity = null;
|
||||
String responseContent = null;
|
||||
try {
|
||||
// 创建默认的httpClient实例.
|
||||
|
||||
httpGet.setConfig(requestConfig);
|
||||
// 执行请求
|
||||
response = client.execute(httpGet);
|
||||
entity = response.getEntity();
|
||||
responseContent = EntityUtils.toString(entity, "UTF-8");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
// 关闭连接,释放资源
|
||||
if (response != null) {
|
||||
response.close();
|
||||
}
|
||||
if (httpClient != null) {
|
||||
httpClient.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return responseContent;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送Get请求Https
|
||||
*
|
||||
* @param httpGet
|
||||
* @return
|
||||
*/
|
||||
private static String sendHttpsGet(HttpGet httpGet) {
|
||||
CloseableHttpClient httpClient = null;
|
||||
CloseableHttpResponse response = null;
|
||||
HttpEntity entity = null;
|
||||
String responseContent = null;
|
||||
try {
|
||||
// 创建默认的httpClient实例.
|
||||
PublicSuffixMatcher publicSuffixMatcher = PublicSuffixMatcherLoader
|
||||
.load(new URL(httpGet.getURI().toString()));
|
||||
DefaultHostnameVerifier hostnameVerifier = new DefaultHostnameVerifier(publicSuffixMatcher);
|
||||
httpClient = HttpClients.custom().setSSLHostnameVerifier(hostnameVerifier).build();
|
||||
httpGet.setConfig(requestConfig);
|
||||
// 执行请求
|
||||
response = httpClient.execute(httpGet);
|
||||
entity = response.getEntity();
|
||||
responseContent = EntityUtils.toString(entity, "UTF-8");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
// 关闭连接,释放资源
|
||||
if (response != null) {
|
||||
response.close();
|
||||
}
|
||||
if (httpClient != null) {
|
||||
httpClient.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return responseContent;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送xml数据
|
||||
*
|
||||
* @param url
|
||||
* @param xmlData
|
||||
* @return
|
||||
* @throws ClientProtocolException
|
||||
* @throws IOException
|
||||
*/
|
||||
public static HttpResponse sendXMLDataByPost(String url, String xmlData)
|
||||
throws ClientProtocolException, IOException {
|
||||
|
||||
HttpPost httppost = new HttpPost(url);
|
||||
StringEntity entity = new StringEntity(xmlData);
|
||||
httppost.setEntity(entity);
|
||||
httppost.setHeader("Content-Type", "text/xml;charset=UTF-8");
|
||||
HttpResponse response = client.execute(httppost);
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得响应HTTP实体内容
|
||||
*
|
||||
* @param response
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @throws UnsupportedEncodingException
|
||||
*/
|
||||
public static String getHttpEntityContent(HttpResponse response) throws IOException, UnsupportedEncodingException {
|
||||
HttpEntity entity = response.getEntity();
|
||||
if (entity != null) {
|
||||
InputStream is = entity.getContent();
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
|
||||
String line = br.readLine();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
while (line != null) {
|
||||
sb.append(line + "\n");
|
||||
line = br.readLine();
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
@ -1,22 +1,39 @@
|
||||
package com.ruoyi.framework.config;
|
||||
|
||||
import com.ruoyi.common.utils.Threads;
|
||||
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
import javax.net.ssl.SSLContext;
|
||||
|
||||
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
|
||||
import org.apache.http.config.Registry;
|
||||
import org.apache.http.config.RegistryBuilder;
|
||||
import org.apache.http.conn.socket.ConnectionSocketFactory;
|
||||
import org.apache.http.conn.socket.PlainConnectionSocketFactory;
|
||||
import org.apache.http.conn.ssl.NoopHostnameVerifier;
|
||||
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
|
||||
import org.apache.http.conn.ssl.TrustStrategy;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
|
||||
import org.apache.http.ssl.SSLContextBuilder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
|
||||
import com.ruoyi.common.utils.Threads;
|
||||
|
||||
/**
|
||||
* 线程池配置
|
||||
*
|
||||
* @author ruoyi
|
||||
**/
|
||||
@Configuration
|
||||
public class ThreadPoolConfig
|
||||
{
|
||||
public class ThreadPoolConfig {
|
||||
// 核心线程池大小
|
||||
private int corePoolSize = 50;
|
||||
|
||||
@ -30,8 +47,7 @@ public class ThreadPoolConfig
|
||||
private int keepAliveSeconds = 300;
|
||||
|
||||
@Bean(name = "threadPoolTaskExecutor")
|
||||
public ThreadPoolTaskExecutor threadPoolTaskExecutor()
|
||||
{
|
||||
protected ThreadPoolTaskExecutor threadPoolTaskExecutor() {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
executor.setMaxPoolSize(maxPoolSize);
|
||||
executor.setCorePoolSize(corePoolSize);
|
||||
@ -46,18 +62,43 @@ public class ThreadPoolConfig
|
||||
* 执行周期性或定时任务
|
||||
*/
|
||||
@Bean(name = "scheduledExecutorService")
|
||||
protected ScheduledExecutorService scheduledExecutorService()
|
||||
{
|
||||
protected ScheduledExecutorService scheduledExecutorService() {
|
||||
return new ScheduledThreadPoolExecutor(corePoolSize,
|
||||
new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build(),
|
||||
new ThreadPoolExecutor.CallerRunsPolicy())
|
||||
{
|
||||
new ThreadPoolExecutor.CallerRunsPolicy()) {
|
||||
@Override
|
||||
protected void afterExecute(Runnable r, Throwable t)
|
||||
{
|
||||
protected void afterExecute(Runnable r, Throwable t) {
|
||||
super.afterExecute(r, t);
|
||||
Threads.printException(r, t);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Bean(name = "closeableHttpClient")
|
||||
protected CloseableHttpClient closeableHttpClient() throws Exception {
|
||||
SSLContextBuilder sslContextBuilder = new SSLContextBuilder();
|
||||
sslContextBuilder.loadTrustMaterial(null, new TrustStrategy() {
|
||||
// 信任所有
|
||||
@Override
|
||||
public boolean isTrusted(X509Certificate[] chain,
|
||||
String authType) throws CertificateException {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
SSLContext sslContext = sslContextBuilder.build();
|
||||
SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory(sslContext,
|
||||
new String[] { "SSLv2Hello", "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2" },
|
||||
null, NoopHostnameVerifier.INSTANCE);
|
||||
Registry<ConnectionSocketFactory> register = null;
|
||||
register = RegistryBuilder.<ConnectionSocketFactory>create()
|
||||
.register("http", PlainConnectionSocketFactory.INSTANCE)
|
||||
.register("https", socketFactory).build();
|
||||
HttpClientBuilder custom = HttpClients.custom();
|
||||
PoolingHttpClientConnectionManager pool = new PoolingHttpClientConnectionManager(register);
|
||||
pool.setMaxTotal(maxPoolSize);
|
||||
// // 默认的每个路由的最大连接数
|
||||
pool.setDefaultMaxPerRoute(corePoolSize);
|
||||
custom.setConnectionManager(pool);
|
||||
return custom.build();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user