// 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/netloader/user/service/IUserService.java
// public interface IUserService {
// 	public LogonRespnse logon(String host, Integer port, String username, String password) throws IOException; 
// }


import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.lcxbox.netloader.user.model.LogonRespnse;
import com.lcxbox.netloader.user.service.IUserService;
package com.lcxbox.netloader.user.controller;




/**
 * 用户控制类
 * @author lcxl
 *
 */
@Controller
@RequestMapping(value = "/user")
public class UserController {
	@Autowired
    private IUserService userService;
	/**
	 * 登录
	 * @param request
	 * @param response
	 * @param host
	 * @param port
	 * @param username
	 * @param password
	 * @param rememberMe
	 * @return
	 * @throws IOException
	 */
	@RequestMapping(value = "/logon.do", method=RequestMethod.POST)
	@ResponseBody
	public LogonRespnse logon(HttpServletRequest request, 
			HttpServletResponse response,
			@RequestParam("host") String host,
			@RequestParam("port") Integer port,
			@RequestParam(value="username", required=false, defaultValue = "") String username,
			@RequestParam(value="password", required=false, defaultValue = "") String password,
			@RequestParam(value="remember-me", required=false, defaultValue = "0") boolean rememberMe) throws IOException {
// 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/netloader/user/service/IUserService.java
// public interface IUserService {
// 	public LogonRespnse logon(String host, Integer port, String username, String password) throws IOException; 
// }


// Path: loader/web/netloader-web/src/main/java/com/lcxbox/netloader/user/controller/UserController.java
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.lcxbox.netloader.user.model.LogonRespnse;
import com.lcxbox.netloader.user.service.IUserService;

package com.lcxbox.netloader.user.controller;




/**
 * 用户控制类
 * @author lcxl
 *
 */
@Controller
@RequestMapping(value = "/user")
public class UserController {
	@Autowired
    private IUserService userService;
	/**
	 * 登录
	 * @param request
	 * @param response
	 * @param host
	 * @param port
	 * @param username
	 * @param password
	 * @param rememberMe
	 * @return
	 * @throws IOException
	 */
	@RequestMapping(value = "/logon.do", method=RequestMethod.POST)
	@ResponseBody
	public LogonRespnse logon(HttpServletRequest request, 
			HttpServletResponse response,
			@RequestParam("host") String host,
			@RequestParam("port") Integer port,
			@RequestParam(value="username", required=false, defaultValue = "") String username,
			@RequestParam(value="password", required=false, defaultValue = "") String password,
			@RequestParam(value="remember-me", required=false, defaultValue = "0") boolean rememberMe) throws IOException {
		LogonRespnse logonresponse = userService.logon(host, port, username, password);