Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ Java Spring Oracle Redis Kafka JQuery

### Tomcat Config

<Connector connectionTimeout="20000"
Connector connectionTimeout="20000"
port="6789"
disableUploadTimeout="true"
protocol="HTTP/1.1"
maxSpareThreads="50"
maxThreads="300"
minSpareThreads="25"
acceptCount="10"
tcpNoDelay="true"/>

<Context docBase="Singer" path="/" reloadable="true" source="org.eclipse.jst.jee.server:Singer" allowCasualMultipartParsing="true"/>
tcpNoDelay="true"
maxPostSize="52428800"
Context docBase="Singer" path="/" reloadable="true" source="org.eclipse.jst.jee.server:Singer" allowCasualMultipartParsing="true"
40 changes: 37 additions & 3 deletions sql/OracleTables.sql
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
CREATE table SM01(
userid varchar2(10) not null,
passwd varchar2(30) not null,
adminyn number(1) default 0,
username varchar2(20) not null,
brth varchar2(8) not null,
grade number(1) default 4 not null,
regdate varchar2(8) not null,
phone varchar2(15) not null,
email varchar2(30) not null,
usertype number(1) default 4 not null
);

alter table SM01
add constraint pk_SM01 primary key(userid);

CREATE index idx_SM01_1
on SM01(username);

CREATE index idx_SM01_2
on SM01(brth);

