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