| | |
| | | import org.apache.http.impl.client.DefaultHttpClient; |
| | | import org.apache.http.message.BasicNameValuePair; |
| | | import org.apache.http.util.EntityUtils; |
| | | import org.example.mexcclient.MexcClientApplication; |
| | | import org.example.mexcclient.pojo.Currency; |
| | | import org.example.mexcclient.server.impl.CurrencySerivceImpl; |
| | | import org.example.mexcclient.wsClient.MexcClient; |
| | |
| | | import org.json.JSONObject; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Qualifier; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.context.ConfigurableApplicationContext; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
| | |
| | | List<Currency> sublist = mexc.subList(fromIndex, toIndex); |
| | | |
| | | // 使用自定义线程池提交任务 |
| | | threadPoolTaskExecutor.execute(new MexcClient(sublist)::start); |
| | | threadPoolTaskExecutor.execute(() -> { |
| | | new MexcClient(sublist).start(); |
| | | }); |
| | | } |
| | | |
| | | } |