package com.jzdsh.auto.app.controller.admin.mvalidator;

import com.jfinal.core.Controller;
import com.jfinal.kit.Ret;
import com.jfinal.validate.Validator;
import com.jzdsh.auto.model.BsType;

/**
 * @ProjectName: auto
 * @Package: com.jzdsh.auto.app.controller.admin.mvalidator
 * @ClassName: AdminBsTypeValidator
 * @Author: Jzdsh
 * @Description:
 * @Date: 2020/3/26 15:42
 * @Version: 1.0
 */
public class AdminBsTypeValidator extends Validator {


    @Override
    protected void validate(Controller c) {
        setShortCircuit(true);
        setRet(Ret.fail());
        validateRequiredString("bsType.status","msg","请选择类型");
        validateRequiredString("bsType.title","msg","请填写类型标题");

    }

    @Override
    protected void handleError(Controller c) {
        c.keepModel(BsType.class);
        c.renderJson(getRet());
    }
}
