package com.yuchen.saas.park.api.dto.third;

import com.yuchen.saas.park.api.util.StringUtil;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @Author: baichaojie
 * @CreateTime: 2024/10/30 14:34
 * @Description: TODO
 * @Version: 1.0
 */
public class ThirdRequestDTO<T> {

    /**
     * API版本号
     */
    @NotBlank(message = "API版本号不能为空！")
    private String version;

    /**
     * 授权第三方的clientId
     */
    @NotBlank(message = "clientId不能为空！")
    private String clientId;

    /**
     * 请求的时间戳
     */
    @NotNull(message = "时间戳不能为空！")
    private Long timestamp;

    /**
     * 唯一随机数
     */
    @NotBlank(message = "随机数不能为空！")
    private String nonce;

    /**
     * 签名结果串
     */
    @NotBlank(message = "签名结果串不能为空！")
    private String signature;

    /**
     * 签名算法版本
     */
    @NotBlank(message = "签名算法版本号不能为空！")
    private String signatureVersion;

    /**
     * API自定义业务参数内容
     */
    @Valid
    private T data;

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getClientId() {
        return clientId;
    }

    public void setClientId(String clientId) {
        this.clientId = clientId;
    }

    public Long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Long timestamp) {
        this.timestamp = timestamp;
    }

    public String getNonce() {
        return nonce;
    }

    public void setNonce(String nonce) {
        this.nonce = nonce;
    }

    public String getSignature() {
        return signature;
    }

    public void setSignature(String signature) {
        this.signature = signature;
    }

    public String getSignatureVersion() {
        return signatureVersion;
    }

    public void setSignatureVersion(String signatureVersion) {
        this.signatureVersion = signatureVersion;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return StringUtil.objectToString(this);
    }
}
