use of io.github.ihongs.action.anno.Preset in project HongsCORE by ihongs.
the class SearchAction method search.
@Action("search")
@Preset(conf = "", form = "")
@Select(conf = "", form = "")
@Override
public void search(ActionHelper helper) throws HongsException {
/**
* 有指定查询条件则按匹配度排序
*/
Map rd = helper.getRequestData();
Object wd = rd.get(Cnst.WD_KEY);
if (wd != null && !"".equals(wd)) {
Set xb = Synt.toTerms(rd.get(Cnst.OB_KEY));
List ob;
if (xb == null) {
ob = new ArrayList(1);
rd.put(Cnst.OB_KEY, ob);
ob.add(0, "-");
} else if (!xb.contains("-") && !xb.contains("*")) {
ob = new ArrayList(xb);
rd.put(Cnst.OB_KEY, ob);
ob.add(0, "-");
}
}
super.search(helper);
}
use of io.github.ihongs.action.anno.Preset in project HongsCORE by ihongs.
the class SearchAction method acount.
@Action("acount")
@Preset(conf = "", form = "")
@Titles(conf = "", form = "")
public void acount(ActionHelper helper) throws HongsException {
SearchEntity sr = (SearchEntity) getEntity(helper);
StatisHelper sh = new StatisHelper(sr);
Map rd = helper.getRequestData();
rd = getReqMap(helper, sr, "acount", rd);
// 检查参数
acheck(sr, rd, 1);
Map xd = sh.acount(rd);
Map sd = Synt.mapOf("enfo", xd);
sd = getRspMap(helper, sr, "acount", sd);
helper.reply(sd);
}
use of io.github.ihongs.action.anno.Preset in project HongsCORE by ihongs.
the class SearchAction method amount.
@Action("amount")
@Preset(conf = "", form = "")
@Titles(conf = "", form = "")
public void amount(ActionHelper helper) throws HongsException {
SearchEntity sr = (SearchEntity) getEntity(helper);
StatisHelper sh = new StatisHelper(sr);
Map rd = helper.getRequestData();
rd = getReqMap(helper, sr, "amount", rd);
// 检查参数
acheck(sr, rd, 2);
Map xd = sh.amount(rd);
Map sd = Synt.mapOf("enfo", xd);
sd = getRspMap(helper, sr, "amount", sd);
helper.reply(sd);
}
use of io.github.ihongs.action.anno.Preset in project HongsCORE by ihongs.
the class DBAction method delete.
@Override
@Action("delete")
@Preset(conf = "", form = "", defs = { ":defence" })
@CommitSuccess
public void delete(ActionHelper helper) throws HongsException {
Model ett = getEntity(helper);
Map req = helper.getRequestData();
req = getReqMap(helper, ett, "delete", req);
int num = ett.delete(req);
String msg = getRspMsg(helper, ett, "delete", num);
helper.reply(msg, num);
}
use of io.github.ihongs.action.anno.Preset in project HongsCORE by ihongs.
the class DBAction method create.
@Override
@Action("create")
@Preset(conf = "", form = "", defs = { ":initial" })
@Verify(conf = "", form = "")
@CommitSuccess
public void create(ActionHelper helper) throws HongsException {
Model ett = getEntity(helper);
Map req = helper.getRequestData();
req = getReqMap(helper, ett, "create", req);
String nid = ett.create(req);
String msg = getRspMsg(helper, ett, "create", 1);
helper.reply(msg, nid);
}
Aggregations