use of io.github.ihongs.action.anno.CommitSuccess in project HongsCORE by ihongs.
the class SignAction method userCreate.
/**
* 注册
* @param ah
* @throws HongsException
*/
@Action("user/create")
@Verify(conf = "master", form = "regs", type = 0, trim = 1)
@CommitSuccess
public void userCreate(ActionHelper ah) throws HongsException {
CoreConfig cc = CoreConfig.getInstance("master");
if (!cc.getProperty("core.public.regs.open", true)) {
throw new HongsException(404, "Sign on is not allowed");
}
User uo = (User) DB.getInstance("master").getModel("user");
Map rd = ah.getRequestData();
String uuid = uo.create(rd);
String uname = Synt.declare(rd.get("name"), "");
String uhead = Synt.declare(rd.get("head"), "");
// 加入公共部门
Map sd = new HashMap();
sd.put("user_id", uuid);
sd.put("dept_id", cc.getProperty("core.public.regs.dept", "CENTRE"));
uo.db.getTable("dept_user").insert(sd);
// 赋予公共权限. 仅用部门即可(2019/02/28)
// Map sd = new HashMap();
// sd.put("user_id", uuid);
// sd.put("role" , cc.getProperty("core.public.regs.role", "centre"));
// uo.db.getTable("user_role").insert(sd);
// * 表示密码登录
Map ad = AuthKit.userSign(ah, "*", uuid, uname, uhead);
ah.reply(Synt.mapOf("info", ad));
}
use of io.github.ihongs.action.anno.CommitSuccess in project HongsCORE by ihongs.
the class DeptAction method doDelete.
@Action("delete")
@CommitSuccess
public void doDelete(ActionHelper helper) throws HongsException {
Map rd = helper.getRequestData();
int rn = model.delete(rd);
CoreLocale ln = CoreLocale.getInstance().clone();
ln.load("master");
String ms = ln.translate("core.delete.dept.success", null, Integer.toString(rn));
helper.reply(ms, rn);
}
use of io.github.ihongs.action.anno.CommitSuccess in project HongsCORE by ihongs.
the class FormAction method doDelete.
@Action("delete")
@CommitSuccess
public void doDelete(ActionHelper helper) throws HongsException {
Map rd = helper.getRequestData();
int rn = model.delete(rd);
CoreLocale ln = CoreLocale.getInstance().clone();
ln.load("matrix");
String ms = ln.translate("core.delete.form.success", null, Integer.toString(rn));
helper.reply(ms, rn);
}
use of io.github.ihongs.action.anno.CommitSuccess in project HongsCORE by ihongs.
the class UnitAction method doDelete.
@Action("delete")
@CommitSuccess
public void doDelete(ActionHelper helper) throws HongsException {
Map rd = helper.getRequestData();
int rn = model.delete(rd);
CoreLocale ln = CoreLocale.getInstance().clone();
ln.load("matrix");
String ms = ln.translate("core.delete.unit.success", null, Integer.toString(rn));
helper.reply(ms, rn);
}
use of io.github.ihongs.action.anno.CommitSuccess in project HongsCORE by ihongs.
the class UnitAction method doSave.
@Action("save")
@Verify(conf = "matrix", form = "unit")
@CommitSuccess
public void doSave(ActionHelper helper) throws HongsException {
Map rd = helper.getRequestData();
String id = model.set(rd);
CoreLocale lang = CoreLocale.getInstance().clone();
lang.load("matrix");
String ms = lang.translate("core.save.unit.success");
helper.reply(ms, id);
}
Aggregations