<commit_before>package app.hongs.db;

import app.hongs.Cnst;
import app.hongs.CoreLocale;
import app.hongs.HongsException;
import app.hongs.HongsExpedient;
import app.hongs.action.ActionHelper;
import app.hongs.action.ActionRunner;
import app.hongs.action.FormSet;
import app.hongs.action.anno.Action;
import app.hongs.action.anno.CommitSuccess;
import app.hongs.action.anno.Preset;
import app.hongs.action.anno.Select;
import app.hongs.action.anno.Verify;
import app.hongs.db.util.FetchCase;
import app.hongs.dh.IActing;
import app.hongs.dh.IAction;
import app.hongs.util.Dict;
import app.hongs.util.Synt;
import java.util.List;
import java.util.Map;

/**
 * 基础数据动作
 * @author Hongs
 */
@Action("hongs/db")
public class DBAction implements IAction, IActing {

    @Override
    public void acting(ActionHelper helper, ActionRunner runner) throws HongsException {
        String act = runner.getHandle();
        String ent = runner.getEntity();
        String mod = runner.getModule();

        try {
            // 下划线开头的为内部资源, 不直接对外开放
            if (ent.startsWith("_")) {
                throw new HongsException(0x1100, "Unsupported Request!");
            }

            // 判断是否禁用了当前动作, 忽略表单不存在
            if (Dict.getValue( FormSet.getInstance( mod ).getForm( ent ),
                false, "@", "deny.call." + act)) {
                throw new HongsException(0x1100, "Unsupported Request.");
            }
        }<commit_msg>修改动作禁止的表单配置规则<commit_after>package app.hongs.db;

import app.hongs.Cnst;
import app.hongs.CoreLocale;
import app.hongs.HongsException;
import app.hongs.HongsExpedient;
import app.hongs.action.ActionHelper;
import app.hongs.action.ActionRunner;
import app.hongs.action.FormSet;
import app.hongs.action.anno.Action;
import app.hongs.action.anno.CommitSuccess;
import app.hongs.action.anno.Preset;
import app.hongs.action.anno.Select;
import app.hongs.action.anno.Verify;
import app.hongs.db.util.FetchCase;
import app.hongs.dh.IActing;
import app.hongs.dh.IAction;
import app.hongs.util.Dict;
import app.hongs.util.Synt;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 基础数据动作
 * @author Hongs
 */
@Action("hongs/db")
public class DBAction implements IAction, IActing {

    @Override
    public void acting(ActionHelper helper, ActionRunner runner) throws HongsException {
        String act = runner.getHandle();
        String ent = runner.getEntity();
        String mod = runner.getModule();

        try {
            // 下划线开头的为内部资源, 不直接对外开放
            if (ent.startsWith("_")) {
                throw new HongsException(0x1100, "Unsupported Request!");
            }

            // 判断是否禁用了当前动作, 忽略表单不存在
            Map fa  = FormSet.getInstance (mod).getForm (ent);
            Set ca  = Synt.toSet( Dict.getDepth( fa, "@", "callable" ) );
            if (ca != null && !ca.contains(act)) {
                throw new HongsException(0x1100, "Unsupported Request.");
            }
        }
{'fraction_non_alphanumeric': 0.1217450118363206, 'fraction_numerical': 0.006763611768684477, 'mean_word_length': 2.9178807947019867, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1365151', 'n_tokens_mistral': 1030, 'n_tokens_neox': 1046, 'n_words': 196}