package kr.co.kihyun.beans.user;

import java.io.PrintWriter;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import kr.co.kihyun.lang.MString;

import kr.co.kihyun.beans.user.MultiCheck;

@WebServlet("/servlet/kr.co.kihyun.beans.user.HttpMultiCheckCount")
public class HttpMultiCheckCount extends HttpServlet
{
    @Override
	public void doGet(HttpServletRequest req, HttpServletResponse res) {
        doPost(req,res);
        return;
    }


    @Override
	public void doPost(HttpServletRequest req, HttpServletResponse res) {
        String sUserId = MString.checkNull(req.getParameter("userId"));
        int iCount = -1;

        try {
            MultiCheck mc = new MultiCheck();

            mc.IdCheck(sUserId);
            iCount = mc.getCount();

            res.setContentType("text/html;charset=UTF-8");
            PrintWriter out = res.getWriter();
            out.println(Integer.toString(iCount));

        } catch (SQLException ex) {
            java.util.logging.Logger.getLogger(HttpApproveSet.class.getName()).log(Level.SEVERE, null, ex);
        } catch (Exception ex) {
            Logger.getLogger(HttpMultiCheckCount.class.getName()).log(Level.SEVERE, null, ex);
        } finally {

        }
    }
}
