use of app.hongs.action.anno.Preset in project HongsCORE by ihongs.
the class DBAction method update.
@Action("update")
@Preset(conf = "", form = "", deft = { ":update" })
@Verify(conf = "", form = "")
@CommitSuccess
@Override
public void update(ActionHelper helper) throws HongsException {
Model ett = getEntity(helper);
Map req = helper.getRequestData();
req = getReqMap(helper, ett, "update", req);
int num = ett.update(req);
String msg = getRspMsg(helper, ett, "update", num);
helper.reply(msg, num);
}
use of app.hongs.action.anno.Preset in project HongsCORE by ihongs.
the class SearchAction method search.
@Action("search")
@Preset(conf = "", form = "")
@Select(conf = "", form = "")
@Spread(conf = "", form = "")
@Override
public void search(ActionHelper helper) throws HongsException {
/**
* 有指定查询条件则按匹配度排序
*/
Map rd = helper.getRequestData();
Object wd = rd.get(Cnst.WD_KEY);
if (null != wd && "".equals(wd)) {
List ob = Synt.asList(rd.get(Cnst.OB_KEY));
if (ob == null) {
ob = new ArrayList();
rd.put(Cnst.OB_KEY, ob);
ob.add(0, "-");
} else if (!ob.contains("-")) {
ob.add(0, "-");
}
}
super.search(helper);
}
use of app.hongs.action.anno.Preset in project HongsCORE by ihongs.
the class SignAction method userCreate.
/**
* 注册
* @param ah
* @throws app.hongs.HongsException
*/
@Action("user/create")
@Preset(conf = "master", form = "mine")
@Verify(conf = "master", form = "mine")
public void userCreate(ActionHelper ah) throws HongsException {
Map rd = ah.getRequestData();
User uo = (User) DB.getInstance("master").getModel("user");
Map sd = uo.create(rd);
// 提取登录信息
String usrid = Synt.declare(sd.get("id"), "");
String uname = Synt.declare(sd.get("name"), "");
String uhead = Synt.declare(sd.get("head"), "");
long utime = Synt.declare(sd.get("mtime"), 0L) * 1000;
String appid = Synt.declare(ah.getParameter("appid"), "_WEB_");
// 赋予公共权限
sd = new HashMap();
sd.put("user_id", usrid);
sd.put("role", "public");
uo.db.getTable("user_role").insert(sd);
// 加入公共部门
sd = new HashMap();
sd.put("user_id", usrid);
sd.put("dept_id", "PUBLIC");
uo.db.getTable("user_dept").insert(sd);
ah.reply(AuthKit.userSign(ah, null, appid, usrid, uname, uhead, utime));
}
use of app.hongs.action.anno.Preset in project HongsCORE by ihongs.
the class DBAction method search.
@Action("search")
@Preset(conf = "", form = "")
@Select(conf = "", form = "")
@Override
public void search(ActionHelper helper) throws HongsException {
Model ett = getEntity(helper);
Map req = helper.getRequestData();
req = getReqMap(helper, ett, "search", req);
Map rsp = ett.search(req);
rsp = getRspMap(helper, ett, "search", rsp);
helper.reply(rsp);
}
use of app.hongs.action.anno.Preset in project HongsCORE by ihongs.
the class DBAction method delete.
@Action("delete")
@Preset(conf = "", form = "", deft = { ":delete" })
@CommitSuccess
@Override
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);
}
Aggregations