CREATE TABLE SMP1(
userid varchar2(10) not null,
regdate varchar2(8) not null,
Expand All @@ -26,6 +30,36 @@ add constraint pk_SMP1 primary key(userid);
alter table SMP1
add constraint fk_SMP1 foreign key(userid) references SM01(userid) on delete cascade;

CREATE table SMI1 (
userid varchar2(10) not null,
infocode number(2) not null,
pfnum varchar2(5) not null,
pcnum varchar2(5) not null,
pbnum varchar2(5) not null,
regdate varchar2(8) not null
);

ALTER TABLE SMI1
add constraint pk_SMI1 primary key(userid,infocode);

alter table SMI1
add constraint fk_SMI1 foreign key(userid) references SM01(userid) on delete cascade;

CREATE index idx_SMI1_1
on SMI1(pbnum,pcnum,pfnum);

CREATE table SME1 (
userid varchar2(10) not null,
regdate varchar2(8) not NULL,
insertid varchar2(10) not null
);

ALTER TABLE SME1
add constraint pk_SME1 primary key(userid);

alter table SME1
add constraint fk_SME1 foreign key(userid) references SM01(userid) on delete cascade;

CREATE table MENU (
menucd varchar2(2) not null,
menunm varchar2(20) not null,
Expand All @@ -49,7 +83,7 @@ insert into MENU values('05','파일 게시판','/sf01page',4,'admin','20180901'
insert into MENU values('06','투표 게시판','/sv01page',4,'admin','20180901','admin','20180901');
insert into MENU values('07','맛집 추천','/sr01page',4,'admin','20180901','admin','20180901');
insert into MENU values('08','나의 메모장','/sm02page',4,'admin','20180901','admin','20180901');

insert into MENU values('09','유저 검색','/smi1Page',4,'admin','20180901','admin','20180901');

CREATE table CODE_GRP (
codegrp varchar2(5) not null,
Expand Down
19 changes: 19 additions & 0 deletions src/main/java/com/singer/common/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,23 @@ public int getValue() {
}
}

public enum PHONE_INFO_CODE {
/** 핸드폰코드 */
CELL(1),
/** 집번호코드 */
HOME(2),
/** 회사번호코드 */
COMPANY(3),
/** 그외번호코드 */
OTHER(4),;
private final int value;

private PHONE_INFO_CODE(int value) {
this.value = value;
}

public int getValue() {
return value;
}
}
}
9 changes: 1 addition & 8 deletions src/main/java/com/singer/controller/LoginController.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,8 @@ public ModelAndView logout(HttpSession session) throws Exception {
ModelAndView model = new ModelAndView("/index");

session.removeAttribute("userid");
session.removeAttribute("adminyn");
session.removeAttribute("username");
session.removeAttribute("brth");
session.removeAttribute("grade");
session.removeAttribute("regdate");
session.removeAttribute("phone");
session.removeAttribute("email");
session.removeAttribute("usertype");
session.removeAttribute("menuList");
Expand All @@ -72,7 +68,7 @@ public HashMap<String, Object> login(SM01Vo sm01Vo, HttpSession session, HttpSer

String userId = sm01Vo.getUserid();

SM01Vo one = sm01Service.selectOneSM01Vo(sm01Vo);
SM01Vo one = sm01Service.login(sm01Vo);
if (CommonUtil.isNull(one)) { // 로그인 실패

hashMap.put("code", Constants.ERROR_LOGIN_FAIL);
Expand All @@ -82,12 +78,9 @@ public HashMap<String, Object> login(SM01Vo sm01Vo, HttpSession session, HttpSer
} else {

session.setAttribute("userid", userId);
session.setAttribute("adminyn", one.getAdminyn());
session.setAttribute("username", one.getUsername());
session.setAttribute("brth", one.getBrth());
session.setAttribute("grade", one.getGrade());
session.setAttribute("regdate", one.getRegdate());
session.setAttribute("phone", one.getPhone());
session.setAttribute("email", one.getEmail());
session.setAttribute("usertype", one.getUsertype());

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/singer/controller/SB02Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
Expand Down Expand Up @@ -41,7 +42,7 @@ public ResponseEntity<SB02Vo> selectSB02Vo(@ModelAttribute SB02Vo sb02Vo, HttpSe

@ResponseBody
@RequestMapping(value = "/sb02", method = RequestMethod.POST)
public ResponseEntity<SB02Vo> insertSB02Vo(SB02Vo sb02Vo, HttpSession session) throws Exception {
public ResponseEntity<SB02Vo> insertSB02Vo(@RequestBody SB02Vo sb02Vo, HttpSession session) throws Exception {
log.debug("enter sb02 post");

String userid = (String) session.getAttribute("userid");
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/singer/controller/SF02Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
Expand Down Expand Up @@ -41,7 +42,7 @@ public ResponseEntity<SF02Vo> selectSF02Vo(@ModelAttribute SF02Vo sf02Vo, HttpSe

@ResponseBody
@RequestMapping(value = "/sf02", method = RequestMethod.POST)
public ResponseEntity<SF02Vo> insertSF02Vo(SF02Vo sf02Vo, HttpSession session) throws Exception {
public ResponseEntity<SF02Vo> insertSF02Vo(@RequestBody SF02Vo sf02Vo, HttpSession session) throws Exception {
log.debug("enter sf02 post");

String userid = (String) session.getAttribute("userid");
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/com/singer/controller/SM01Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
Expand Down Expand Up @@ -131,4 +132,17 @@ public void selectPhotoSM01Vo(@ModelAttribute SM01Vo sm01Vo, HttpServletRequest
}
log.debug("exit sm01photo get");
}

@ResponseBody
@RequestMapping(value = "/sme1", method = RequestMethod.PUT)
public ResponseEntity<SM01Vo> upateSME1Vo(@RequestBody SM01Vo sm01Vo, HttpSession session) throws Exception {
log.debug("enter sme1 put");

String userid = (String) session.getAttribute("userid");
sm01Service.updateSME1Vo(sm01Vo, userid);

log.debug("exit sme1 put");
return new ResponseEntity<SM01Vo>(sm01Vo, HttpStatus.OK);
}

}
3 changes: 2 additions & 1 deletion src/main/java/com/singer/controller/SM02Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
Expand Down Expand Up @@ -64,7 +65,7 @@ public ResponseEntity<SM02Vo> deleteSM02Vo(@ModelAttribute SM02Vo sm02Vo, HttpSe

@ResponseBody
@RequestMapping(value = "/sm02", method = RequestMethod.POST)
public ResponseEntity<SM02Vo> insertSM02Vo(SM02Vo sm02Vo, HttpSession session) throws Exception {
public ResponseEntity<SM02Vo> insertSM02Vo(@RequestBody SM02Vo sm02Vo, HttpSession session) throws Exception {
log.debug("enter sm02 post");

String userid = (String) session.getAttribute("userid");
Expand Down
47 changes: 47 additions & 0 deletions src/main/java/com/singer/controller/SMI1Controller.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package com.singer.controller;

import java.util.List;

import javax.annotation.Resource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.singer.service.SMI1Service;
import com.singer.vo.SM01Vo;

@Controller("smi1Controller")
public class SMI1Controller {

private final Log log = LogFactory.getLog(SMI1Controller.class);

@Resource(name = "smi1Service")
private SMI1Service smi1Service;

@RequestMapping(value = "/smi1Page", method = RequestMethod.GET)
public ModelAndView page() {
ModelAndView model = new ModelAndView("smi1view");

return model;
}

@ResponseBody
@RequestMapping(value = "smi1", method = RequestMethod.POST)
public ResponseEntity<SM01Vo> selectSMI1Vo(@RequestBody SM01Vo sm01Vo) throws Exception {
log.debug("enter smi1 get");

List<SM01Vo> list = smi1Service.selectSMI1Vo(sm01Vo);
sm01Vo.setList(list);

log.debug("exit smi1 get");
return new ResponseEntity<SM01Vo>(sm01Vo, HttpStatus.OK);
}
}
3 changes: 2 additions & 1 deletion src/main/java/com/singer/controller/SR03Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
Expand Down Expand Up @@ -41,7 +42,7 @@ public ResponseEntity<SR03Vo> selectsr03Vo(@ModelAttribute SR03Vo sr03Vo, HttpSe

@ResponseBody
@RequestMapping(value = "/sr03", method = RequestMethod.POST)
public ResponseEntity<SR03Vo> insertsr03Vo(SR03Vo sr03Vo, HttpSession session) throws Exception {
public ResponseEntity<SR03Vo> insertsr03Vo(@RequestBody SR03Vo sr03Vo, HttpSession session) throws Exception {
log.debug("enter sr03 post");

String userid = (String) session.getAttribute("userid");
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/singer/controller/SV04Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
Expand Down Expand Up @@ -41,7 +42,7 @@ public ResponseEntity<SV04Vo> selectSV04Vo(@ModelAttribute SV04Vo sv04Vo, HttpSe

@ResponseBody
@RequestMapping(value = "/sv04", method = RequestMethod.POST)
public ResponseEntity<SV04Vo> insertSV04Vo(SV04Vo sv04Vo, HttpSession session) throws Exception {
public ResponseEntity<SV04Vo> insertSV04Vo(@RequestBody SV04Vo sv04Vo, HttpSession session) throws Exception {
log.debug("enter sv04 post");

String userid = (String) session.getAttribute("userid");
Expand Down
23 changes: 22 additions & 1 deletion src/main/java/com/singer/dao/SM01Dao.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,32 @@ public int insertSM01Vo(SM01Vo sm01Vo) throws Exception {
return insert(namespace + ".insert", sm01Vo);
}

public int insertSMI1Vo(SM01Vo sm01Vo) throws Exception {
return update(namespace + ".insertSMI1", sm01Vo);
}

public int insertSME1Vo(SM01Vo sm01Vo) throws Exception {
return insert(namespace + ".insertSME1", sm01Vo);
}

public int updateSM01Vo(SM01Vo sm01Vo) throws Exception {
return insert(namespace + ".update", sm01Vo);
return update(namespace + ".update", sm01Vo);
}

public int updateUserType(SM01Vo sm01Vo) throws Exception {
return update(namespace + ".updateUserType", sm01Vo);
}

@SuppressWarnings("unchecked")
public List<SM01Vo> selectSM01Vo(SM01Vo sm01Vo) throws Exception {
return (List<SM01Vo>) selectList(namespace + ".select", sm01Vo);
}

@SuppressWarnings("unchecked")
public List<SM01Vo> selectSMI1Vo(SM01Vo sm01Vo) throws Exception {
return (List<SM01Vo>) selectList(namespace + ".selectSMI1", sm01Vo);
}

public SM01Vo selectOneSM01Vo(SM01Vo sm01Vo) throws Exception {
return (SM01Vo) selectOne(namespace + ".selectOne", sm01Vo);
}
Expand All @@ -34,6 +51,10 @@ public int deleteSM01Vo(SM01Vo sm01Vo) throws Exception {
return delete(namespace + ".delete", sm01Vo);
}

public int deleteSME1Vo(SM01Vo sm01Vo) throws Exception {
return delete(namespace + ".deleteSME1", sm01Vo);
}

public int insertImage(Map<String, Object> hashMap) throws Exception {
return insert(namespace + ".insertImage", hashMap);
}
Expand Down
28 changes: 28 additions & 0 deletions src/main/java/com/singer/dao/SMI1Dao.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.singer.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.singer.vo.SM01Vo;

@Repository("smi1Dao")
public class SMI1Dao extends SuperDao {

private static final String namespace = "com.singer.mappers.SMI1";

@SuppressWarnings("unchecked")
public List<SM01Vo> selectByBrthSMI1Vo(SM01Vo sm01Vo) throws Exception {
return (List<SM01Vo>) selectList(namespace + ".selectByBrth", sm01Vo);
}

@SuppressWarnings("unchecked")
public List<SM01Vo> selectByNameSMI1Vo(SM01Vo sm01Vo) throws Exception {
return (List<SM01Vo>) selectList(namespace + ".selectByName", sm01Vo);
}

@SuppressWarnings("unchecked")
public List<SM01Vo> selectByPhoneSMI1Vo(SM01Vo sm01Vo) throws Exception {
return (List<SM01Vo>) selectList(namespace + ".selectByPhone", sm01Vo);
}
}
Loading