Search in sources :

Example 6 with Data

use of io.github.ihongs.serv.matrix.Data in project HongsCORE by ihongs.

the class DataAction method getEntity.

/**
 * 获取模型对象
 * 注意:
 *  对象 Action 注解的命名必须为 "模型路径/实体名称"
 *  方法 Action 注解的命名只能是 "动作名称", 不得含子级实体名称
 * @param helper
 * @return
 * @throws HongsException
 */
@Override
public IEntity getEntity(ActionHelper helper) throws HongsException {
    ActionRunner runner = (ActionRunner) helper.getAttribute(ActionRunner.class.getName());
    Data entity = Data.getInstance(runner.getModule(), runner.getEntity());
    String userId = (String) helper.getSessibute(Cnst.UID_SES);
    // if  (  userId == null  ) userId = Cnst.ADM_GID; // 禁止匿名
    entity.setUserId(userId);
    return entity;
}
Also used : ActionRunner(io.github.ihongs.action.ActionRunner) Data(io.github.ihongs.serv.matrix.Data)

Aggregations

Data (io.github.ihongs.serv.matrix.Data)6 ActionRunner (io.github.ihongs.action.ActionRunner)3 Action (io.github.ihongs.action.anno.Action)2 SearchAction (io.github.ihongs.dh.search.SearchAction)2 Method (java.lang.reflect.Method)2 Map (java.util.Map)2 SelectHelper (io.github.ihongs.action.SelectHelper)1 CommitSuccess (io.github.ihongs.action.anno.CommitSuccess)1 Set (java.util.Set)1