use of app.hongs.action.anno.Action in project HongsCORE by ihongs.
the class MineAction method signInfo.
@Action("sign/info")
public void signInfo(ActionHelper ah) {
Map sd = new HashMap();
String sk = CoreConfig.getInstance().getProperty("core.api.ssid");
sd.put(sk, ah.getRequest().getRequestedSessionId());
sd.put(Cnst.UID_SES, ah.getSessibute(Cnst.UID_SES));
sd.put(Cnst.STM_SES, ah.getSessibute(Cnst.STM_SES));
sd.put(Cnst.SAE_SES, ah.getSessibute(Cnst.SAE_SES));
sd.put("appid", ah.getSessibute("appid"));
sd.put("uname", ah.getSessibute("uname"));
sd.put("uhead", ah.getSessibute("uhead"));
ah.reply("", sd);
}
use of app.hongs.action.anno.Action 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.Action in project HongsCORE by ihongs.
the class SignAction method userDelete.
/**
* 注销
* @param ah
*/
@Action("user/delete")
public void userDelete(ActionHelper ah) throws HongsException {
String uuid = (String) ah.getSessibute(Cnst.UID_SES);
if (null == uuid) {
ah.reply(AuthKit.getWrong(null, "core.sign.off.invalid"));
return;
}
User user = (User) DB.getInstance("master").getModel("user");
user.del(uuid);
signDelete(ah);
}
use of app.hongs.action.anno.Action in project HongsCORE by ihongs.
the class DeptAction method isUnique.
@Action("unique")
public void isUnique(ActionHelper helper) throws HongsException {
Map rd = helper.getRequestData();
FetchCase fc = model.fetchCase();
fc.setOption("INCLUDE_REMOVED", Synt.declare(rd.get("include-removed"), false));
boolean rv = model.unique(rd, fc);
helper.reply(null, rv ? 1 : 0);
}
use of app.hongs.action.anno.Action in project HongsCORE by ihongs.
the class DeptAction method doSave.
@Action("save")
@CommitSuccess
public void doSave(ActionHelper helper) throws HongsException {
Map rd = helper.getRequestData();
String id = model.set(rd);
rd = new HashMap();
rd.put("id", id);
rd.put("name", rd.get("name"));
CoreLocale ln = CoreLocale.getInstance().clone();
ln.load("master");
String ms = ln.translate("core.save.dept.success");
helper.reply(ms, rd);
}
Aggregations