Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unki cinema #85

Merged
merged 7 commits into from
Mar 12, 2020
Merged
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
3 changes: 2 additions & 1 deletion CGX_final_Project/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
Expand All @@ -29,5 +29,6 @@
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v9.0"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
49 changes: 0 additions & 49 deletions CGX_final_Project/.gitignore

This file was deleted.

11 changes: 11 additions & 0 deletions CGX_final_Project/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
10 changes: 10 additions & 0 deletions CGX_final_Project/.settings/org.eclipse.wst.common.component
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="com.kh.cgx-1.0.0-BUILD-SNAPSHOT">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<property name="context-root" value="com.kh.cgx"/>
<property name="java-output-path" value="/CGX_final_Project/target/classes"/>
</wb-module>
</project-modules>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="wst.jsdt.web"/>
<installed facet="java" version="1.8"/>
<installed facet="jst.web" version="4.0"/>
<installed facet="wst.jsdt.web" version="1.0"/>
</faceted-project>
2 changes: 2 additions & 0 deletions CGX_final_Project/.settings/org.eclipse.wst.validation.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
disabled=06target
eclipse.preferences.version=1
13 changes: 0 additions & 13 deletions CGX_final_Project/.springBeans

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.kh.cgx.controller;

import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch;

import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
Expand All @@ -10,6 +12,7 @@
import javax.servlet.http.HttpSession;

import org.apache.commons.io.FileUtils;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ByteArrayResource;
import org.springframework.http.HttpHeaders;
Expand Down Expand Up @@ -41,6 +44,7 @@
import com.kh.cgx.repository.admin.AdminScreenDao;
import com.kh.cgx.repository.admin.ManagerDao;

import lombok.Builder;
import lombok.extern.slf4j.Slf4j;

