package org.springblade.wx.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author: lianghanqiang
 * @description: 微信服务API
 * @since: 9/6/21 -- 8:05 PM
 */
@Getter
@AllArgsConstructor
public enum WeChatApi {

	/**
	 * 	小程序发送模板消息
	 * */
	sendTemplateMessage("https://api.weixin.qq.com/cgi-bin/message/subscribe/send","POST"),


	/**
	 * 获取用户AccessToken
	 * */
	fetchAccessToken("https://api.weixin.qq.com/cgi-bin/token","GET"),


	/**
	 * OCR-营业执照
	 */
	OCR_BIZLICENSE("https://api.weixin.qq.com/cv/ocr/bizlicense?img_url=%s&access_token=%s", "POST"),

	/**
	 * OCR-身份证
	 */
	OCR_ID_CARD("https://api.weixin.qq.com/cv/ocr/idcard?type=photo&img_url=%s&access_token=%s", "POST"),

	/**
	 * OCR-银行卡
	 */
	OCR_BANK("https://api.weixin.qq.com/cv/ocr/bankcard?type=MODE&img_url=%s&access_token=&s", "POST"),

	/**
	 * 获取小程序码api
	 */
	createWxaQrCode("https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=%s", "GET"),

	/**
	 * 	获取小程序码--无数量限制
	 * */
	getUnLimit("https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=%s","POST"),
	;

	String api;
	String requestMethods;

	public String buildUrl( String ... params){
		return String.format(this.api,params);
	}

}
