非主键唯一验证

https://doc.rg1008.com/docs/rg_dev/rg_dev-1eo8h6bpv1gek

{
  "rules": {
    "typeCode": [
      {
        "type": "required",
        "required": true,
        "isAdd": true,
        "isEdit": true,
        "message": "【{type_code}】值必须填写。"
      },
      {
        "type": "maxlength",
        "required": false,
        "isAdd": true,
        "isEdit": true,
        "max": 50,
        "message": "【{type_code}】值最大长度为50。"
      },
      {
        "type": "db", //remote db  远程验证 rule 和 sql必须填写;  db:sql必须填写
        "url": "~/bo/api/v3/remote/unique/{mkey}/{resField}?ownerId={ownerId}&sysId={sysId}&rule={rule}&{params}",
        "sql": "select count(type_id) from bs_msg_target where type_code=@typeCode",
        "isAdd": true,
        "isEdit": false,
        "message": "【{type_code}】已存在,可进入修改页面进行内容修改。"
      }
    ]
  }
}
文档更新时间: 2023-07-20 11:10   作者:admin