package com.madeu.controller.mobile.mobilejoinagreement;

import com.madeu.init.ManagerDraftAction;
import com.madeu.service.mobile.mobilelogin.MobileLoginService;
import com.madeu.util.HttpUtil;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpSession;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.HashMap;


@Slf4j
@Controller
public class MobileJoinAgreementController extends ManagerDraftAction {

	@Autowired
	private MobileLoginService mobileLoginService;

	/**
	 * 개인정보 수집동의 이용약관 이동
	 * 페이지 처리 없음
	 * request:
	 * response : msgCode, msgDesc
	 *
	 * @param request
	 * @return
	 */
	@RequestMapping("/mobilejoinagreement/joinAgreementCollection.do")
	public String joinAgreementCollection(HttpSession session,HttpServletRequest request, Model model) {
		log.debug("MobileJoinAgreementController  joinAgreementCollection START");

		HashMap<String, Object> paramMap = HttpUtil.getParameterMap(request);
		HashMap<String, Object> map = new HashMap<String, Object>();

		try {
			paramMap.put("loginUserId", String.valueOf(session.getAttribute("loginUserId")));
		} catch (Exception e) {
			e.printStackTrace();
			return "/mobile/login/login";
		}
		log.debug("MobileMyPageController  joinAgreementCollection END");
		return "/mobile/joinAgreement/joinAgreementCollection";
	}
	/**
	 * 서비스 이용약관 이동
	 * 페이지 처리 없음
	 * request:
	 * response : msgCode, msgDesc
	 *
	 * @param request
	 * @return
	 */
	@RequestMapping("/mobilejoinagreement/joinAgreementService.do")
	public String joinAgreementService(HttpSession session,HttpServletRequest request, Model model) {
		log.debug("MobileJoinAgreementController  joinAgreementService START");

		HashMap<String, Object> paramMap = HttpUtil.getParameterMap(request);
		HashMap<String, Object> map = new HashMap<String, Object>();

		try {
			paramMap.put("loginUserId", String.valueOf(session.getAttribute("loginUserId")));
		} catch (Exception e) {
			e.printStackTrace();
			return "/mobile/login/login";
		}
		log.debug("MobileJoinAgreementController  joinAgreementService END");
		return "/mobile/joinAgreement/joinAgreementService";
	}

	/**
	 * 마케팅 활용동의 화면 이동
	 * 페이지 처리 없음
	 * request:
	 * response : msgCode, msgDesc
	 *
	 * @param request
	 * @return
	 */
	@RequestMapping("/mobilejoinagreement/joinAgreementMarketing.do")
	public String joinAgreementMarketing(HttpSession session,HttpServletRequest request, Model model) {
		log.debug("MobileJoinAgreementController  joinAgreementMarketing START");

		HashMap<String, Object> paramMap = HttpUtil.getParameterMap(request);
		HashMap<String, Object> map = new HashMap<String, Object>();

		try {
			paramMap.put("loginUserId", String.valueOf(session.getAttribute("loginUserId")));
		} catch (Exception e) {
			e.printStackTrace();
			return "/mobile/login/login";
		}
		log.debug("MobileJoinAgreementController  joinAgreementMarketing END");
		return "/mobile/joinAgreement/joinAgreementMarketing";
	}
}