package net.yyc.common.ding.entity;


import net.yyc.common.ding.config.DingConfig;
import net.yyc.common.ding.sign.AccessSign;
import net.yyc.common.ding.utils.SignUtils;
import lombok.Data;

import java.util.HashMap;

@Data
public class EmployAccountQueryRequest extends CommonRequest{

	private static final String PATH = "/oapi/v1/employ/account/query";

	public EmployAccountQueryRequest(
			DingConfig config) {

		String serviceSign = null;
		try {
			//签名
			serviceSign = SignUtils.serviceSign(PATH, config.getAppSecret(),
					"POST", new HashMap<>(), new byte[0]);
		} catch (Exception e) {
			e.printStackTrace();
		}

		this.body = "";
		this.sign = new AccessSign(config.getAppId(),serviceSign);
		this.queryUrl = String.format("%s%s", config.getQueryUrl(), PATH);
	}


}
