/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights reserved. <a>http://www.crunii.com</a>
 */
package com.crunii.micro.service.sysmgr.config;

import com.crunii.micro.common.captcha.MicroCaptcha;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

/**
 * @author 田平 create 2018年11月19日下午5:15:25
 */
@Configuration
public class SysmgrConfiguration {

	@Value("${captcha.width:120}")
	private int width;

	@Value("${captcha.height:40}")
	private int height;

	@Bean
	@Primary
	public MicroCaptcha confMicroCaptcha() throws Exception {
		MicroCaptcha captcha = new MicroCaptcha();
		captcha.afterPropertiesSet();
		captcha.setWidth(width);
		captcha.setHeight(height);
		return captcha;
	}
}
