package com.validator;

import com.jfinal.core.Controller;
import com.jfinal.validate.Validator;
import com.model.Notice;

import java.util.HashMap;
import java.util.Map;

public class PeriodicalValidator extends Validator {
	
	protected void validate(Controller controller) {
		validateRequiredString("bean.issn", "isbnMsg", "请输入issn!");
		validateRequiredString("bean.kanming", "titleMsg", "请输入刊名!");
	}
	
	protected void handleError(Controller controller) {
		controller.keepModel(Notice.class);
		String actionKey = getActionKey();
		Map result = new HashMap();
		result.put("code","101");
		result.put("msg","参数不完整");
		controller.renderJson(result);

	}
}
