package org.jim.common.packets;

/**
 * 撤销消息请求体
 * @author Darren
 * @date 2020/2/12 16:58
 */
public class CancelMessageReqBody extends Message  {

    /**
     * 发送用户id;
     */
    private String from;
    /**
     * 消息状态 0:正常消息 1:撤销消息
     */
    private Integer msgState;
    /**
     * 消息发到哪个群组;
     */
    private String group_id;
    /**
     * 聊天类型;(如公聊、私聊)
     */
    private Integer chatType;

    private CancelMessageReqBody() {
    }

    private CancelMessageReqBody(String from, Integer msgState, String group_id, Integer chatType) {
        this.from = from;
        this.msgState = msgState;
        this.group_id = group_id;
        this.chatType = chatType;
    }

    public static CancelMessageReqBody.Builder newBuilder(){
        return new CancelMessageReqBody.Builder();
    }

    public String getGroup_id() {
        return group_id;
    }

    public CancelMessageReqBody setGroup_id(String group_id) {
        this.group_id = group_id;
        return this;
    }

    public Integer getChatType() {
        return chatType;
    }

    public CancelMessageReqBody setChatType(Integer chatType) {
        this.chatType = chatType;
        return this;
    }

    public String getFrom() {
        return from;
    }

    public CancelMessageReqBody setFrom(String from) {
        this.from = from;
        return this;
    }

    public Integer getMsgState() {
        return msgState;
    }

    public CancelMessageReqBody setMsgState(Integer msgState) {
        this.msgState = msgState;
        return this;
    }

    public static class Builder extends Message.Builder<CancelMessageReqBody, CancelMessageReqBody.Builder> {

        /**
         * 发送用户id;
         */
        private String from;
        /**
         * 消息状态 0:正常消息 1:撤销消息
         */
        private Integer msgState;
        /**
         * 消息发到哪个群组;
         */
        private String group_id;
        /**
         * 聊天类型;(如公聊、私聊)
         */
        private Integer chatType;

        public Builder(){};

        public Builder setFrom(String from) {
            this.from = from;
            return this;
        }

        public Builder setMsgState(Integer msgState) {
            this.msgState = msgState;
            return this;
        }

        public Builder setGroup_id(String group_id) {
            this.group_id = group_id;
            return this;
        }

        public Builder setChatType(Integer chatType) {
            this.chatType = chatType;
            return this;
        }

        @Override
        protected Builder getThis() {
            return this;
        }

        @Override
        public CancelMessageReqBody build() {
            return new CancelMessageReqBody(this.from, this.msgState, this.group_id, this.chatType);
        }
    }


}
