コード例 #1
0
  @RequestMapping(value = "/comtMain")
  public String getCumtMain(
      @RequestParam Map<String, Object> paramMap, ModelMap model, Authentication authentication)
      throws Throwable {
    // Spring Security의 Authentication 객를 주입
    MemberInfo memberInfo = (MemberInfo) authentication.getPrincipal();

    // cumt left 메뉴 조회
    List<ComtVo> list = getCumntUserJoinList(memberInfo);
    model.addAttribute("comtlist", list);
    model.addAttribute("memberInfo", memberInfo);

    model.put("compId", memberInfo.getCompId());

    // 커뮤니티내의 게시글 조회(전체)
    paramMap.put("allYn", "");
    paramMap.put("compId", memberInfo.getCompId());
    int total = 0;
    List<ComtBoardVo> boardList = communityService.getComtBoardNewList(paramMap);
    if (boardList != null && boardList.size() > 0) {
      total = boardList.size();
    }

    model.put("comtBdList", boardList);
    model.put("total", total);

    return "/cumtMainLayout/left_community/comtMain";
  }
コード例 #2
0
  // 커뮤니티 게시판 기본 메인화면 - comtLayout/*
  @RequestMapping(value = "/comtView")
  public String getComtViewInfo(
      HttpServletRequest request,
      @RequestParam Map<String, Object> paramMap,
      ModelMap model,
      Authentication authentication)
      throws Throwable {
    MemberInfo memberInfo = (MemberInfo) authentication.getPrincipal();

    // 현재 커뮤니티의 가입 여부 확인
    int joinCnt = getComtJoinYn(memberInfo, paramMap);
    if (joinCnt == 0) {
      model.put("errorType", "1");
    }

    paramMap.put("compId", memberInfo.getCompId());
    paramMap.put("userId", memberInfo.getUserId());
    paramMap.put("admActYn", "Y");

    // left 커뮤니티 조회(해당)
    Map<String, Object> comtInfo = communityService.getUsersComtInfoNm(paramMap);

    // left 커뮤니티 조회(해당제외)
    List<ComtVo> list = communityService.getComntUserJoinList(paramMap);

    // 생성된 게시판 리스트 조회
    List<ComtBoardInfoVo> boardInfoList = communityService.getComtBoardInfoList(paramMap);

    // 해당 커뮤니티의 최신글 조회
    paramMap.put("allYn", "Y");
    int total = 0;
    List<ComtBoardVo> boardList = communityService.getComtBoardNewList(paramMap);
    if (boardList != null && boardList.size() > 0) {
      total = boardList.size();
    }

    model.put("compId", memberInfo.getCompId());
    model.put("joinCnt", joinCnt);
    model.put("comtInfo", comtInfo);
    model.put("comtList", list);
    model.put("comtBdList", boardList);
    model.put("boardInfoList", boardInfoList);
    model.put("fcComtId", paramMap.get("fcComtId"));
    model.put("total", total);

    return "/comtLayout/comtBoardMain";
  }