|
|
|
@ -1,6 +1,8 @@ |
|
|
|
|
package web.controller; |
|
|
|
|
|
|
|
|
|
import core.thrift.FactoryPool; |
|
|
|
|
import core.thrift.MyAsyncMethodCallback; |
|
|
|
|
import core.thrift.comment.QueryComment; |
|
|
|
|
import db.form.DBAction; |
|
|
|
|
import db.model.bilibili.DataModel; |
|
|
|
|
import org.apache.commons.io.FileUtils; |
|
|
|
@ -22,6 +24,7 @@ import web.html.data.DataTable; |
|
|
|
|
import web.model.DataModelForm; |
|
|
|
|
import web.service.DataService; |
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import java.io.File; |
|
|
|
|
import java.io.IOException; |
|
|
|
|
import java.nio.charset.Charset; |
|
|
|
@ -36,6 +39,9 @@ public class DataController extends TableController<DataModel, DataModelForm, Da |
|
|
|
|
|
|
|
|
|
private static final String key = "regionJson"; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private FactoryPool factoryPool; |
|
|
|
|
|
|
|
|
|
public DataController() throws IOException { |
|
|
|
|
super(); |
|
|
|
|
} |
|
|
|
@ -51,9 +57,9 @@ public class DataController extends TableController<DataModel, DataModelForm, Da |
|
|
|
|
@RequestMapping(value = "count/{cid}") |
|
|
|
|
public Integer count(@PathVariable int cid) { |
|
|
|
|
try { |
|
|
|
|
MyAsyncMethodCallback<Integer> call = new MyAsyncMethodCallback<>(); |
|
|
|
|
// TTransportUtil.doExecute(client -> client.commentSum(cid, call),QueryComment.AsyncClient.class);
|
|
|
|
|
return call.getResult(); |
|
|
|
|
MyAsyncMethodCallback<Integer> result=new MyAsyncMethodCallback<>(); |
|
|
|
|
factoryPool.doExecute(QueryComment.Client.class, (client, aBoolean) ->result.setResult(client.commentSum(cid)),result); |
|
|
|
|
return result.getResult(); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error(e); |
|
|
|
|
} |
|
|
|
|