You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.3 KiB
35 lines
1.3 KiB
2 years ago
|
package com.fr.plugin.utils;
|
||
|
|
||
|
import com.fr.plugin.yt.MyCoreDBAccess;
|
||
|
import com.fr.plugin.dao.MyAgentDao;
|
||
|
import com.fr.plugin.entitys.YTAgentEntity;
|
||
|
import com.fr.stable.db.action.DBAction;
|
||
|
import com.fr.stable.db.dao.DAOContext;
|
||
|
import com.fr.stable.query.QueryFactory;
|
||
|
import com.fr.stable.query.restriction.RestrictionFactory;
|
||
|
|
||
|
import java.util.List;
|
||
|
|
||
|
public class MyAgentUtils {
|
||
|
public static String getAgentIdBySecret(String var9, String var10) {
|
||
|
|
||
|
return "";
|
||
|
}
|
||
|
public static List<YTAgentEntity> getAgentsSortedByTimeStamp() throws Exception {
|
||
|
return (List) MyCoreDBAccess.getAccessor().runQueryAction(new DBAction<List<YTAgentEntity>>() {
|
||
|
public List<YTAgentEntity> run(DAOContext var1) throws Exception {
|
||
|
return ((MyAgentDao)var1.getDAO(MyAgentDao.class)).find(QueryFactory.create().addSort("timeStamp", true));
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
public static YTAgentEntity getAgentById(String agentId) throws Exception {
|
||
|
return MyCoreDBAccess.getAccessor().runQueryAction(new DBAction<YTAgentEntity>() {
|
||
|
public YTAgentEntity run(DAOContext var1) throws Exception {
|
||
|
return var1.getDAO(MyAgentDao.class).findOne(QueryFactory.create().addRestriction(RestrictionFactory.eq("id",agentId)));
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
}
|