// Path: loader/web/netloader-web/src/main/java/com/lcxbox/common/model/LcxlNetCode.java
// public class LcxlNetCode {
// 
// 	public final static String JSON_CODE = "code";
// 	public final static int JC_NONE = 0x00;
// 	/**
// 	 * 获取模块列表命令
// 	 */
// 	public final static int JC_MODULE_LIST = 0x01;
// 	/**
// 	 * 获取服务器列表
// 	 */
// 	public final static int JC_SERVER_LIST = 0x03;
// 	/**
// 	 * 设置虚拟IP地址
// 	 */
// 	public final static int JC_SET_VIRTUAL_ADDR = 0x04;
// 	/**
// 	 * 添加服务器
// 	 */
// 	public final static int JC_ADD_SERVER  = 0x05;
// 	/**
// 	 * 设置服务器
// 	 */
// 	public final static int JC_SET_SERVER  = 0x06;
// 	/**
// 	 * 删除服务器
// 	 */
// 	public final static int JC_DEL_SERVER = 0x07;
// 	
// 	public final static int JC_LOGON = 0x10;
// 	
// 	public final static String JSON_DATA = "data";
// 	public final static String JSON_MODULE_LIST = "module_list";
// 	public final static String JSON_SERVER_LIST = "server_list";
// 	public final static String JSON_MINIPORT_NET_LUID = "miniport_net_luid";
// 
// 	public final static String JSON_STATUS ="status";
// 	public final static int JS_SUCCESS =0x00;
// 	public final static int JS_FAIL =0x01;
// 	public final static int JS_JSON_DATA_NOT_FOUND =0x02;
// 	public final static int JS_JSON_CODE_NOT_FOUND =0x03;
// 	public final static int JS_JSON_CODE_IP_FORMAT_INVALID =0x04;
// 	public final static int JS_UNKNOWN_HOST = 0x10;
// 	public final static int JS_SOCKET_ERROR = 0x11;
// }
// 
// Path: loader/web/netloader-web/src/main/java/com/lcxbox/netloader/user/model/LogonRequest.java
// public class LogonRequest extends CommonRequest {
// 	private String username;
// 	private String password;
// 	public String getUsername() {
// 		return username;
// 	}
// 	public void setUsername(String username) {
// 		this.username = username;
// 	}
// 	public String getPassword() {
// 		return password;
// 	}
// 	public void setPassword(String password) {
// 		this.password = password;
// 	}
// 	
// }
// 
// Path: loader/web/netloader-web/src/main/java/com/lcxbox/netloader/user/model/LogonRespnse.java
// public class LogonRespnse extends CommonResponse {
// 
// }
// 
// Path: loader/web/netloader-web/src/main/java/com/lcxbox/socket/json/SocketRequest.java
// public class SocketRequest {
// 	public static <T> T jsonRequest(String host, int port, Object request, Class<T> responseCls) throws UnknownHostException, IOException {
// 		ObjectMapper  objectMapper = new ObjectMapper();
// 		
// 		JsonSocket sock = new JsonSocket(host, port);
// 		ByteArrayOutputStream os = new ByteArrayOutputStream();
// 		objectMapper.getJsonFactory().createJsonGenerator(os, JsonEncoding.UTF16_LE).writeObject(request);
// 		String ret = new String(sock.sendData(os.toByteArray()),"UTF-16LE");
// 		os.close();
// 		sock.close();
// 		return objectMapper.readValue(ret, responseCls);
// 	}
// }


import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.net.SocketException;
import java.net.UnknownHostException;
import org.springframework.stereotype.Service;
import com.lcxbox.common.model.LcxlNetCode;
import com.lcxbox.netloader.user.model.LogonRequest;
import com.lcxbox.netloader.user.model.LogonRespnse;
import com.lcxbox.socket.json.SocketRequest;
package com.lcxbox.netloader.user.service;




@Service()
public class UserServiceImpl implements IUserService {

