package cn.hmsoft.weixin.request;

import cn.hmsoft.weixin.entity.response.TicketResponseJson;

/****************************************
 * @note 获取jsapi，并保存到数据库
 * @author revisit@126.com
 * @Company: www.hmsoft.cn
 * @create 2017-05-09 01:00:41
 * @version 4.0.0
 */
public class TicketGetRequest extends AbstractRequest<TicketResponseJson, TicketResponseJson, String> {

	private final static String url = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?";

	@Override
	protected String makeUrl() {
		return url + "access_token=" + this.wxDefine.getApp_accesstoken() + "&type=jsapi";
	}

	@Override
	public void processBusiness() {
		this.returnEntity = this.jsonEntity;
		this.wxDefine.setApp_jsapi(this.jsonEntity.getTicket());
	}

}