@Slf4j
Expand All @@ -64,7 +68,8 @@ public class AdminController {

@Autowired
private PasswordEncoder encoder;

@Autowired
private SqlSession sqlSession;

@GetMapping("/adminlist")
public ModelAndView test(ModelAndView mav) {
Expand All @@ -81,8 +86,28 @@ public String test2() {

@PostMapping("/admininsert")
public String test2(@ModelAttribute AdminDto adminDto) {

adminDto.setAdmin_pw(encoder.encode(adminDto.getAdmin_pw()));
adminDto.setAdmin_no(sqlSession.selectOne("admin.seq"));
adminDao.insert(adminDto);
int admin_no = adminDto.getAdmin_no();
System.out.println("어드민 번호"+admin_no);
String admin_id = adminDto.getAdmin_id();
String cinema_no = sqlSession.selectOne("cinema.admin", admin_id);
System.out.println("시네마 : "+cinema_no);
System.out.println("시네마 : "+cinema_no);
System.out.println("시네마 : "+cinema_no);
System.out.println("시네마 : "+cinema_no);
System.out.println("시네마 : "+cinema_no);
System.out.println("시네마 : "+cinema_no);
System.out.println("시네마 : "+cinema_no);
System.out.println("시네마 : "+cinema_no);
if(cinema_no != null) {
ManagerReadyDto dto= ManagerReadyDto.builder()
.admin_no(admin_no)
.cinema_no(Integer.parseInt(cinema_no)).build();
sqlSession.insert("manager.ready",dto);
}
return "redirect:/admin/adminlogin";
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.kh.cgx.entity.cinema.SeatDto;
import com.kh.cgx.entity.mypage.TicketDto;
import com.kh.cgx.entity.mypage.TicketSeatDto;
import com.kh.cgx.entity.user.MemberDto;
import com.kh.cgx.repository.pay.PayDao;
import com.kh.cgx.service.pay.KakaoPayService;
import com.kh.cgx.vo.kakao.KakaoPayReadyVO;
Expand All @@ -49,7 +50,9 @@ public String confirm(HttpSession session,@RequestParam List<String> seat,@Reque

int ticket_no = sqlSession.selectOne("seat.ticket");
int screen_no = sqlSession.selectOne("movietime.screen_no",movietime_no);
int member_no = 1;
String id=(String) session.getAttribute("id");
MemberDto search = sqlSession.selectOne("mypage.search",id);
int member_no = search.getMember_no();
String partner_order_id = String.valueOf(ticket_no);
String partner_user_id = String.valueOf(member_no);
String item_name = sqlSession.selectOne("movietime.movietitle",movietime_no);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
paprameterType : 이 명령을 실행하기 위해 필요한 데이터의 형태
-->
<mapper namespace="admin">
<select id="seq" resultType="int">
select admin_no_seq.nextval from dual
</select>
<insert id="insert" parameterType="adminDto">
insert into admin values(admin_no_seq.nextval,#{admin_id},#{admin_pw},#{admin_grade})
insert into admin values(#{admin_no},#{admin_id},#{admin_pw},#{admin_grade})
</insert>

<select id="get" parameterType="adminDto" resultType="adminDto">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<delete id="delete" parameterType="int">
delete cinema where cinema_no = #{no}
</delete>
<select id="admin" parameterType="string" resultType="int">
select cinema_no from cinema where cinema_area=#{admin_id}
</select>
</mapper>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>

<insert id="ready" parameterType="readyDto">
insert into manager values(manager_no_seq.nextval,#{admin_no},#{cinema_no})
insert into manager values(
manager_no_seq.nextval,
#{admin_no},
#{cinema_no})
</insert>

<insert id="actorinsert" parameterType="actorDto">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# path property
# path.base-package=com.kh.sts22
path.mybatis.config-location=classpath:/com/kh/cgx/mybatis/mybatis-config.xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
</head>
<body>
<div class="container">
<form action="actorinsert" method="get">
<form action="actorinsert" method="post">
<table class="table table-bordered">

<tbody>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
44 changes: 44 additions & 0 deletions CGX_final_Project/target/classes/com/kh/cgx/mybatis/Untitled 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?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="person">

<!--
Person 이 가지고 있는 Score 목록까지 한방에 조회
-->

<!-- 마이바티스에게 구문1을 실행한 결과를 어떻게 정리해야 되는지를 알려준다(resultMap) -->
<resultMap type="com.kh.cgx.PersonVO" id="person">
<result column="no" property="no"/>
<result column="name" property="name"/>

<!--
column : 목록을 조회할 항목(PK)
javaType : 저장소 형태
ofType : 내용물 형태
property : 변
-->
<collection column="no" javaType="java.util.List" ofType="com.kh.cgx.ScoreDto" property="list"
select="selectScore"></collection>
</resultMap>


<!-- 구문 1 : Person을 조회하는 구문 -->
<select id="selectPerson" resultMap="person">
select * from person order by no asc
</select>

<!-- 구문 2 : Person이 주어진 경우 Score를 조회하는 구문 -->
<select id="selectScore" resultType="com.kh.cgx.ScoreDto" parameterType="int">
select * from score where person_no=#{person_no} order by no asc
</select>

</mapper>





Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?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">
<!-- namespace : 영역을 부르는 별칭
paprameterType : 이 명령을 실행하기 위해 필요한 데이터의 형태
-->
<mapper namespace="admin">
<select id="seq" resultType="int">
select admin_no_seq.nextval from dual
</select>
<insert id="insert" parameterType="adminDto">
insert into admin values(#{admin_no},#{admin_id},#{admin_pw},#{admin_grade})
</insert>

<select id="get" parameterType="adminDto" resultType="adminDto">
select * from admin where admin_id=#{admin_id}
</select>

<select id="getList" resultType="adminDto">
select * from admin order by admin_no desc
</select>

<update id="update" parameterType="adminDto">
update admin set admin_grade = #{admin_grade} where admin_no = #{admin_no}
</update>

<delete id="delete" parameterType="int">
delete admin where admin_no = #{no}
</delete>
</mapper>
Loading