package com.yonge.netty.dto;

import org.springframework.http.HttpStatus;

public class WebSocketResponse<T> {

	private Head header = new Head();

	private T body;

	public WebSocketResponse(Head header, T body) {
		this.header = header;
		this.body = body;
	}

	public WebSocketResponse(String command, T body) {
		this.header = new Head(command, HttpStatus.OK.value());
		this.body = body;
	}

	public Head getHeader() {
		return header;
	}

	public void setHeader(Head header) {
		this.header = header;
	}

	public T getBody() {
		return body;
	}

	public void setBody(T body) {
		this.body = body;
	}

	public static class Head {
		private int status = HttpStatus.OK.value();
		private String commond = "";

		public Head() {

		}

		public Head(String commond, int status) {
			this.commond = commond;
			this.status = status;
		}

		public int getStatus() {
			return status;
		}

		public void setStatus(int status) {
			this.status = status;
		}

		public String getCommond() {
			return commond;
		}

		public void setCommond(String commond) {
			this.commond = commond;
		}

	}
}
