package com.philisense.www.api.generator.impl;

import com.philisense.www.api.generator.VcodeGenerator;
import com.philisense.www.builder.PuzzleCaptchaBuilder;
import com.philisense.www.dto.PuzzleCaptcha;
import org.springframework.web.context.request.ServletWebRequest;

/**
 * 滑块验证码生成
 */
public class PuzzleCaptchaGenerator implements VcodeGenerator {

    private String imgResource;

    public PuzzleCaptchaGenerator(String imgResource) {
        this.imgResource = imgResource;
    }

    @Override
    public PuzzleCaptcha generate(ServletWebRequest request) {
        return new PuzzleCaptchaBuilder(imgResource).build();
    }
}
