package com.jfinal.club._admin.help;

import com.jfinal.aop.Inject;
import com.jfinal.club.my.doc.UsersDocService;
import com.jfinal.core.Controller;
import com.jfinal.validate.Validator;

/**
 * @ClassName DocAdminValidator
 * @Description TODO
 * @Author caolong
 * @Date 2020/3/25 14:36
 */
public class HelpAdminValidator extends Validator {

    @Inject
    UsersDocService usersDocService;

    @Override
    protected void validate(Controller c) {
        setShortCircuit(true);
        validateRequired("helps.name", "msg", "问题标题不能为空");
        validateRequired("helps.context", "msg", "问题描述不能为空");
    }


    @Override
    protected void handleError(Controller c) {
        c.renderJson();
    }
}