	public LogonRespnse logon(String host, Integer port, String username,
			String password) throws IOException {
		// TODO Auto-generated method stub
// Path: loader/web/netloader-web/src/main/java/com/lcxbox/common/model/LcxlNetCode.java
// public class LcxlNetCode {
// 
// 	public final static String JSON_CODE = "code";
// 	public final static int JC_NONE = 0x00;
// 	/**
// 	 * 获取模块列表命令
// 	 */
// 	public final static int JC_MODULE_LIST = 0x01;
// 	/**
// 	 * 获取服务器列表
// 	 */
// 	public final static int JC_SERVER_LIST = 0x03;
// 	/**
// 	 * 设置虚拟IP地址
// 	 */
// 	public final static int JC_SET_VIRTUAL_ADDR = 0x04;
// 	/**
// 	 * 添加服务器
// 	 */
// 	public final static int JC_ADD_SERVER  = 0x05;
// 	/**
// 	 * 设置服务器
// 	 */
// 	public final static int JC_SET_SERVER  = 0x06;
// 	/**
// 	 * 删除服务器
// 	 */
// 	public final static int JC_DEL_SERVER = 0x07;
// 	
// 	public final static int JC_LOGON = 0x10;
// 	
// 	public final static String JSON_DATA = "data";
// 	public final static String JSON_MODULE_LIST = "module_list";
// 	public final static String JSON_SERVER_LIST = "server_list";
// 	public final static String JSON_MINIPORT_NET_LUID = "miniport_net_luid";
// 
// 	public final static String JSON_STATUS ="status";
// 	public final static int JS_SUCCESS =0x00;
// 	public final static int JS_FAIL =0x01;
// 	public final static int JS_JSON_DATA_NOT_FOUND =0x02;
// 	public final static int JS_JSON_CODE_NOT_FOUND =0x03;
// 	public final static int JS_JSON_CODE_IP_FORMAT_INVALID =0x04;
// 	public final static int JS_UNKNOWN_HOST = 0x10;
// 	public final static int JS_SOCKET_ERROR = 0x11;
// }
// 
// Path: loader/web/netloader-web/src/main/java/com/lcxbox/netloader/user/model/LogonRequest.java
// public class LogonRequest extends CommonRequest {
// 	private String username;
// 	private String password;
// 	public String getUsername() {
// 		return username;
// 	}
// 	public void setUsername(String username) {
// 		this.username = username;
// 	}
// 	public String getPassword() {
// 		return password;
// 	}
// 	public void setPassword(String password) {
// 		this.password = password;
// 	}
// 	
// }
// 
// Path: loader/web/netloader-web/src/main/java/com/lcxbox/netloader/user/model/LogonRespnse.java
// public class LogonRespnse extends CommonResponse {
// 
// }
// 
// Path: loader/web/netloader-web/src/main/java/com/lcxbox/socket/json/SocketRequest.java
// public class SocketRequest {
// 	public static <T> T jsonRequest(String host, int port, Object request, Class<T> responseCls) throws UnknownHostException, IOException {
// 		ObjectMapper  objectMapper = new ObjectMapper();
// 		
// 		JsonSocket sock = new JsonSocket(host, port);
// 		ByteArrayOutputStream os = new ByteArrayOutputStream();
// 		objectMapper.getJsonFactory().createJsonGenerator(os, JsonEncoding.UTF16_LE).writeObject(request);
// 		String ret = new String(sock.sendData(os.toByteArray()),"UTF-16LE");
// 		os.close();
// 		sock.close();
// 		return objectMapper.readValue(ret, responseCls);
// 	}
// }


// Path: loader/web/netloader-web/src/main/java/com/lcxbox/netloader/user/service/UserServiceImpl.java
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.net.SocketException;
import java.net.UnknownHostException;
import org.springframework.stereotype.Service;
import com.lcxbox.common.model.LcxlNetCode;
import com.lcxbox.netloader.user.model.LogonRequest;
import com.lcxbox.netloader.user.model.LogonRespnse;
import com.lcxbox.socket.json.SocketRequest;

package com.lcxbox.netloader.user.service;




@Service()
public class UserServiceImpl implements IUserService {

	public LogonRespnse logon(String host, Integer port, String username,
			String password) throws IOException {
		// TODO Auto-generated method stub
		LogonRequest request = new LogonRequest();