Pil0tXia commented on code in PR #3893: URL: https://github.com/apache/eventmesh/pull/3893#discussion_r1575612556
########## eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/header/message/BaseSendMsgRequestHeader.java: ########## @@ -0,0 +1,234 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.common.protocol.http.header.message; + +import org.apache.eventmesh.common.Constants; +import org.apache.eventmesh.common.protocol.http.common.ProtocolKey; +import org.apache.eventmesh.common.protocol.http.common.ProtocolVersion; +import org.apache.eventmesh.common.protocol.http.header.Header; + +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; + +import java.util.HashMap; +import java.util.Map; + +/** + * Base class of {@link SendMessageRequestHeader}, {@link SendMessageBatchRequestHeader} + * and {@link SendMessageBatchV2RequestHeader} + * + */ +public abstract class BaseSendMsgRequestHeader extends Header { + + //request code + private String code; + + //requester language description + private String language; + + //protocol version adopted by requester, default:1.0 + private ProtocolVersion version; + + //protocol type, cloudevents or eventmeshMessage + private String protocolType; + + //protocol version, cloudevents:1.0 or 0.3 + private String protocolVersion; + + //protocol desc + private String protocolDesc; + + //the environment number of the requester + private String env; + + //the IDC of the requester + private String idc; + + //subsystem of the requester + private String sys; + + //PID of the requester + private String pid; + + //IP of the requester + private String ip; + + //USERNAME of the requester + private String username; + + //PASSWD of the requester + private String passwd; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPasswd() { + return passwd; + } + + public void setPasswd(String passwd) { + this.passwd = passwd; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getLanguage() { + return language; + } + + public void setLanguage(String language) { + this.language = language; + } Review Comment: How about using the `@Data` annotation to save space on those getters and setters? ########## eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/header/message/BaseSendMsgRequestHeader.java: ########## @@ -0,0 +1,234 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.eventmesh.common.protocol.http.header.message; + +import org.apache.eventmesh.common.Constants; +import org.apache.eventmesh.common.protocol.http.common.ProtocolKey; +import org.apache.eventmesh.common.protocol.http.common.ProtocolVersion; +import org.apache.eventmesh.common.protocol.http.header.Header; + +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; + +import java.util.HashMap; +import java.util.Map; + +/** + * Base class of {@link SendMessageRequestHeader}, {@link SendMessageBatchRequestHeader} + * and {@link SendMessageBatchV2RequestHeader} + * + */ +public abstract class BaseSendMsgRequestHeader extends Header { + + //request code + private String code; Review Comment: How about using the `AbstractSendMsgRequestHeader` naming, to match the naming of other classes? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@eventmesh.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@eventmesh.apache.org For additional commands, e-mail: issues-h...@eventmesh.apache.org