有很多字符串都是必填

    1. 'use strict';
    2. // 在文件中定义一下
    3. const requireString = RuleType.string().required();
    4. const maxString = (length) => RuleType.string().max(length);
    5. // 参数校验
    6. export class UserDAO {
    7. @Rule(requireString)
    8. name: string;
    9. @Rule(requireString)
    10. name: string;
    11. @Rule(requireString)
    12. name: string;
    13. @Rule(maxString(50))
    14. info: string;
    15. @Rule(maxString(200).required)
    16. remark: string;
    17. }