-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/jsk0916'
- Loading branch information
Showing
23 changed files
with
11,788 additions
and
11 deletions.
There are no files selected for viewing
70 changes: 70 additions & 0 deletions
70
src/main/java/com/kh/tripply/party/controller/PartyController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,75 @@ | ||
package com.kh.tripply.party.controller; | ||
|
||
import java.io.File; | ||
import java.text.SimpleDateFormat; | ||
import java.util.Date; | ||
|
||
import javax.servlet.http.HttpServletRequest; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.ModelAttribute; | ||
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.multipart.MultipartFile; | ||
import org.springframework.web.servlet.ModelAndView; | ||
|
||
import com.kh.tripply.party.domain.Party; | ||
import com.kh.tripply.party.service.PartyService; | ||
|
||
@Controller | ||
public class PartyController { | ||
@Autowired | ||
private PartyService pService; | ||
|
||
@RequestMapping(value="/party/writeView.kh", method=RequestMethod.GET) | ||
public String showBoardWrite() { | ||
return "party/partyWriteForm"; | ||
} | ||
|
||
@RequestMapping(value="/party/register.kh", method=RequestMethod.POST) | ||
public ModelAndView registerBoard(ModelAndView mv | ||
,@ModelAttribute Party party | ||
// ,@RequestParam(value = "uploadFile", required = false) | ||
// MultipartFile uploadFile | ||
// , HttpServletRequest request | ||
) { // resources 경로 가져오려고 | ||
|
||
try { | ||
|
||
// String boardFilename = uploadFile.getOriginalFilename(); | ||
// | ||
// if(!boardFilename.equals("")) { | ||
// String root = request.getSession().getServletContext().getRealPath("resources"); | ||
// String savePath = root + "\\buploadFiles"; // 저장경로 지정 | ||
// File file = new File(savePath); | ||
// | ||
// // 파일 이름이 같다고 안들어가는 경우 방지 --> 파일명을 날짜+시간으로 바꿈 | ||
// SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); | ||
// String boardFileRename = sdf.format(new Date(System.currentTimeMillis()))+"." | ||
// +boardFilename.substring(boardFilename.lastIndexOf(".")+1);// .다음부터 끝까지 잘라서 반환 | ||
// if(!file.exists()) { | ||
// file.mkdir(); // 경로 폴더가 없으면 폴더 생성 | ||
// } | ||
// uploadFile.transferTo(new File(savePath + "\\" + boardFileRename));//파일을 buploadFile경로에 저장하는 메소드 | ||
// party.setPartyFileName(boardFilename); | ||
// party.setPartyFileRename(boardFileRename); //모든 파일이 고유한 값을 갖게 해야함 | ||
// | ||
// String boardFilepath = savePath + "\\" +boardFileRename;// 절대경로 | ||
// | ||
// party.setPartyFilePath(boardFilepath); | ||
// | ||
// } | ||
|
||
int result = pService.registerParty(party); | ||
mv.setViewName("redirect:/board/list.kh"); | ||
|
||
}catch (Exception e) { | ||
e.printStackTrace(); | ||
mv.addObject("msg", e.getMessage()); | ||
mv.setViewName("common/errorPage"); | ||
} | ||
return mv; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,110 @@ | ||
package com.kh.tripply.party.domain; | ||
|
||
public class Party { | ||
import java.sql.Date; | ||
|
||
public class Party { | ||
private int partyNo; | ||
private String partyTitle; | ||
private String partyContents; | ||
private String partyWriter; | ||
private Date partyFirstDate; | ||
private Date partyLastDate; | ||
private String partyLocation; | ||
private String partyFileName; | ||
private String partyFileRename; | ||
private String partyFilePath; | ||
private int partyCount; | ||
private Date pCreateDate; | ||
private Date pUpdateDate; | ||
private String pStatus; | ||
|
||
|
||
public int getPartyNo() { | ||
return partyNo; | ||
} | ||
public void setPartyNo(int partyNo) { | ||
this.partyNo = partyNo; | ||
} | ||
public String getPartyTitle() { | ||
return partyTitle; | ||
} | ||
public void setPartyTitle(String partyTitle) { | ||
this.partyTitle = partyTitle; | ||
} | ||
public String getPartyContents() { | ||
return partyContents; | ||
} | ||
public void setPartyContents(String partyContents) { | ||
this.partyContents = partyContents; | ||
} | ||
public String getPartyWriter() { | ||
return partyWriter; | ||
} | ||
public void setPartyWriter(String partyWriter) { | ||
this.partyWriter = partyWriter; | ||
} | ||
public Date getPartyFirstDate() { | ||
return partyFirstDate; | ||
} | ||
public void setPartyFirstDate(Date partyFirstDate) { | ||
this.partyFirstDate = partyFirstDate; | ||
} | ||
public Date getPartyLastDate() { | ||
return partyLastDate; | ||
} | ||
public void setPartyLastDate(Date partyLastDate) { | ||
this.partyLastDate = partyLastDate; | ||
} | ||
public String getPartyLocation() { | ||
return partyLocation; | ||
} | ||
public void setPartyLocation(String partyLocation) { | ||
this.partyLocation = partyLocation; | ||
} | ||
public String getPartyFileName() { | ||
return partyFileName; | ||
} | ||
public void setPartyFileName(String partyFileName) { | ||
this.partyFileName = partyFileName; | ||
} | ||
public String getPartyFileRename() { | ||
return partyFileRename; | ||
} | ||
public void setPartyFileRename(String partyFileRename) { | ||
this.partyFileRename = partyFileRename; | ||
} | ||
public String getPartyFilePath() { | ||
return partyFilePath; | ||
} | ||
public void setPartyFilePath(String partyFilePath) { | ||
this.partyFilePath = partyFilePath; | ||
} | ||
public int getPartyCount() { | ||
return partyCount; | ||
} | ||
public void setPartyCount(int partyCount) { | ||
this.partyCount = partyCount; | ||
} | ||
public Date getpCreateDate() { | ||
return pCreateDate; | ||
} | ||
public void setpCreateDate(Date pCreateDate) { | ||
this.pCreateDate = pCreateDate; | ||
} | ||
public Date getpUpdateDate() { | ||
return pUpdateDate; | ||
} | ||
public void setpUpdateDate(Date pUpdateDate) { | ||
this.pUpdateDate = pUpdateDate; | ||
} | ||
public String getpStatus() { | ||
return pStatus; | ||
} | ||
public void setpStatus(String pStatus) { | ||
this.pStatus = pStatus; | ||
} | ||
|
||
|
||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
package com.kh.tripply.party.service; | ||
|
||
import com.kh.tripply.party.domain.Party; | ||
|
||
public interface PartyService { | ||
|
||
public int registerParty(Party party); | ||
|
||
} |
23 changes: 22 additions & 1 deletion
23
src/main/java/com/kh/tripply/party/service/logic/PartyServiceImple.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,26 @@ | ||
package com.kh.tripply.party.service.logic; | ||
|
||
public class PartyServiceImple { | ||
import org.mybatis.spring.SqlSessionTemplate; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Service; | ||
|
||
import com.kh.tripply.party.domain.Party; | ||
import com.kh.tripply.party.service.PartyService; | ||
import com.kh.tripply.party.store.PartyStore; | ||
|
||
@Service | ||
public class PartyServiceImple implements PartyService { | ||
|
||
@Autowired | ||
private SqlSessionTemplate session; | ||
@Autowired | ||
private PartyStore pStore; | ||
|
||
@Override | ||
public int registerParty(Party party) { | ||
int result = pStore.insertParty(party, session); | ||
return result; | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
package com.kh.tripply.party.store; | ||
|
||
|
||
import org.apache.ibatis.session.SqlSession; | ||
|
||
import com.kh.tripply.party.domain.Party; | ||
|
||
public interface PartyStore { | ||
|
||
public int insertParty(Party party, SqlSession session); | ||
|
||
|
||
} | ||
|
17 changes: 15 additions & 2 deletions
17
src/main/java/com/kh/tripply/party/store/logic/PartyStoreLogic.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,18 @@ | ||
package com.kh.tripply.party.store.logic; | ||
|
||
public class PartyStoreLogic { | ||
import org.apache.ibatis.session.SqlSession; | ||
import org.springframework.stereotype.Repository; | ||
|
||
} | ||
import com.kh.tripply.party.domain.Party; | ||
import com.kh.tripply.party.store.PartyStore; | ||
|
||
@Repository | ||
public class PartyStoreLogic implements PartyStore { | ||
|
||
@Override | ||
public int insertParty(Party party, SqlSession session) { | ||
int result = session.insert("PartyMapper.insertParty", party); | ||
return result; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<!DOCTYPE mapper | ||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
<mapper namespace="PartyMapper"> | ||
|
||
<insert id="insertParty"> | ||
INSERT INTO PARTY_TBL | ||
VALUES( | ||
SEQ_BOARDNO.NEXTVAL, #{partyTitle}, #{partyContents}, | ||
#{partyWriter}, #{partyFirstDate}, #{partyLastDate}, #{partyLocation}, | ||
#{partyFileName},#{partyFileRename},#{partyFilePath}, | ||
DEFAULT, DEFAULT, DEFAULT, DEFAULT | ||
) | ||
</insert> | ||
</mapper> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<%@ page language="java" contentType="text/html; charset=UTF-8" | ||
pageEncoding="UTF-8"%> | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>에러페이지</title> | ||
</head> | ||
<body> | ||
<h1>에러메세지</h1> | ||
<h3>${msg }</h3> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> | ||
<%-- <%@ page session="false" %> 이거 있으면 세션스코프 동작 안함--%> | ||
<%@ page language="java" contentType="text/html; charset=UTF-8" | ||
pageEncoding="UTF-8"%> | ||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> | ||
<html> | ||
<head> | ||
<title>트리플리</title> | ||
<!-- 상대경로 --> | ||
<link href="../../resources/css/menubar-style.css" rel="stylesheet"> | ||
<!-- /resources/css/menubar-style.css 절대경로 --> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" | ||
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> | ||
|
||
</head> | ||
|
||
<body> | ||
|
||
<!-- jstl쓰기 위해 --> | ||
<!-- 1. jar파일 4개 --> | ||
<!-- 2. taglib jsp추가 --> | ||
|
||
<h1 align="center">Welcome Our WebSite!</h1> | ||
<div class="login-area"> | ||
<c:if test="${empty loginUser }"> | ||
|
||
<form action="/member/login.kh" method="post"> | ||
<table align="right"> | ||
<tr> | ||
<td>아이디: </td> | ||
<td><input type="text" name="memberId"></td> | ||
<td rowspan="2"> | ||
<input type="submit" value="로그인"></td> | ||
</tr> | ||
<tr> | ||
<td>비밀번호: </td> | ||
<td><input type="password" name="memberPwd"></td> | ||
<!-- <td></td> --> | ||
</tr> | ||
<tr> | ||
<td colspan="3" align="right"><a href="/member/joinView.kh">회원가입</a> </td> | ||
<!-- <td></td> --> | ||
<!-- <td></td> --> | ||
</tr> | ||
</table> | ||
</form> | ||
</c:if> | ||
<%-- <c:if test="${sessionScope.loginUser.memberId ne null }"> --%> | ||
<c:if test="${not empty loginUser }"> | ||
<table align="right"> | ||
<tr> | ||
<td colspan='2'>${sessionScope.loginUser.memberName }님 환영합니다.</td> | ||
|
||
</tr> | ||
<tr> | ||
<td><a href="/member/myPage.kh" >정보수정</a></td> | ||
<td><a href="/member/logout.kh" >로그아웃</a></td> | ||
</tr> | ||
</table> | ||
</c:if> | ||
|
||
</div> | ||
|
||
<div class="nav-area"> | ||
<div class="menu" onclick="location.href='/home.kh';">home</div> | ||
<div class="menu" onclick="showNoticeList();">공지사항</div> | ||
<div class="menu" onclick="location.href='/board/list.kh'">자유게시판</div> | ||
<div class="menu" onclick="">사진게시판</div> | ||
</div> | ||
|
||
<script type="text/javascript"> | ||
function showNoticeList() { | ||
} | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.