Skip to main content
Glama
06.参数校验.md557 B
--- title: "参数校验" date: "2022-01-29T20:52:10.000Z" permalink: "/pages/base/validate/" --- # 自动验证 如图所示,可验证必填,表达式验证和正则验证。 # 手动验证 对于表达式和正则无法实现的可以通过脚本来实现。 var count = db.selectInt(""" select count(*) from sys_user where phone = #{phone} """) // count 值应该为0,如果不为0则验证不予通过。 assert count == 0 : 400, '手机号已存在'; // 上述写法可以转换为 if(count != 0){ exit 400, '手机号已存在' }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Dwsy/magic-api-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server