com.dounine.clouddisk360.parser.CaptchaParser Maven / Gradle / Ivy
package com.dounine.clouddisk360.parser;
import java.net.URISyntaxException;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.dounine.clouddisk360.annotation.Parse;
import com.dounine.clouddisk360.parser.deserializer.captcha.Captcha;
import com.dounine.clouddisk360.parser.deserializer.captcha.CaptchaConst;
import com.dounine.clouddisk360.parser.deserializer.captcha.CaptchaParameter;
import com.dounine.clouddisk360.parser.deserializer.captcha.CaptchaRequestInterceptor;
import com.dounine.clouddisk360.parser.deserializer.captcha.CaptchaResponseHandle;
import com.dounine.clouddisk360.parser.deserializer.login.LoginUserToken;
@Parse("验证码")
public class CaptchaParser extends
BaseParser {
public CaptchaParser(){}
public CaptchaParser(LoginUserToken loginUser) {
super(loginUser);
}
private static final Logger LOGGER = LoggerFactory.getLogger(CaptchaParser.class);
public HttpGet initRequest(CaptchaParameter parameter) {
try {
URIBuilder uri = new URIBuilder(CONST.URI_PATH);
uri.addParameter(CONST.SRC_KEY, CONST.SRC_VAL);
uri.addParameter(CONST.FROM_KEY, CONST.FROM_VAL);
uri.addParameter(CONST.CHARSET_KEY, CONST.CHARSET_VAL);
uri.addParameter(CONST.REQUESTSCEMA_KEY, CONST.REQUESTSCEMA_VAL);
uri.addParameter(CONST.O_KEY, CONST.O_VAL);
uri.addParameter(CONST.M_KEY, CONST.M_VAL);
uri.addParameter(CONST.ACCOUNT_NAME, httpClientContext.getUserToken(LoginUserToken.class).getAccount());
uri.addParameter(CONST.CAPTCHAAPP_KEY, CONST.CAPTCHAAPP_VAL);
HttpGet request = new HttpGet(uri.build());
return request;
} catch (URISyntaxException e) {
LOGGER.error("生成验证码请求对象失败");
}
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy