package com.ym.mec.collectfee.entity;

import com.thoughtworks.xstream.annotations.XStreamAlias;

import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.SimpleTimeZone;

@XStreamAlias("head")
public class RequestHead {

    //消息编号，不可重复
    private String msgId;

    //交易指令
    private Integer cmd;

    //调用接口的用户id
    private Integer uid = 102;

    //请求时间戳，yyyymmddhhmmss
    private String ts;

    //响应数据类别，xml
    private String ret = "xml";

    //加密类型 0不加密（默认），1DES加密，2专用算法1，3专用算法2，4DES加密（Ansi版, ECB模式，PKCS5）
    private Integer encrypt = 0;

    //签名
    private String sign;

    public RequestHead() {
        String format = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"));
        setTs(format);
    }

    public String getMsgId() {
        return msgId;
    }

    public void setMsgId(String msgId) {
        this.msgId = msgId;
    }

    public Integer getCmd() {
        return cmd;
    }

    public void setCmd(Integer cmd) {
        this.cmd = cmd;
    }

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public String getTs() {
        return ts;
    }

    public void setTs(String ts) {
        this.ts = ts;
    }

    public String getRet() {
        return ret;
    }

    public void setRet(String ret) {
        this.ret = ret;
    }

    public Integer getEncrypt() {
        return encrypt;
    }

    public void setEncrypt(Integer encrypt) {
        this.encrypt = encrypt;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }
}
