2
liusuyi
2026-05-12 9b5c9db9189493fbc6db48f55a7b7311b2a3253c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package com.ard.work.sdk.zlxd.netty.message.request;
 
import lombok.Data;
 
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
 
/**
 * 所有XML请求的公共父类
 * 提取公共属性和通用Header结构
 */
@Data
@XmlAccessorType(XmlAccessType.FIELD)
public class BaseXmlRequest {
 
    /**
     * 公共版本号属性
     */
    @XmlAttribute(name = "Version")
    private String version = "1.0";
 
    /**
     * 公共Header结构
     */
    @XmlElement(name = "Header")
    private Header header;
 
    // 公共Header内部类
    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Header {
        @XmlAttribute(name = "Message_Type")
        private String messageType;
 
        @XmlAttribute(name = "Sequence_Number")
        private int sequenceNumber;
 
        @XmlAttribute(name = "Session_ID")
        private String sessionId;
 
        @XmlAttribute(name = "Source_ID")
        private String sourceId;
 
        @XmlAttribute(name = "Destination_ID")
        private String destinationId;
 
        public Header() {}
 
        public Header(String messageType, int sequenceNumber, String sessionId, String sourceId, String destinationId) {
            this.messageType = messageType;
            this.sequenceNumber = sequenceNumber;
            this.sessionId = sessionId;
            this.sourceId = sourceId;
            this.destinationId = destinationId;
        }
    }
}