From 0a3a512ff22864043b03658947927cd0fd53c906 Mon Sep 17 00:00:00 2001 From: zzzjinwook Date: Tue, 22 Aug 2023 11:34:57 +0900 Subject: [PATCH 01/19] =?UTF-8?q?file=20:=20=ED=86=B0=EC=BA=A3=20=EC=84=B8?= =?UTF-8?q?=ED=8C=85=20=EC=A4=91=20=EC=83=9D=EA=B8=B4=20=ED=8C=8C=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../catalina.policy | 264 + .../catalina.properties | 219 + .../context.xml | 29 + .../server.xml | 166 + .../tomcat-users.xml | 52 + .../web.xml | 4735 +++++++++++++++++ 6 files changed, 5465 insertions(+) create mode 100644 Servers/Tomcat v9.0 Server at localhost-config/catalina.policy create mode 100644 Servers/Tomcat v9.0 Server at localhost-config/catalina.properties create mode 100644 Servers/Tomcat v9.0 Server at localhost-config/context.xml create mode 100644 Servers/Tomcat v9.0 Server at localhost-config/server.xml create mode 100644 Servers/Tomcat v9.0 Server at localhost-config/tomcat-users.xml create mode 100644 Servers/Tomcat v9.0 Server at localhost-config/web.xml diff --git a/Servers/Tomcat v9.0 Server at localhost-config/catalina.policy b/Servers/Tomcat v9.0 Server at localhost-config/catalina.policy new file mode 100644 index 00000000..6b2fa6db --- /dev/null +++ b/Servers/Tomcat v9.0 Server at localhost-config/catalina.policy @@ -0,0 +1,264 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// ============================================================================ +// catalina.policy - Security Policy Permissions for Tomcat +// +// This file contains a default set of security policies to be enforced (by the +// JVM) when Catalina is executed with the "-security" option. In addition +// to the permissions granted here, the following additional permissions are +// granted to each web application: +// +// * Read access to the web application's document root directory +// * Read, write and delete access to the web application's working directory +// ============================================================================ + + +// ========== SYSTEM CODE PERMISSIONS ========================================= + + +// These permissions apply to javac +grant codeBase "file:${java.home}/lib/-" { + permission java.security.AllPermission; +}; + +// These permissions apply to all shared system extensions +grant codeBase "file:${java.home}/jre/lib/ext/-" { + permission java.security.AllPermission; +}; + +// These permissions apply to javac when ${java.home} points at $JAVA_HOME/jre +grant codeBase "file:${java.home}/../lib/-" { + permission java.security.AllPermission; +}; + +// These permissions apply to all shared system extensions when +// ${java.home} points at $JAVA_HOME/jre +grant codeBase "file:${java.home}/lib/ext/-" { + permission java.security.AllPermission; +}; + +// This permission is required when using javac to compile JSPs on Java 9 +// onwards +//grant codeBase "jrt:/jdk.compiler" { +// permission java.security.AllPermission; +//}; + + +// ========== CATALINA CODE PERMISSIONS ======================================= + +// These permissions apply to the daemon code +grant codeBase "file:${catalina.home}/bin/commons-daemon.jar" { + permission java.security.AllPermission; +}; + +// These permissions apply to the logging API +// Note: If tomcat-juli.jar is in ${catalina.base} and not in ${catalina.home}, +// update this section accordingly. +// grant codeBase "file:${catalina.base}/bin/tomcat-juli.jar" {..} +grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" { + permission java.io.FilePermission + "${java.home}${file.separator}lib${file.separator}logging.properties", "read"; + + permission java.io.FilePermission + "${catalina.base}${file.separator}conf${file.separator}logging.properties", "read"; + permission java.io.FilePermission + "${catalina.base}${file.separator}logs", "read, write"; + permission java.io.FilePermission + "${catalina.base}${file.separator}logs${file.separator}*", "read, write, delete"; + + permission java.lang.RuntimePermission "shutdownHooks"; + permission java.lang.RuntimePermission "getClassLoader"; + permission java.lang.RuntimePermission "setContextClassLoader"; + + permission java.lang.management.ManagementPermission "monitor"; + + permission java.util.logging.LoggingPermission "control"; + + permission java.util.PropertyPermission "java.util.logging.config.class", "read"; + permission java.util.PropertyPermission "java.util.logging.config.file", "read"; + permission java.util.PropertyPermission "org.apache.juli.AsyncMaxRecordCount", "read"; + permission java.util.PropertyPermission "org.apache.juli.AsyncOverflowDropType", "read"; + permission java.util.PropertyPermission "org.apache.juli.ClassLoaderLogManager.debug", "read"; + permission java.util.PropertyPermission "catalina.base", "read"; + + // Note: To enable per context logging configuration, permit read access to + // the appropriate file. Be sure that the logging configuration is + // secure before enabling such access. + // E.g. for the examples web application (uncomment and unwrap + // the following to be on a single line): + // permission java.io.FilePermission "${catalina.base}${file.separator} + // webapps${file.separator}examples${file.separator}WEB-INF + // ${file.separator}classes${file.separator}logging.properties", "read"; +}; + +// These permissions apply to the server startup code +grant codeBase "file:${catalina.home}/bin/bootstrap.jar" { + permission java.security.AllPermission; +}; + +// These permissions apply to the servlet API classes +// and those that are shared across all class loaders +// located in the "lib" directory +grant codeBase "file:${catalina.home}/lib/-" { + permission java.security.AllPermission; +}; + + +// If using a per instance lib directory, i.e. ${catalina.base}/lib, +// then the following permission will need to be uncommented +// grant codeBase "file:${catalina.base}/lib/-" { +// permission java.security.AllPermission; +// }; + + +// ========== WEB APPLICATION PERMISSIONS ===================================== + + +// These permissions are granted by default to all web applications +// In addition, a web application will be given a read FilePermission +// for all files and directories in its document root. +grant { + // Required for JNDI lookup of named JDBC DataSource's and + // javamail named MimePart DataSource used to send mail + permission java.util.PropertyPermission "java.home", "read"; + permission java.util.PropertyPermission "java.naming.*", "read"; + permission java.util.PropertyPermission "javax.sql.*", "read"; + + // OS Specific properties to allow read access + permission java.util.PropertyPermission "os.name", "read"; + permission java.util.PropertyPermission "os.version", "read"; + permission java.util.PropertyPermission "os.arch", "read"; + permission java.util.PropertyPermission "file.separator", "read"; + permission java.util.PropertyPermission "path.separator", "read"; + permission java.util.PropertyPermission "line.separator", "read"; + + // JVM properties to allow read access + permission java.util.PropertyPermission "java.version", "read"; + permission java.util.PropertyPermission "java.vendor", "read"; + permission java.util.PropertyPermission "java.vendor.url", "read"; + permission java.util.PropertyPermission "java.class.version", "read"; + permission java.util.PropertyPermission "java.specification.version", "read"; + permission java.util.PropertyPermission "java.specification.vendor", "read"; + permission java.util.PropertyPermission "java.specification.name", "read"; + + permission java.util.PropertyPermission "java.vm.specification.version", "read"; + permission java.util.PropertyPermission "java.vm.specification.vendor", "read"; + permission java.util.PropertyPermission "java.vm.specification.name", "read"; + permission java.util.PropertyPermission "java.vm.version", "read"; + permission java.util.PropertyPermission "java.vm.vendor", "read"; + permission java.util.PropertyPermission "java.vm.name", "read"; + + // Required for OpenJMX + permission java.lang.RuntimePermission "getAttribute"; + + // Allow read of JAXP compliant XML parser debug + permission java.util.PropertyPermission "jaxp.debug", "read"; + + // All JSPs need to be able to read this package + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat"; + + // Precompiled JSPs need access to these packages. + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.el"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime"; + permission java.lang.RuntimePermission + "accessClassInPackage.org.apache.jasper.runtime.*"; + + // Applications using WebSocket need to be able to access these packages + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat.websocket"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat.websocket.server"; +}; + + +// The Manager application needs access to the following packages to support the +// session display functionality. It also requires the custom Tomcat +// DeployXmlPermission to enable the use of META-INF/context.xml +// These settings support the following configurations: +// - default CATALINA_HOME == CATALINA_BASE +// - CATALINA_HOME != CATALINA_BASE, per instance Manager in CATALINA_BASE +// - CATALINA_HOME != CATALINA_BASE, shared Manager in CATALINA_HOME +grant codeBase "file:${catalina.base}/webapps/manager/-" { + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.ha.session"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager.util"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.util"; + permission org.apache.catalina.security.DeployXmlPermission "manager"; +}; +grant codeBase "file:${catalina.home}/webapps/manager/-" { + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.ha.session"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager.util"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.util"; + permission org.apache.catalina.security.DeployXmlPermission "manager"; +}; + +// The Host Manager application needs the custom Tomcat DeployXmlPermission to +// enable the use of META-INF/context.xml +// These settings support the following configurations: +// - default CATALINA_HOME == CATALINA_BASE +// - CATALINA_HOME != CATALINA_BASE, per instance Host Manager in CATALINA_BASE +// - CATALINA_HOME != CATALINA_BASE, shared Host Manager in CATALINA_HOME +grant codeBase "file:${catalina.base}/webapps/host-manager/-" { + permission org.apache.catalina.security.DeployXmlPermission "host-manager"; +}; +grant codeBase "file:${catalina.home}/webapps/host-manager/-" { + permission org.apache.catalina.security.DeployXmlPermission "host-manager"; +}; + + +// You can assign additional permissions to particular web applications by +// adding additional "grant" entries here, based on the code base for that +// application, /WEB-INF/classes/, or /WEB-INF/lib/ jar files. +// +// Different permissions can be granted to JSP pages, classes loaded from +// the /WEB-INF/classes/ directory, all jar files in the /WEB-INF/lib/ +// directory, or even to individual jar files in the /WEB-INF/lib/ directory. +// +// For instance, assume that the standard "examples" application +// included a JDBC driver that needed to establish a network connection to the +// corresponding database and used the scrape taglib to get the weather from +// the NOAA web server. You might create a "grant" entries like this: +// +// The permissions granted to the context root directory apply to JSP pages. +// grant codeBase "file:${catalina.base}/webapps/examples/-" { +// permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect"; +// permission java.net.SocketPermission "*.noaa.gov:80", "connect"; +// }; +// +// The permissions granted to the context WEB-INF/classes directory +// grant codeBase "file:${catalina.base}/webapps/examples/WEB-INF/classes/-" { +// }; +// +// The permission granted to your JDBC driver +// grant codeBase "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/driver.jar!/-" { +// permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect"; +// }; +// The permission granted to the scrape taglib +// grant codeBase "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/scrape.jar!/-" { +// permission java.net.SocketPermission "*.noaa.gov:80", "connect"; +// }; + +// To grant permissions for web applications using packed WAR files, use the +// Tomcat specific WAR url scheme. +// +// The permissions granted to the entire web application +// grant codeBase "war:file:${catalina.base}/webapps/examples.war*/-" { +// }; +// +// The permissions granted to a specific JAR +// grant codeBase "war:file:${catalina.base}/webapps/examples.war*/WEB-INF/lib/foo.jar" { +// }; diff --git a/Servers/Tomcat v9.0 Server at localhost-config/catalina.properties b/Servers/Tomcat v9.0 Server at localhost-config/catalina.properties new file mode 100644 index 00000000..38ce4c10 --- /dev/null +++ b/Servers/Tomcat v9.0 Server at localhost-config/catalina.properties @@ -0,0 +1,219 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# +# List of comma-separated packages that start with or equal this string +# will cause a security exception to be thrown when +# passed to checkPackageAccess unless the +# corresponding RuntimePermission ("accessClassInPackage."+package) has +# been granted. +package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.jasper.,org.apache.tomcat. +# +# List of comma-separated packages that start with or equal this string +# will cause a security exception to be thrown when +# passed to checkPackageDefinition unless the +# corresponding RuntimePermission ("defineClassInPackage."+package) has +# been granted. +# +# by default, no packages are restricted for definition, and none of +# the class loaders supplied with the JDK call checkPackageDefinition. +# +package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,\ +org.apache.jasper.,org.apache.naming.,org.apache.tomcat. + +# +# +# List of comma-separated paths defining the contents of the "common" +# classloader. Prefixes should be used to define what is the repository type. +# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or absolute. +# If left as blank,the JVM system loader will be used as Catalina's "common" +# loader. +# Examples: +# "foo": Add this folder as a class repository +# "foo/*.jar": Add all the JARs of the specified folder as class +# repositories +# "foo/bar.jar": Add bar.jar as a class repository +# +# Note: Values are enclosed in double quotes ("...") in case either the +# ${catalina.base} path or the ${catalina.home} path contains a comma. +# Because double quotes are used for quoting, the double quote character +# may not appear in a path. +common.loader="${catalina.base}/lib","${catalina.base}/lib/*.jar","${catalina.home}/lib","${catalina.home}/lib/*.jar" + +# +# List of comma-separated paths defining the contents of the "server" +# classloader. Prefixes should be used to define what is the repository type. +# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or absolute. +# If left as blank, the "common" loader will be used as Catalina's "server" +# loader. +# Examples: +# "foo": Add this folder as a class repository +# "foo/*.jar": Add all the JARs of the specified folder as class +# repositories +# "foo/bar.jar": Add bar.jar as a class repository +# +# Note: Values may be enclosed in double quotes ("...") in case either the +# ${catalina.base} path or the ${catalina.home} path contains a comma. +# Because double quotes are used for quoting, the double quote character +# may not appear in a path. +server.loader= + +# +# List of comma-separated paths defining the contents of the "shared" +# classloader. Prefixes should be used to define what is the repository type. +# Path may be relative to the CATALINA_BASE path or absolute. If left as blank, +# the "common" loader will be used as Catalina's "shared" loader. +# Examples: +# "foo": Add this folder as a class repository +# "foo/*.jar": Add all the JARs of the specified folder as class +# repositories +# "foo/bar.jar": Add bar.jar as a class repository +# Please note that for single jars, e.g. bar.jar, you need the URL form +# starting with file:. +# +# Note: Values may be enclosed in double quotes ("...") in case either the +# ${catalina.base} path or the ${catalina.home} path contains a comma. +# Because double quotes are used for quoting, the double quote character +# may not appear in a path. +shared.loader= + +# Default list of JAR files that should not be scanned using the JarScanner +# functionality. This is typically used to scan JARs for configuration +# information. JARs that do not contain such information may be excluded from +# the scan to speed up the scanning process. This is the default list. JARs on +# this list are excluded from all scans. The list must be a comma separated list +# of JAR file names. +# The list of JARs to skip may be over-ridden at a Context level for individual +# scan types by configuring a JarScanner with a nested JarScanFilter. +# The JARs listed below include: +# - Tomcat Bootstrap JARs +# - Tomcat API JARs +# - Catalina JARs +# - Jasper JARs +# - Tomcat JARs +# - Common non-Tomcat JARs +# - Test JARs (JUnit, Cobertura and dependencies) +tomcat.util.scan.StandardJarScanFilter.jarsToSkip=\ +annotations-api.jar,\ +ant-junit*.jar,\ +ant-launcher*.jar,\ +ant*.jar,\ +asm-*.jar,\ +aspectj*.jar,\ +bcel*.jar,\ +biz.aQute.bnd*.jar,\ +bootstrap.jar,\ +catalina-ant.jar,\ +catalina-ha.jar,\ +catalina-ssi.jar,\ +catalina-storeconfig.jar,\ +catalina-tribes.jar,\ +catalina.jar,\ +cglib-*.jar,\ +cobertura-*.jar,\ +commons-beanutils*.jar,\ +commons-codec*.jar,\ +commons-collections*.jar,\ +commons-compress*.jar,\ +commons-daemon.jar,\ +commons-dbcp*.jar,\ +commons-digester*.jar,\ +commons-fileupload*.jar,\ +commons-httpclient*.jar,\ +commons-io*.jar,\ +commons-lang*.jar,\ +commons-logging*.jar,\ +commons-math*.jar,\ +commons-pool*.jar,\ +derby-*.jar,\ +dom4j-*.jar,\ +easymock-*.jar,\ +ecj-*.jar,\ +el-api.jar,\ +geronimo-spec-jaxrpc*.jar,\ +h2*.jar,\ +ha-api-*.jar,\ +hamcrest-*.jar,\ +hibernate*.jar,\ +httpclient*.jar,\ +icu4j-*.jar,\ +jasper-el.jar,\ +jasper.jar,\ +jaspic-api.jar,\ +jaxb-*.jar,\ +jaxen-*.jar,\ +jaxws-rt-*.jar,\ +jdom-*.jar,\ +jetty-*.jar,\ +jmx-tools.jar,\ +jmx.jar,\ +jsp-api.jar,\ +jstl.jar,\ +jta*.jar,\ +junit-*.jar,\ +junit.jar,\ +log4j*.jar,\ +mail*.jar,\ +objenesis-*.jar,\ +oraclepki.jar,\ +org.hamcrest.core_*.jar,\ +org.junit_*.jar,\ +oro-*.jar,\ +servlet-api-*.jar,\ +servlet-api.jar,\ +slf4j*.jar,\ +taglibs-standard-spec-*.jar,\ +tagsoup-*.jar,\ +tomcat-api.jar,\ +tomcat-coyote.jar,\ +tomcat-dbcp.jar,\ +tomcat-i18n-*.jar,\ +tomcat-jdbc.jar,\ +tomcat-jni.jar,\ +tomcat-juli-adapters.jar,\ +tomcat-juli.jar,\ +tomcat-util-scan.jar,\ +tomcat-util.jar,\ +tomcat-websocket.jar,\ +tools.jar,\ +unboundid-ldapsdk-*.jar,\ +websocket-api.jar,\ +wsdl4j*.jar,\ +xercesImpl.jar,\ +xml-apis.jar,\ +xmlParserAPIs-*.jar,\ +xmlParserAPIs.jar,\ +xom-*.jar + +# Default list of JAR files that should be scanned that overrides the default +# jarsToSkip list above. This is typically used to include a specific JAR that +# has been excluded by a broad file name pattern in the jarsToSkip list. +# The list of JARs to scan may be over-ridden at a Context level for individual +# scan types by configuring a JarScanner with a nested JarScanFilter. +tomcat.util.scan.StandardJarScanFilter.jarsToScan=\ +log4j-taglib*.jar,\ +log4j-web*.jar,\ +log4javascript*.jar,\ +slf4j-taglib*.jar + +# String cache configuration. +tomcat.util.buf.StringCache.byte.enabled=true +#tomcat.util.buf.StringCache.char.enabled=true +#tomcat.util.buf.StringCache.trainThreshold=500000 +#tomcat.util.buf.StringCache.cacheSize=5000 + +# Disable use of some privilege blocks Tomcat doesn't need since calls to the +# code in question are always already inside a privilege block +org.apache.el.GET_CLASSLOADER_USE_PRIVILEGED=false diff --git a/Servers/Tomcat v9.0 Server at localhost-config/context.xml b/Servers/Tomcat v9.0 Server at localhost-config/context.xml new file mode 100644 index 00000000..befa0c29 --- /dev/null +++ b/Servers/Tomcat v9.0 Server at localhost-config/context.xml @@ -0,0 +1,29 @@ + + + + + + WEB-INF/web.xml + WEB-INF/tomcat-web.xml + ${catalina.base}/conf/web.xml + + + + \ No newline at end of file diff --git a/Servers/Tomcat v9.0 Server at localhost-config/server.xml b/Servers/Tomcat v9.0 Server at localhost-config/server.xml new file mode 100644 index 00000000..753643c8 --- /dev/null +++ b/Servers/Tomcat v9.0 Server at localhost-config/server.xml @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Servers/Tomcat v9.0 Server at localhost-config/tomcat-users.xml b/Servers/Tomcat v9.0 Server at localhost-config/tomcat-users.xml new file mode 100644 index 00000000..009a485e --- /dev/null +++ b/Servers/Tomcat v9.0 Server at localhost-config/tomcat-users.xml @@ -0,0 +1,52 @@ + + + + + + + \ No newline at end of file diff --git a/Servers/Tomcat v9.0 Server at localhost-config/web.xml b/Servers/Tomcat v9.0 Server at localhost-config/web.xml new file mode 100644 index 00000000..eb08beae --- /dev/null +++ b/Servers/Tomcat v9.0 Server at localhost-config/web.xml @@ -0,0 +1,4735 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + default + org.apache.catalina.servlets.DefaultServlet + + debug + 0 + + + listings + false + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + jsp + org.apache.jasper.servlet.JspServlet + + fork + false + + + xpoweredBy + false + + 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + default + / + + + + + jsp + *.jsp + *.jspx + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 30 + + + + + + + + + + + + + 123 + application/vnd.lotus-1-2-3 + + + 3dml + text/vnd.in3d.3dml + + + 3ds + image/x-3ds + + + 3g2 + video/3gpp2 + + + 3gp + video/3gpp + + + 7z + application/x-7z-compressed + + + aab + application/x-authorware-bin + + + aac + audio/x-aac + + + aam + application/x-authorware-map + + + aas + application/x-authorware-seg + + + abs + audio/x-mpeg + + + abw + application/x-abiword + + + ac + application/pkix-attr-cert + + + acc + application/vnd.americandynamics.acc + + + ace + application/x-ace-compressed + + + acu + application/vnd.acucobol + + + acutc + application/vnd.acucorp + + + adp + audio/adpcm + + + aep + application/vnd.audiograph + + + afm + application/x-font-type1 + + + afp + application/vnd.ibm.modcap + + + ahead + application/vnd.ahead.space + + + ai + application/postscript + + + aif + audio/x-aiff + + + aifc + audio/x-aiff + + + aiff + audio/x-aiff + + + aim + application/x-aim + + + air + application/vnd.adobe.air-application-installer-package+zip + + + ait + application/vnd.dvb.ait + + + ami + application/vnd.amiga.ami + + + anx + application/annodex + + + apk + application/vnd.android.package-archive + + + appcache + text/cache-manifest + + + application + application/x-ms-application + + + apr + application/vnd.lotus-approach + + + arc + application/x-freearc + + + art + image/x-jg + + + asc + application/pgp-signature + + + asf + video/x-ms-asf + + + asm + text/x-asm + + + aso + application/vnd.accpac.simply.aso + + + asx + video/x-ms-asf + + + atc + application/vnd.acucorp + + + atom + application/atom+xml + + + atomcat + application/atomcat+xml + + + atomsvc + application/atomsvc+xml + + + atx + application/vnd.antix.game-component + + + au + audio/basic + + + avi + video/x-msvideo + + + avx + video/x-rad-screenplay + + + aw + application/applixware + + + axa + audio/annodex + + + axv + video/annodex + + + azf + application/vnd.airzip.filesecure.azf + + + azs + application/vnd.airzip.filesecure.azs + + + azw + application/vnd.amazon.ebook + + + bat + application/x-msdownload + + + bcpio + application/x-bcpio + + + bdf + application/x-font-bdf + + + bdm + application/vnd.syncml.dm+wbxml + + + bed + application/vnd.realvnc.bed + + + bh2 + application/vnd.fujitsu.oasysprs + + + bin + application/octet-stream + + + blb + application/x-blorb + + + blorb + application/x-blorb + + + bmi + application/vnd.bmi + + + bmp + image/bmp + + + body + text/html + + + book + application/vnd.framemaker + + + box + application/vnd.previewsystems.box + + + boz + application/x-bzip2 + + + bpk + application/octet-stream + + + btif + image/prs.btif + + + bz + application/x-bzip + + + bz2 + application/x-bzip2 + + + c + text/x-c + + + c11amc + application/vnd.cluetrust.cartomobile-config + + + c11amz + application/vnd.cluetrust.cartomobile-config-pkg + + + c4d + application/vnd.clonk.c4group + + + c4f + application/vnd.clonk.c4group + + + c4g + application/vnd.clonk.c4group + + + c4p + application/vnd.clonk.c4group + + + c4u + application/vnd.clonk.c4group + + + cab + application/vnd.ms-cab-compressed + + + caf + audio/x-caf + + + cap + application/vnd.tcpdump.pcap + + + car + application/vnd.curl.car + + + cat + application/vnd.ms-pki.seccat + + + cb7 + application/x-cbr + + + cba + application/x-cbr + + + cbr + application/x-cbr + + + cbt + application/x-cbr + + + cbz + application/x-cbr + + + cc + text/x-c + + + cct + application/x-director + + + ccxml + application/ccxml+xml + + + cdbcmsg + application/vnd.contact.cmsg + + + cdf + application/x-cdf + + + cdkey + application/vnd.mediastation.cdkey + + + cdmia + application/cdmi-capability + + + cdmic + application/cdmi-container + + + cdmid + application/cdmi-domain + + + cdmio + application/cdmi-object + + + cdmiq + application/cdmi-queue + + + cdx + chemical/x-cdx + + + cdxml + application/vnd.chemdraw+xml + + + cdy + application/vnd.cinderella + + + cer + application/pkix-cert + + + cfs + application/x-cfs-compressed + + + cgm + image/cgm + + + chat + application/x-chat + + + chm + application/vnd.ms-htmlhelp + + + chrt + application/vnd.kde.kchart + + + cif + chemical/x-cif + + + cii + application/vnd.anser-web-certificate-issue-initiation + + + cil + application/vnd.ms-artgalry + + + cla + application/vnd.claymore + + + class + application/java + + + clkk + application/vnd.crick.clicker.keyboard + + + clkp + application/vnd.crick.clicker.palette + + + clkt + application/vnd.crick.clicker.template + + + clkw + application/vnd.crick.clicker.wordbank + + + clkx + application/vnd.crick.clicker + + + clp + application/x-msclip + + + cmc + application/vnd.cosmocaller + + + cmdf + chemical/x-cmdf + + + cml + chemical/x-cml + + + cmp + application/vnd.yellowriver-custom-menu + + + cmx + image/x-cmx + + + cod + application/vnd.rim.cod + + + com + application/x-msdownload + + + conf + text/plain + + + cpio + application/x-cpio + + + cpp + text/x-c + + + cpt + application/mac-compactpro + + + crd + application/x-mscardfile + + + crl + application/pkix-crl + + + crt + application/x-x509-ca-cert + + + cryptonote + application/vnd.rig.cryptonote + + + csh + application/x-csh + + + csml + chemical/x-csml + + + csp + application/vnd.commonspace + + + css + text/css + + + cst + application/x-director + + + csv + text/csv + + + cu + application/cu-seeme + + + curl + text/vnd.curl + + + cww + application/prs.cww + + + cxt + application/x-director + + + cxx + text/x-c + + + dae + model/vnd.collada+xml + + + daf + application/vnd.mobius.daf + + + dart + application/vnd.dart + + + dataless + application/vnd.fdsn.seed + + + davmount + application/davmount+xml + + + dbk + application/docbook+xml + + + dcr + application/x-director + + + dcurl + text/vnd.curl.dcurl + + + dd2 + application/vnd.oma.dd2+xml + + + ddd + application/vnd.fujixerox.ddd + + + deb + application/x-debian-package + + + def + text/plain + + + deploy + application/octet-stream + + + der + application/x-x509-ca-cert + + + dfac + application/vnd.dreamfactory + + + dgc + application/x-dgc-compressed + + + dib + image/bmp + + + dic + text/x-c + + + dir + application/x-director + + + dis + application/vnd.mobius.dis + + + dist + application/octet-stream + + + distz + application/octet-stream + + + djv + image/vnd.djvu + + + djvu + image/vnd.djvu + + + dll + application/x-msdownload + + + dmg + application/x-apple-diskimage + + + dmp + application/vnd.tcpdump.pcap + + + dms + application/octet-stream + + + dna + application/vnd.dna + + + doc + application/msword + + + docm + application/vnd.ms-word.document.macroenabled.12 + + + docx + application/vnd.openxmlformats-officedocument.wordprocessingml.document + + + dot + application/msword + + + dotm + application/vnd.ms-word.template.macroenabled.12 + + + dotx + application/vnd.openxmlformats-officedocument.wordprocessingml.template + + + dp + application/vnd.osgi.dp + + + dpg + application/vnd.dpgraph + + + dra + audio/vnd.dra + + + dsc + text/prs.lines.tag + + + dssc + application/dssc+der + + + dtb + application/x-dtbook+xml + + + dtd + application/xml-dtd + + + dts + audio/vnd.dts + + + dtshd + audio/vnd.dts.hd + + + dump + application/octet-stream + + + dv + video/x-dv + + + dvb + video/vnd.dvb.file + + + dvi + application/x-dvi + + + dwf + model/vnd.dwf + + + dwg + image/vnd.dwg + + + dxf + image/vnd.dxf + + + dxp + application/vnd.spotfire.dxp + + + dxr + application/x-director + + + ecelp4800 + audio/vnd.nuera.ecelp4800 + + + ecelp7470 + audio/vnd.nuera.ecelp7470 + + + ecelp9600 + audio/vnd.nuera.ecelp9600 + + + ecma + application/ecmascript + + + edm + application/vnd.novadigm.edm + + + edx + application/vnd.novadigm.edx + + + efif + application/vnd.picsel + + + ei6 + application/vnd.pg.osasli + + + elc + application/octet-stream + + + emf + application/x-msmetafile + + + eml + message/rfc822 + + + emma + application/emma+xml + + + emz + application/x-msmetafile + + + eol + audio/vnd.digital-winds + + + eot + application/vnd.ms-fontobject + + + eps + application/postscript + + + epub + application/epub+zip + + + es3 + application/vnd.eszigno3+xml + + + esa + application/vnd.osgi.subsystem + + + esf + application/vnd.epson.esf + + + et3 + application/vnd.eszigno3+xml + + + etx + text/x-setext + + + eva + application/x-eva + + + evy + application/x-envoy + + + exe + application/octet-stream + + + exi + application/exi + + + ext + application/vnd.novadigm.ext + + + ez + application/andrew-inset + + + ez2 + application/vnd.ezpix-album + + + ez3 + application/vnd.ezpix-package + + + f + text/x-fortran + + + f4v + video/x-f4v + + + f77 + text/x-fortran + + + f90 + text/x-fortran + + + fbs + image/vnd.fastbidsheet + + + fcdt + application/vnd.adobe.formscentral.fcdt + + + fcs + application/vnd.isac.fcs + + + fdf + application/vnd.fdf + + + fe_launch + application/vnd.denovo.fcselayout-link + + + fg5 + application/vnd.fujitsu.oasysgp + + + fgd + application/x-director + + + fh + image/x-freehand + + + fh4 + image/x-freehand + + + fh5 + image/x-freehand + + + fh7 + image/x-freehand + + + fhc + image/x-freehand + + + fig + application/x-xfig + + + flac + audio/flac + + + fli + video/x-fli + + + flo + application/vnd.micrografx.flo + + + flv + video/x-flv + + + flw + application/vnd.kde.kivio + + + flx + text/vnd.fmi.flexstor + + + fly + text/vnd.fly + + + fm + application/vnd.framemaker + + + fnc + application/vnd.frogans.fnc + + + for + text/x-fortran + + + fpx + image/vnd.fpx + + + frame + application/vnd.framemaker + + + fsc + application/vnd.fsc.weblaunch + + + fst + image/vnd.fst + + + ftc + application/vnd.fluxtime.clip + + + fti + application/vnd.anser-web-funds-transfer-initiation + + + fvt + video/vnd.fvt + + + fxp + application/vnd.adobe.fxp + + + fxpl + application/vnd.adobe.fxp + + + fzs + application/vnd.fuzzysheet + + + g2w + application/vnd.geoplan + + + g3 + image/g3fax + + + g3w + application/vnd.geospace + + + gac + application/vnd.groove-account + + + gam + application/x-tads + + + gbr + application/rpki-ghostbusters + + + gca + application/x-gca-compressed + + + gdl + model/vnd.gdl + + + geo + application/vnd.dynageo + + + gex + application/vnd.geometry-explorer + + + ggb + application/vnd.geogebra.file + + + ggt + application/vnd.geogebra.tool + + + ghf + application/vnd.groove-help + + + gif + image/gif + + + gim + application/vnd.groove-identity-message + + + gml + application/gml+xml + + + gmx + application/vnd.gmx + + + gnumeric + application/x-gnumeric + + + gph + application/vnd.flographit + + + gpx + application/gpx+xml + + + gqf + application/vnd.grafeq + + + gqs + application/vnd.grafeq + + + gram + application/srgs + + + gramps + application/x-gramps-xml + + + gre + application/vnd.geometry-explorer + + + grv + application/vnd.groove-injector + + + grxml + application/srgs+xml + + + gsf + application/x-font-ghostscript + + + gtar + application/x-gtar + + + gtm + application/vnd.groove-tool-message + + + gtw + model/vnd.gtw + + + gv + text/vnd.graphviz + + + gxf + application/gxf + + + gxt + application/vnd.geonext + + + gz + application/x-gzip + + + h + text/x-c + + + h261 + video/h261 + + + h263 + video/h263 + + + h264 + video/h264 + + + hal + application/vnd.hal+xml + + + hbci + application/vnd.hbci + + + hdf + application/x-hdf + + + hh + text/x-c + + + hlp + application/winhlp + + + hpgl + application/vnd.hp-hpgl + + + hpid + application/vnd.hp-hpid + + + hps + application/vnd.hp-hps + + + hqx + application/mac-binhex40 + + + htc + text/x-component + + + htke + application/vnd.kenameaapp + + + htm + text/html + + + html + text/html + + + hvd + application/vnd.yamaha.hv-dic + + + hvp + application/vnd.yamaha.hv-voice + + + hvs + application/vnd.yamaha.hv-script + + + i2g + application/vnd.intergeo + + + icc + application/vnd.iccprofile + + + ice + x-conference/x-cooltalk + + + icm + application/vnd.iccprofile + + + ico + image/x-icon + + + ics + text/calendar + + + ief + image/ief + + + ifb + text/calendar + + + ifm + application/vnd.shana.informed.formdata + + + iges + model/iges + + + igl + application/vnd.igloader + + + igm + application/vnd.insors.igm + + + igs + model/iges + + + igx + application/vnd.micrografx.igx + + + iif + application/vnd.shana.informed.interchange + + + imp + application/vnd.accpac.simply.imp + + + ims + application/vnd.ms-ims + + + in + text/plain + + + ink + application/inkml+xml + + + inkml + application/inkml+xml + + + install + application/x-install-instructions + + + iota + application/vnd.astraea-software.iota + + + ipfix + application/ipfix + + + ipk + application/vnd.shana.informed.package + + + irm + application/vnd.ibm.rights-management + + + irp + application/vnd.irepository.package+xml + + + iso + application/x-iso9660-image + + + itp + application/vnd.shana.informed.formtemplate + + + ivp + application/vnd.immervision-ivp + + + ivu + application/vnd.immervision-ivu + + + jad + text/vnd.sun.j2me.app-descriptor + + + jam + application/vnd.jam + + + jar + application/java-archive + + + java + text/x-java-source + + + jisp + application/vnd.jisp + + + jlt + application/vnd.hp-jlyt + + + jnlp + application/x-java-jnlp-file + + + joda + application/vnd.joost.joda-archive + + + jpe + image/jpeg + + + jpeg + image/jpeg + + + jpg + image/jpeg + + + jpgm + video/jpm + + + jpgv + video/jpeg + + + jpm + video/jpm + + + js + text/javascript + + + jsf + text/plain + + + json + application/json + + + jsonml + application/jsonml+json + + + jspf + text/plain + + + kar + audio/midi + + + karbon + application/vnd.kde.karbon + + + kfo + application/vnd.kde.kformula + + + kia + application/vnd.kidspiration + + + kml + application/vnd.google-earth.kml+xml + + + kmz + application/vnd.google-earth.kmz + + + kne + application/vnd.kinar + + + knp + application/vnd.kinar + + + kon + application/vnd.kde.kontour + + + kpr + application/vnd.kde.kpresenter + + + kpt + application/vnd.kde.kpresenter + + + kpxx + application/vnd.ds-keypoint + + + ksp + application/vnd.kde.kspread + + + ktr + application/vnd.kahootz + + + ktx + image/ktx + + + ktz + application/vnd.kahootz + + + kwd + application/vnd.kde.kword + + + kwt + application/vnd.kde.kword + + + lasxml + application/vnd.las.las+xml + + + latex + application/x-latex + + + lbd + application/vnd.llamagraphics.life-balance.desktop + + + lbe + application/vnd.llamagraphics.life-balance.exchange+xml + + + les + application/vnd.hhe.lesson-player + + + lha + application/x-lzh-compressed + + + link66 + application/vnd.route66.link66+xml + + + list + text/plain + + + list3820 + application/vnd.ibm.modcap + + + listafp + application/vnd.ibm.modcap + + + lnk + application/x-ms-shortcut + + + log + text/plain + + + lostxml + application/lost+xml + + + lrf + application/octet-stream + + + lrm + application/vnd.ms-lrm + + + ltf + application/vnd.frogans.ltf + + + lvp + audio/vnd.lucent.voice + + + lwp + application/vnd.lotus-wordpro + + + lzh + application/x-lzh-compressed + + + m13 + application/x-msmediaview + + + m14 + application/x-msmediaview + + + m1v + video/mpeg + + + m21 + application/mp21 + + + m2a + audio/mpeg + + + m2v + video/mpeg + + + m3a + audio/mpeg + + + m3u + audio/x-mpegurl + + + m3u8 + application/vnd.apple.mpegurl + + + m4a + audio/mp4 + + + m4b + audio/mp4 + + + m4r + audio/mp4 + + + m4u + video/vnd.mpegurl + + + m4v + video/mp4 + + + ma + application/mathematica + + + mac + image/x-macpaint + + + mads + application/mads+xml + + + mag + application/vnd.ecowin.chart + + + maker + application/vnd.framemaker + + + man + text/troff + + + mar + application/octet-stream + + + mathml + application/mathml+xml + + + mb + application/mathematica + + + mbk + application/vnd.mobius.mbk + + + mbox + application/mbox + + + mc1 + application/vnd.medcalcdata + + + mcd + application/vnd.mcd + + + mcurl + text/vnd.curl.mcurl + + + mdb + application/x-msaccess + + + mdi + image/vnd.ms-modi + + + me + text/troff + + + mesh + model/mesh + + + meta4 + application/metalink4+xml + + + metalink + application/metalink+xml + + + mets + application/mets+xml + + + mfm + application/vnd.mfmp + + + mft + application/rpki-manifest + + + mgp + application/vnd.osgeo.mapguide.package + + + mgz + application/vnd.proteus.magazine + + + mid + audio/midi + + + midi + audio/midi + + + mie + application/x-mie + + + mif + application/x-mif + + + mime + message/rfc822 + + + mj2 + video/mj2 + + + mjp2 + video/mj2 + + + mk3d + video/x-matroska + + + mka + audio/x-matroska + + + mks + video/x-matroska + + + mkv + video/x-matroska + + + mlp + application/vnd.dolby.mlp + + + mmd + application/vnd.chipnuts.karaoke-mmd + + + mmf + application/vnd.smaf + + + mmr + image/vnd.fujixerox.edmics-mmr + + + mng + video/x-mng + + + mny + application/x-msmoney + + + mobi + application/x-mobipocket-ebook + + + mods + application/mods+xml + + + mov + video/quicktime + + + movie + video/x-sgi-movie + + + mp1 + audio/mpeg + + + mp2 + audio/mpeg + + + mp21 + application/mp21 + + + mp2a + audio/mpeg + + + mp3 + audio/mpeg + + + mp4 + video/mp4 + + + mp4a + audio/mp4 + + + mp4s + application/mp4 + + + mp4v + video/mp4 + + + mpa + audio/mpeg + + + mpc + application/vnd.mophun.certificate + + + mpe + video/mpeg + + + mpeg + video/mpeg + + + mpega + audio/x-mpeg + + + mpg + video/mpeg + + + mpg4 + video/mp4 + + + mpga + audio/mpeg + + + mpkg + application/vnd.apple.installer+xml + + + mpm + application/vnd.blueice.multipass + + + mpn + application/vnd.mophun.application + + + mpp + application/vnd.ms-project + + + mpt + application/vnd.ms-project + + + mpv2 + video/mpeg2 + + + mpy + application/vnd.ibm.minipay + + + mqy + application/vnd.mobius.mqy + + + mrc + application/marc + + + mrcx + application/marcxml+xml + + + ms + text/troff + + + mscml + application/mediaservercontrol+xml + + + mseed + application/vnd.fdsn.mseed + + + mseq + application/vnd.mseq + + + msf + application/vnd.epson.msf + + + msh + model/mesh + + + msi + application/x-msdownload + + + msl + application/vnd.mobius.msl + + + msty + application/vnd.muvee.style + + + mts + model/vnd.mts + + + mus + application/vnd.musician + + + musicxml + application/vnd.recordare.musicxml+xml + + + mvb + application/x-msmediaview + + + mwf + application/vnd.mfer + + + mxf + application/mxf + + + mxl + application/vnd.recordare.musicxml + + + mxml + application/xv+xml + + + mxs + application/vnd.triscape.mxs + + + mxu + video/vnd.mpegurl + + + n-gage + application/vnd.nokia.n-gage.symbian.install + + + n3 + text/n3 + + + nb + application/mathematica + + + nbp + application/vnd.wolfram.player + + + nc + application/x-netcdf + + + ncx + application/x-dtbncx+xml + + + nfo + text/x-nfo + + + ngdat + application/vnd.nokia.n-gage.data + + + nitf + application/vnd.nitf + + + nlu + application/vnd.neurolanguage.nlu + + + nml + application/vnd.enliven + + + nnd + application/vnd.noblenet-directory + + + nns + application/vnd.noblenet-sealer + + + nnw + application/vnd.noblenet-web + + + npx + image/vnd.net-fpx + + + nsc + application/x-conference + + + nsf + application/vnd.lotus-notes + + + ntf + application/vnd.nitf + + + nzb + application/x-nzb + + + oa2 + application/vnd.fujitsu.oasys2 + + + oa3 + application/vnd.fujitsu.oasys3 + + + oas + application/vnd.fujitsu.oasys + + + obd + application/x-msbinder + + + obj + application/x-tgif + + + oda + application/oda + + + + odb + application/vnd.oasis.opendocument.database + + + + odc + application/vnd.oasis.opendocument.chart + + + + odf + application/vnd.oasis.opendocument.formula + + + odft + application/vnd.oasis.opendocument.formula-template + + + + odg + application/vnd.oasis.opendocument.graphics + + + + odi + application/vnd.oasis.opendocument.image + + + + odm + application/vnd.oasis.opendocument.text-master + + + + odp + application/vnd.oasis.opendocument.presentation + + + + ods + application/vnd.oasis.opendocument.spreadsheet + + + + odt + application/vnd.oasis.opendocument.text + + + oga + audio/ogg + + + ogg + audio/ogg + + + ogv + video/ogg + + + + ogx + application/ogg + + + omdoc + application/omdoc+xml + + + onepkg + application/onenote + + + onetmp + application/onenote + + + onetoc + application/onenote + + + onetoc2 + application/onenote + + + opf + application/oebps-package+xml + + + opml + text/x-opml + + + oprc + application/vnd.palm + + + org + application/vnd.lotus-organizer + + + osf + application/vnd.yamaha.openscoreformat + + + osfpvg + application/vnd.yamaha.openscoreformat.osfpvg+xml + + + otc + application/vnd.oasis.opendocument.chart-template + + + otf + font/otf + + + + otg + application/vnd.oasis.opendocument.graphics-template + + + + oth + application/vnd.oasis.opendocument.text-web + + + oti + application/vnd.oasis.opendocument.image-template + + + + otp + application/vnd.oasis.opendocument.presentation-template + + + + ots + application/vnd.oasis.opendocument.spreadsheet-template + + + + ott + application/vnd.oasis.opendocument.text-template + + + oxps + application/oxps + + + oxt + application/vnd.openofficeorg.extension + + + p + text/x-pascal + + + p10 + application/pkcs10 + + + p12 + application/x-pkcs12 + + + p7b + application/x-pkcs7-certificates + + + p7c + application/pkcs7-mime + + + p7m + application/pkcs7-mime + + + p7r + application/x-pkcs7-certreqresp + + + p7s + application/pkcs7-signature + + + p8 + application/pkcs8 + + + pas + text/x-pascal + + + paw + application/vnd.pawaafile + + + pbd + application/vnd.powerbuilder6 + + + pbm + image/x-portable-bitmap + + + pcap + application/vnd.tcpdump.pcap + + + pcf + application/x-font-pcf + + + pcl + application/vnd.hp-pcl + + + pclxl + application/vnd.hp-pclxl + + + pct + image/pict + + + pcurl + application/vnd.curl.pcurl + + + pcx + image/x-pcx + + + pdb + application/vnd.palm + + + pdf + application/pdf + + + pfa + application/x-font-type1 + + + pfb + application/x-font-type1 + + + pfm + application/x-font-type1 + + + pfr + application/font-tdpfr + + + pfx + application/x-pkcs12 + + + pgm + image/x-portable-graymap + + + pgn + application/x-chess-pgn + + + pgp + application/pgp-encrypted + + + pic + image/pict + + + pict + image/pict + + + pkg + application/octet-stream + + + pki + application/pkixcmp + + + pkipath + application/pkix-pkipath + + + plb + application/vnd.3gpp.pic-bw-large + + + plc + application/vnd.mobius.plc + + + plf + application/vnd.pocketlearn + + + pls + audio/x-scpls + + + pml + application/vnd.ctc-posml + + + png + image/png + + + pnm + image/x-portable-anymap + + + pnt + image/x-macpaint + + + portpkg + application/vnd.macports.portpkg + + + pot + application/vnd.ms-powerpoint + + + potm + application/vnd.ms-powerpoint.template.macroenabled.12 + + + potx + application/vnd.openxmlformats-officedocument.presentationml.template + + + ppam + application/vnd.ms-powerpoint.addin.macroenabled.12 + + + ppd + application/vnd.cups-ppd + + + ppm + image/x-portable-pixmap + + + pps + application/vnd.ms-powerpoint + + + ppsm + application/vnd.ms-powerpoint.slideshow.macroenabled.12 + + + ppsx + application/vnd.openxmlformats-officedocument.presentationml.slideshow + + + ppt + application/vnd.ms-powerpoint + + + pptm + application/vnd.ms-powerpoint.presentation.macroenabled.12 + + + pptx + application/vnd.openxmlformats-officedocument.presentationml.presentation + + + pqa + application/vnd.palm + + + prc + application/x-mobipocket-ebook + + + pre + application/vnd.lotus-freelance + + + prf + application/pics-rules + + + ps + application/postscript + + + psb + application/vnd.3gpp.pic-bw-small + + + psd + image/vnd.adobe.photoshop + + + psf + application/x-font-linux-psf + + + pskcxml + application/pskc+xml + + + ptid + application/vnd.pvi.ptid1 + + + pub + application/x-mspublisher + + + pvb + application/vnd.3gpp.pic-bw-var + + + pwn + application/vnd.3m.post-it-notes + + + pya + audio/vnd.ms-playready.media.pya + + + pyv + video/vnd.ms-playready.media.pyv + + + qam + application/vnd.epson.quickanime + + + qbo + application/vnd.intu.qbo + + + qfx + application/vnd.intu.qfx + + + qps + application/vnd.publishare-delta-tree + + + qt + video/quicktime + + + qti + image/x-quicktime + + + qtif + image/x-quicktime + + + qwd + application/vnd.quark.quarkxpress + + + qwt + application/vnd.quark.quarkxpress + + + qxb + application/vnd.quark.quarkxpress + + + qxd + application/vnd.quark.quarkxpress + + + qxl + application/vnd.quark.quarkxpress + + + qxt + application/vnd.quark.quarkxpress + + + ra + audio/x-pn-realaudio + + + ram + audio/x-pn-realaudio + + + rar + application/x-rar-compressed + + + ras + image/x-cmu-raster + + + rcprofile + application/vnd.ipunplugged.rcprofile + + + rdf + application/rdf+xml + + + rdz + application/vnd.data-vision.rdz + + + rep + application/vnd.businessobjects + + + res + application/x-dtbresource+xml + + + rgb + image/x-rgb + + + rif + application/reginfo+xml + + + rip + audio/vnd.rip + + + ris + application/x-research-info-systems + + + rl + application/resource-lists+xml + + + rlc + image/vnd.fujixerox.edmics-rlc + + + rld + application/resource-lists-diff+xml + + + rm + application/vnd.rn-realmedia + + + rmi + audio/midi + + + rmp + audio/x-pn-realaudio-plugin + + + rms + application/vnd.jcp.javame.midlet-rms + + + rmvb + application/vnd.rn-realmedia-vbr + + + rnc + application/relax-ng-compact-syntax + + + roa + application/rpki-roa + + + roff + text/troff + + + rp9 + application/vnd.cloanto.rp9 + + + rpss + application/vnd.nokia.radio-presets + + + rpst + application/vnd.nokia.radio-preset + + + rq + application/sparql-query + + + rs + application/rls-services+xml + + + rsd + application/rsd+xml + + + rss + application/rss+xml + + + rtf + application/rtf + + + rtx + text/richtext + + + s + text/x-asm + + + s3m + audio/s3m + + + saf + application/vnd.yamaha.smaf-audio + + + sbml + application/sbml+xml + + + sc + application/vnd.ibm.secure-container + + + scd + application/x-msschedule + + + scm + application/vnd.lotus-screencam + + + scq + application/scvp-cv-request + + + scs + application/scvp-cv-response + + + scurl + text/vnd.curl.scurl + + + sda + application/vnd.stardivision.draw + + + sdc + application/vnd.stardivision.calc + + + sdd + application/vnd.stardivision.impress + + + sdkd + application/vnd.solent.sdkm+xml + + + sdkm + application/vnd.solent.sdkm+xml + + + sdp + application/sdp + + + sdw + application/vnd.stardivision.writer + + + see + application/vnd.seemail + + + seed + application/vnd.fdsn.seed + + + sema + application/vnd.sema + + + semd + application/vnd.semd + + + semf + application/vnd.semf + + + ser + application/java-serialized-object + + + setpay + application/set-payment-initiation + + + setreg + application/set-registration-initiation + + + sfd-hdstx + application/vnd.hydrostatix.sof-data + + + sfs + application/vnd.spotfire.sfs + + + sfv + text/x-sfv + + + sgi + image/sgi + + + sgl + application/vnd.stardivision.writer-global + + + sgm + text/sgml + + + sgml + text/sgml + + + sh + application/x-sh + + + shar + application/x-shar + + + shf + application/shf+xml + + + + sid + image/x-mrsid-image + + + sig + application/pgp-signature + + + sil + audio/silk + + + silo + model/mesh + + + sis + application/vnd.symbian.install + + + sisx + application/vnd.symbian.install + + + sit + application/x-stuffit + + + sitx + application/x-stuffitx + + + skd + application/vnd.koan + + + skm + application/vnd.koan + + + skp + application/vnd.koan + + + skt + application/vnd.koan + + + sldm + application/vnd.ms-powerpoint.slide.macroenabled.12 + + + sldx + application/vnd.openxmlformats-officedocument.presentationml.slide + + + slt + application/vnd.epson.salt + + + sm + application/vnd.stepmania.stepchart + + + smf + application/vnd.stardivision.math + + + smi + application/smil+xml + + + smil + application/smil+xml + + + smv + video/x-smv + + + smzip + application/vnd.stepmania.package + + + snd + audio/basic + + + snf + application/x-font-snf + + + so + application/octet-stream + + + spc + application/x-pkcs7-certificates + + + spf + application/vnd.yamaha.smaf-phrase + + + spl + application/x-futuresplash + + + spot + text/vnd.in3d.spot + + + spp + application/scvp-vp-response + + + spq + application/scvp-vp-request + + + spx + audio/ogg + + + sql + application/x-sql + + + src + application/x-wais-source + + + srt + application/x-subrip + + + sru + application/sru+xml + + + srx + application/sparql-results+xml + + + ssdl + application/ssdl+xml + + + sse + application/vnd.kodak-descriptor + + + ssf + application/vnd.epson.ssf + + + ssml + application/ssml+xml + + + st + application/vnd.sailingtracker.track + + + stc + application/vnd.sun.xml.calc.template + + + std + application/vnd.sun.xml.draw.template + + + stf + application/vnd.wt.stf + + + sti + application/vnd.sun.xml.impress.template + + + stk + application/hyperstudio + + + stl + application/vnd.ms-pki.stl + + + str + application/vnd.pg.format + + + stw + application/vnd.sun.xml.writer.template + + + sub + text/vnd.dvb.subtitle + + + sus + application/vnd.sus-calendar + + + susp + application/vnd.sus-calendar + + + sv4cpio + application/x-sv4cpio + + + sv4crc + application/x-sv4crc + + + svc + application/vnd.dvb.service + + + svd + application/vnd.svd + + + svg + image/svg+xml + + + svgz + image/svg+xml + + + swa + application/x-director + + + swf + application/x-shockwave-flash + + + swi + application/vnd.aristanetworks.swi + + + sxc + application/vnd.sun.xml.calc + + + sxd + application/vnd.sun.xml.draw + + + sxg + application/vnd.sun.xml.writer.global + + + sxi + application/vnd.sun.xml.impress + + + sxm + application/vnd.sun.xml.math + + + sxw + application/vnd.sun.xml.writer + + + t + text/troff + + + t3 + application/x-t3vm-image + + + taglet + application/vnd.mynfc + + + tao + application/vnd.tao.intent-module-archive + + + tar + application/x-tar + + + tcap + application/vnd.3gpp2.tcap + + + tcl + application/x-tcl + + + teacher + application/vnd.smart.teacher + + + tei + application/tei+xml + + + teicorpus + application/tei+xml + + + tex + application/x-tex + + + texi + application/x-texinfo + + + texinfo + application/x-texinfo + + + text + text/plain + + + tfi + application/thraud+xml + + + tfm + application/x-tex-tfm + + + tga + image/x-tga + + + thmx + application/vnd.ms-officetheme + + + tif + image/tiff + + + tiff + image/tiff + + + tmo + application/vnd.tmobile-livetv + + + torrent + application/x-bittorrent + + + tpl + application/vnd.groove-tool-template + + + tpt + application/vnd.trid.tpt + + + tr + text/troff + + + tra + application/vnd.trueapp + + + trm + application/x-msterminal + + + tsd + application/timestamped-data + + + tsv + text/tab-separated-values + + + ttc + font/collection + + + ttf + font/ttf + + + ttl + text/turtle + + + twd + application/vnd.simtech-mindmapper + + + twds + application/vnd.simtech-mindmapper + + + txd + application/vnd.genomatix.tuxedo + + + txf + application/vnd.mobius.txf + + + txt + text/plain + + + u32 + application/x-authorware-bin + + + udeb + application/x-debian-package + + + ufd + application/vnd.ufdl + + + ufdl + application/vnd.ufdl + + + ulw + audio/basic + + + ulx + application/x-glulx + + + umj + application/vnd.umajin + + + unityweb + application/vnd.unity + + + uoml + application/vnd.uoml+xml + + + uri + text/uri-list + + + uris + text/uri-list + + + urls + text/uri-list + + + ustar + application/x-ustar + + + utz + application/vnd.uiq.theme + + + uu + text/x-uuencode + + + uva + audio/vnd.dece.audio + + + uvd + application/vnd.dece.data + + + uvf + application/vnd.dece.data + + + uvg + image/vnd.dece.graphic + + + uvh + video/vnd.dece.hd + + + uvi + image/vnd.dece.graphic + + + uvm + video/vnd.dece.mobile + + + uvp + video/vnd.dece.pd + + + uvs + video/vnd.dece.sd + + + uvt + application/vnd.dece.ttml+xml + + + uvu + video/vnd.uvvu.mp4 + + + uvv + video/vnd.dece.video + + + uvva + audio/vnd.dece.audio + + + uvvd + application/vnd.dece.data + + + uvvf + application/vnd.dece.data + + + uvvg + image/vnd.dece.graphic + + + uvvh + video/vnd.dece.hd + + + uvvi + image/vnd.dece.graphic + + + uvvm + video/vnd.dece.mobile + + + uvvp + video/vnd.dece.pd + + + uvvs + video/vnd.dece.sd + + + uvvt + application/vnd.dece.ttml+xml + + + uvvu + video/vnd.uvvu.mp4 + + + uvvv + video/vnd.dece.video + + + uvvx + application/vnd.dece.unspecified + + + uvvz + application/vnd.dece.zip + + + uvx + application/vnd.dece.unspecified + + + uvz + application/vnd.dece.zip + + + vcard + text/vcard + + + vcd + application/x-cdlink + + + vcf + text/x-vcard + + + vcg + application/vnd.groove-vcard + + + vcs + text/x-vcalendar + + + vcx + application/vnd.vcx + + + vis + application/vnd.visionary + + + viv + video/vnd.vivo + + + vob + video/x-ms-vob + + + vor + application/vnd.stardivision.writer + + + vox + application/x-authorware-bin + + + vrml + model/vrml + + + vsd + application/vnd.visio + + + vsf + application/vnd.vsf + + + vss + application/vnd.visio + + + vst + application/vnd.visio + + + vsw + application/vnd.visio + + + vtu + model/vnd.vtu + + + vxml + application/voicexml+xml + + + w3d + application/x-director + + + wad + application/x-doom + + + wasm + application/wasm + + + wav + audio/x-wav + + + wax + audio/x-ms-wax + + + + wbmp + image/vnd.wap.wbmp + + + wbs + application/vnd.criticaltools.wbs+xml + + + wbxml + application/vnd.wap.wbxml + + + wcm + application/vnd.ms-works + + + wdb + application/vnd.ms-works + + + wdp + image/vnd.ms-photo + + + weba + audio/webm + + + webm + video/webm + + + webp + image/webp + + + wg + application/vnd.pmi.widget + + + wgt + application/widget + + + wks + application/vnd.ms-works + + + wm + video/x-ms-wm + + + wma + audio/x-ms-wma + + + wmd + application/x-ms-wmd + + + wmf + application/x-msmetafile + + + + wml + text/vnd.wap.wml + + + + wmlc + application/vnd.wap.wmlc + + + + wmls + text/vnd.wap.wmlscript + + + + wmlsc + application/vnd.wap.wmlscriptc + + + wmv + video/x-ms-wmv + + + wmx + video/x-ms-wmx + + + wmz + application/x-msmetafile + + + woff + font/woff + + + woff2 + font/woff2 + + + wpd + application/vnd.wordperfect + + + wpl + application/vnd.ms-wpl + + + wps + application/vnd.ms-works + + + wqd + application/vnd.wqd + + + wri + application/x-mswrite + + + wrl + model/vrml + + + wsdl + application/wsdl+xml + + + wspolicy + application/wspolicy+xml + + + wtb + application/vnd.webturbo + + + wvx + video/x-ms-wvx + + + x32 + application/x-authorware-bin + + + x3d + model/x3d+xml + + + x3db + model/x3d+binary + + + x3dbz + model/x3d+binary + + + x3dv + model/x3d+vrml + + + x3dvz + model/x3d+vrml + + + x3dz + model/x3d+xml + + + xaml + application/xaml+xml + + + xap + application/x-silverlight-app + + + xar + application/vnd.xara + + + xbap + application/x-ms-xbap + + + xbd + application/vnd.fujixerox.docuworks.binder + + + xbm + image/x-xbitmap + + + xdf + application/xcap-diff+xml + + + xdm + application/vnd.syncml.dm+xml + + + xdp + application/vnd.adobe.xdp+xml + + + xdssc + application/dssc+xml + + + xdw + application/vnd.fujixerox.docuworks + + + xenc + application/xenc+xml + + + xer + application/patch-ops-error+xml + + + xfdf + application/vnd.adobe.xfdf + + + xfdl + application/vnd.xfdl + + + xht + application/xhtml+xml + + + xhtml + application/xhtml+xml + + + xhvml + application/xv+xml + + + xif + image/vnd.xiff + + + xla + application/vnd.ms-excel + + + xlam + application/vnd.ms-excel.addin.macroenabled.12 + + + xlc + application/vnd.ms-excel + + + xlf + application/x-xliff+xml + + + xlm + application/vnd.ms-excel + + + xls + application/vnd.ms-excel + + + xlsb + application/vnd.ms-excel.sheet.binary.macroenabled.12 + + + xlsm + application/vnd.ms-excel.sheet.macroenabled.12 + + + xlsx + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + + + xlt + application/vnd.ms-excel + + + xltm + application/vnd.ms-excel.template.macroenabled.12 + + + xltx + application/vnd.openxmlformats-officedocument.spreadsheetml.template + + + xlw + application/vnd.ms-excel + + + xm + audio/xm + + + xml + application/xml + + + xo + application/vnd.olpc-sugar + + + xop + application/xop+xml + + + xpi + application/x-xpinstall + + + xpl + application/xproc+xml + + + xpm + image/x-xpixmap + + + xpr + application/vnd.is-xpr + + + xps + application/vnd.ms-xpsdocument + + + xpw + application/vnd.intercon.formnet + + + xpx + application/vnd.intercon.formnet + + + xsl + application/xml + + + xslt + application/xslt+xml + + + xsm + application/vnd.syncml+xml + + + xspf + application/xspf+xml + + + xul + application/vnd.mozilla.xul+xml + + + xvm + application/xv+xml + + + xvml + application/xv+xml + + + xwd + image/x-xwindowdump + + + xyz + chemical/x-xyz + + + xz + application/x-xz + + + yang + application/yang + + + yin + application/yin+xml + + + z + application/x-compress + + + z1 + application/x-zmachine + + + z2 + application/x-zmachine + + + z3 + application/x-zmachine + + + z4 + application/x-zmachine + + + z5 + application/x-zmachine + + + z6 + application/x-zmachine + + + z7 + application/x-zmachine + + + z8 + application/x-zmachine + + + zaz + application/vnd.zzazz.deck+xml + + + zip + application/zip + + + zir + application/vnd.zul + + + zirz + application/vnd.zul + + + zmm + application/vnd.handheld-entertainment+xml + + + + + + + + + + + + + + + + + + index.html + index.htm + index.jsp + + + \ No newline at end of file From 507989633c7287453581f55678c3d0ca5626f5ac Mon Sep 17 00:00:00 2001 From: zzzjinwook Date: Tue, 22 Aug 2023 14:11:41 +0900 Subject: [PATCH 02/19] =?UTF-8?q?feat=20:=20=EC=B9=B4=EC=B9=B4=EC=98=A4=5F?= =?UTF-8?q?=EC=9D=B8=EC=A6=9D=EC=BD=94=EB=93=9C=20=EC=88=98=EC=8B=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/kosa5/hyunique/HomeController.java | 5 ++++ .../com/kosa5/hyunique/KakaoController.java | 23 ++++++++++++++++++ .../icon/kakao_login_large_narrow.png | Bin 0 -> 6596 bytes .../resources/icon/kakao_login_large_wide.png | Bin 0 -> 7213 bytes .../icon/kakao_login_medium_narrow.png | Bin 0 -> 2946 bytes .../icon/kakao_login_medium_wide.png | Bin 0 -> 3307 bytes .../src/main/webapp/WEB-INF/views/login.jsp | 16 ++++++++++++ 7 files changed, 44 insertions(+) create mode 100644 hyunique_app/src/main/java/com/kosa5/hyunique/KakaoController.java create mode 100644 hyunique_app/src/main/resources/icon/kakao_login_large_narrow.png create mode 100644 hyunique_app/src/main/resources/icon/kakao_login_large_wide.png create mode 100644 hyunique_app/src/main/resources/icon/kakao_login_medium_narrow.png create mode 100644 hyunique_app/src/main/resources/icon/kakao_login_medium_wide.png create mode 100644 hyunique_app/src/main/webapp/WEB-INF/views/login.jsp diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/HomeController.java b/hyunique_app/src/main/java/com/kosa5/hyunique/HomeController.java index 30af8f50..d1e631f9 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/HomeController.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/HomeController.java @@ -5,6 +5,7 @@ import java.util.Locale; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @@ -24,4 +25,8 @@ public String home(Locale locale, Model model) { return "home"; } + @GetMapping("/login") + public String login() { + return "login"; + } } diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/KakaoController.java b/hyunique_app/src/main/java/com/kosa5/hyunique/KakaoController.java new file mode 100644 index 00000000..244f501d --- /dev/null +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/KakaoController.java @@ -0,0 +1,23 @@ +package com.kosa5.hyunique; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; + +@Controller +@RequestMapping(value="/") +public class KakaoController { + + @RequestMapping(value="/KakaoLogin", method=RequestMethod.GET) + public String kakaoLogin(@RequestParam(value = "code", required = false) String code) throws Exception { + System.out.println("#########" + code); + return "member/testPage"; + /* + * 리턴값의 testPage는 아무 페이지로 대체해도 괜찮습니다. + * 없는 페이지를 넣어도 무방합니다. + * 404가 떠도 제일 중요한건 #########인증코드 가 잘 출력이 되는지가 중요하므로 너무 신경 안쓰셔도 됩니다. + */ + } + +} \ No newline at end of file diff --git a/hyunique_app/src/main/resources/icon/kakao_login_large_narrow.png b/hyunique_app/src/main/resources/icon/kakao_login_large_narrow.png new file mode 100644 index 0000000000000000000000000000000000000000..894c2232c2eb47cecac2c45f9f9c0daef6bdd089 GIT binary patch literal 6596 zcmb7}Wmr^S)b?Q*WB}=IN$FNVy1QGt5lM*wlm=0T9=f}`yGvjI=}u(;sgdr7zt3~M z-`{WdT6>@0wa?jmpLL&ozH6w-V_}eEAR!@PDJsZlAt50~ibs!95S4ki;>e7|OD`fn-@yZ!!+J5SO*8Wm4 zRC_~UX00*f-Nn_u_FQq9y5XzfqgQgvtlX&+Fx(0(^V*cC59k$zmg0_o`&8u1Q&V)$ z$g8_z;jKr%$XqvH!+qE@eO^`BrjZ``*liwOj+f^XI=jmH{ayqcPI=ihxxA$=DuqUiG_ON{ z3tqux&bAn4!IdcZ1P`=C#-=_b*7SawGuEs6xdsYXEUdLX1;jXd5L8G5zNM&|PXTNm z-4Oq0k4Gdl)Zo+4beahTaf01B)?)=tIDG(xKzs3l+1PRBCz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0v-FGMOihODk<~e{{gJVs(%0g literal 0 HcmV?d00001 diff --git a/hyunique_app/src/main/resources/icon/kakao_login_large_wide.png b/hyunique_app/src/main/resources/icon/kakao_login_large_wide.png new file mode 100644 index 0000000000000000000000000000000000000000..c0c1856129a03c5e5812854c7b7a1a6134f0f5c0 GIT binary patch literal 7213 zcmY+J1z3~c+s7FU>5!6UNJ)36bO=ay4WtDLNd-oUG>mQp$pJ$_8U~1Tw{(L@cfa%h zdw+l5_qxutoo9Q__tbNL@6XOYzSK~{!=}VWK|#S&QI^+6K|wV{){QYAp`ZYWg~;uZ z7XS}!C0UfpA?h6z6sj#1`RBSmfW2%iAKl5>?gxIOUhGgAWze%=Y*|(^X@%!PuO6d! z?K#EN%T#dcc748{d|#^Xr25M3`E&H6QDggj%t&nGmog>TNtn9v?=>;$ZRpbnyoa*q z)5ZBOhURBkdLJZ)2U{*+2UiRHu8aQPoFH$`L(*(q5xBnU#hQr3$RV=eu@41XP7X5! zP39F zx6sun3x8F+MLjRW^eum6n>UM*$u;8MZ0W#Hu2{5|UK z_Y+8K3xjqJ|9JnSDUqr>vw4vsRbkbdfB?r80UBK*<{{o2ii~*9{ZEAYC~=`x;>=b? zILq7R>rpi-;Aq>(AbUN$TRVGfQU-L@pa&c@rXQC@m}xGCdf;1^@52xrML>C*P_i&X zttD!}1F0YWhW{7G$PI*C+0OK2;+K@LUPuX~ zEG5xc@$DBtQL*5&x>WP+9=ijG{KTXv7`IvINjaIwwSSXWY4_emtsb;7dy6DhkR5MB zU)0UI(MqsOaoxyhQ7JB{G@Mk@%~0Eep72Y|q^S&?c7+LH6?u4U;}Qc*3TLX?yQx-( z&5LH*D1!`9!O!f{)5v_oUbt4%b&xmVMFkH=?LRK0K|0m1$gI;Id!0g9q*Hc*ZGoU9B&5(wfpN|Mc)6$uzRF_ z+97zPT#VXPwc{h?#x1&}D%P-na>TlyoM7d?1nMRtHZV+$I?nQ_6Z3*w%?&XcSgs|T zvX?b}ac6gFovJ3$9_kuv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!G1Y%@oan2tcWt+e;(gzfGt6t6al~N`|utUtdd& zgfOwYNQd&;BbLJQyL^o}OPS!6{{^^?*iEG14HTc uSe^6HI>>&~#}Xt&E2L2W<}bT=Kx?NRKO!XuXd?grLs3!Ckgt@r4E`T&MN-ZH literal 0 HcmV?d00001 diff --git a/hyunique_app/src/main/resources/icon/kakao_login_medium_narrow.png b/hyunique_app/src/main/resources/icon/kakao_login_medium_narrow.png new file mode 100644 index 0000000000000000000000000000000000000000..09bb358843a08576d0029ff8427120c9f5f5c36d GIT binary patch literal 2946 zcmV-|3w`v7P)Px=JV``BRCodHT?=$n#Tou~^I8JtArcY-;n7xG;YdSyzvLw#RsjQ?LV-plh_pbV z7&Y>!6{SGyQ7PIA1q-OyLJ?6xkSGWUhC(S+KzRr@5E4Up1d{9~+0K7&=I-8o-o1M_ z>K zJfyi-#pdme(05ddSGi|FWMQ#bu-~&sqw*H#dF*pK(aop^c{`RCutpXZ-Vqb+{@?~PST%axaN|9sl5JgJIH%c4~IU>To?lhB0+0XCxP3iNAxKi{VC zjvQKnb(`Xq{N3HFP+286-lkOzX3S4Srw$HekGZbU1WWi7JQ!0$sJB|v8L$zYDQlkR?lC+CKkVmPTkqT#7o4e%f+nkhKWm0nES@$uNi!c2 zssx`jE+k%wc<(zU3e%*=la=(SN1GyRa#JNw%RavJkZar|{jF zIh9v8Swf}bW|5sHAS=!LW)Ya=RHl5htyRnfvZt&O-$U^1P~<)4O#w*c5zssi&Rq<2 z=r2E%7C|2ZUJESuX4v?S^iJ+2-sy0*FeW|j+Fx0*j9y6a&uMW@dlNWz;7OTq#^{GU^9##0; zKN=%%Q3CGmUj>qbR=6vclzG3b0VUCa+Sq#_P_10IYaeiTkKlB^D84)sjm-9T96Kqm zeu?J(hi*eclUg{cEx1q|B>_OI zUQw03yRDIwC$PWyyomMf`gBkc8kh;F;k=)&!+`(EO2UiKw>z-zRV5p8qPEt8R$Wu^ z)u$H`-$>rj;owbqDjCU%wOIJ13=jd%HJo?EX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r?I37P<+DiMAj|2=QAwRNxcgOjhC~>vC*71bh})A;JgizD>ZI4Zsr%Abe#})~9$#-x8aA^1UiOL{oY4sAfnRRfLRbSCk*+xeBByk-|8zKd6PbN zJPZqGTVDY~#2e#n!jrWpVc+3!go(Z4dvw*;x8Rva^Ms}*JYgr5p(mVb zwdQMWjF^u);9wHnEEw#%cp#|@kRm4Ad+~hLRlU;x5jXsP;kJHKN}*Gygf!`%nUSY> z5~t3s-q1j}wlBBSsAR`!(tZ5&IGj453bI`B+L$VQ1lJ5SPZr;#(niCfI=|{zZs(r$ z`B$Uyy_nC`E>2J5Dt&NMw$Q57Cu`eYV$A8budl9X zxy%>{)QZ5`y-&EiohrWkiC4To%>(-OFvj4x7oH(dQ((EHswuGC)i+}KjHhE!UT*(| zQ1+GfAbDx7RkM@%9M>%ZwIZkMu)qqKOT`^! z1Q-DpSj+>A03#4E2#}v-_PHG}my0{f2m~(ziUU6}{F%WE0gs#!U<3jPftkv8UEYKu pfG!z#l@SOs1cZ>002ovPDHLkV1oS~Dl`B9 literal 0 HcmV?d00001 diff --git a/hyunique_app/src/main/webapp/WEB-INF/views/login.jsp b/hyunique_app/src/main/webapp/WEB-INF/views/login.jsp new file mode 100644 index 00000000..4be20208 --- /dev/null +++ b/hyunique_app/src/main/webapp/WEB-INF/views/login.jsp @@ -0,0 +1,16 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> + + + + + Insert title here + + + + + + + + + + \ No newline at end of file From e7764b61c666d1d36a2c0bd9eab4e41fee7dd30f Mon Sep 17 00:00:00 2001 From: zzzjinwook Date: Tue, 22 Aug 2023 14:30:24 +0900 Subject: [PATCH 03/19] =?UTF-8?q?feat=20:=20=EC=B9=B4=EC=B9=B4=EC=98=A4=5F?= =?UTF-8?q?=EC=95=A1=EC=84=B8=EC=8A=A4=ED=86=A0=ED=81=B0=20=EC=88=98?= =?UTF-8?q?=EC=8B=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hyunique_app/pom.xml | 6 ++ .../com/kosa5/hyunique/KakaoController.java | 12 +++ .../com/kosa5/hyunique/MemberService.java | 76 +++++++++++++++++++ .../src/main/webapp/WEB-INF/views/login.jsp | 1 + 4 files changed, 95 insertions(+) create mode 100644 hyunique_app/src/main/java/com/kosa5/hyunique/MemberService.java diff --git a/hyunique_app/pom.xml b/hyunique_app/pom.xml index 512443c6..274261f9 100644 --- a/hyunique_app/pom.xml +++ b/hyunique_app/pom.xml @@ -148,6 +148,12 @@ ${org.aspectj-version} runtime + + + com.google.code.gson + gson + 2.8.8 + diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/KakaoController.java b/hyunique_app/src/main/java/com/kosa5/hyunique/KakaoController.java index 244f501d..89697143 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/KakaoController.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/KakaoController.java @@ -1,5 +1,6 @@ package com.kosa5.hyunique; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @@ -8,10 +9,21 @@ @Controller @RequestMapping(value="/") public class KakaoController { + + @Autowired + private MemberService ms; + + @RequestMapping(value="/KakaoLogin", method=RequestMethod.GET) public String kakaoLogin(@RequestParam(value = "code", required = false) String code) throws Exception { System.out.println("#########" + code); + + // 위에서 만든 코드 아래에 코드 추가 + String access_Token = ms.getAccessToken(code); + System.out.println("###access_Token#### : " + access_Token); + + return "member/testPage"; /* * 리턴값의 testPage는 아무 페이지로 대체해도 괜찮습니다. diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/MemberService.java b/hyunique_app/src/main/java/com/kosa5/hyunique/MemberService.java new file mode 100644 index 00000000..37958c9b --- /dev/null +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/MemberService.java @@ -0,0 +1,76 @@ +package com.kosa5.hyunique; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.net.HttpURLConnection; +import java.net.URL; + +import org.springframework.stereotype.Service; + +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; + +@Service +public class MemberService { + + public String getAccessToken (String authorize_code) { + String access_Token = ""; + String refresh_Token = ""; + String reqURL = "https://kauth.kakao.com/oauth/token"; + + try { + URL url = new URL(reqURL); + + HttpURLConnection conn = (HttpURLConnection) url.openConnection(); + // POST 요청을 위해 기본값이 false인 setDoOutput을 true로 + + conn.setRequestMethod("POST"); + conn.setDoOutput(true); + // POST 요청에 필요로 요구하는 파라미터 스트림을 통해 전송 + + BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(conn.getOutputStream())); + StringBuilder sb = new StringBuilder(); + sb.append("grant_type=authorization_code"); + + sb.append("&client_id=4cfcd6f87f1288c48d04d2a523dae7e6"); //본인이 발급받은 key + sb.append("&redirect_uri=http://localhost:8080/hyunique/KakaoLogin"); // 본인이 설정한 주소 + + sb.append("&code=" + authorize_code); + bw.write(sb.toString()); + bw.flush(); + + // 결과 코드가 200이라면 성공 + int responseCode = conn.getResponseCode(); + System.out.println("responseCode : " + responseCode); + + // 요청을 통해 얻은 JSON타입의 Response 메세지 읽어오기 + BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream())); + String line = ""; + String result = ""; + + while ((line = br.readLine()) != null) { + result += line; + } + System.out.println("response body : " + result); + + // Gson 라이브러리에 포함된 클래스로 JSON파싱 객체 생성 + JsonElement element = JsonParser.parseString(result); + + + access_Token = element.getAsJsonObject().get("access_token").getAsString(); + refresh_Token = element.getAsJsonObject().get("refresh_token").getAsString(); + + System.out.println("access_token : " + access_Token); + System.out.println("refresh_token : " + refresh_Token); + + br.close(); + bw.close(); + } catch (IOException e) { + e.printStackTrace(); + } + return access_Token; + } +} \ No newline at end of file diff --git a/hyunique_app/src/main/webapp/WEB-INF/views/login.jsp b/hyunique_app/src/main/webapp/WEB-INF/views/login.jsp index 4be20208..944c6941 100644 --- a/hyunique_app/src/main/webapp/WEB-INF/views/login.jsp +++ b/hyunique_app/src/main/webapp/WEB-INF/views/login.jsp @@ -11,6 +11,7 @@ + \ No newline at end of file From 3a05d9b91537cfe523c79a68067f91765bc668a7 Mon Sep 17 00:00:00 2001 From: zzzjinwook Date: Tue, 22 Aug 2023 16:30:14 +0900 Subject: [PATCH 04/19] =?UTF-8?q?feat=20:=20=EC=82=AC=EC=9A=A9=EC=9E=90=20?= =?UTF-8?q?=EC=A0=95=EB=B3=B4=20=EC=88=98=EC=8B=A0=20=EB=B0=8F=20api?= =?UTF-8?q?=ED=82=A4=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/kosa5/hyunique/HomeController.java | 10 ++- .../com/kosa5/hyunique/KakaoController.java | 19 +++-- .../com/kosa5/hyunique/MemberService.java | 75 ++++++++++++++++++- .../spring/appServlet/servlet-context.xml | 32 +++++--- .../webapp/WEB-INF/spring/root-context.xml | 10 ++- .../src/main/webapp/WEB-INF/views/login.jsp | 2 +- 6 files changed, 119 insertions(+), 29 deletions(-) diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/HomeController.java b/hyunique_app/src/main/java/com/kosa5/hyunique/HomeController.java index d1e631f9..fc17f3c3 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/HomeController.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/HomeController.java @@ -3,6 +3,8 @@ import java.text.DateFormat; import java.util.Date; import java.util.Locale; + +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; @@ -11,7 +13,10 @@ @Controller public class HomeController { - + @Value("${key.KAKAO}") + private String kakaoApiKey; + + @RequestMapping(value = "/", method = RequestMethod.GET) public String home(Locale locale, Model model) { @@ -26,7 +31,8 @@ public String home(Locale locale, Model model) { } @GetMapping("/login") - public String login() { + public String login(Model model) { + model.addAttribute("kakaoApiKey", kakaoApiKey); return "login"; } } diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/KakaoController.java b/hyunique_app/src/main/java/com/kosa5/hyunique/KakaoController.java index 89697143..94bf221f 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/KakaoController.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/KakaoController.java @@ -1,5 +1,7 @@ package com.kosa5.hyunique; +import java.util.HashMap; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @@ -19,17 +21,14 @@ public class KakaoController { public String kakaoLogin(@RequestParam(value = "code", required = false) String code) throws Exception { System.out.println("#########" + code); - // 위에서 만든 코드 아래에 코드 추가 - String access_Token = ms.getAccessToken(code); - System.out.println("###access_Token#### : " + access_Token); - - + String access_Token = ms.getAccessToken(code); + + HashMap userInfo = ms.getUserInfo(access_Token); + System.out.println("###access_Token#### : " + access_Token); + System.out.println("###nickname#### : " + userInfo.get("nickname")); + System.out.println("###email#### : " + userInfo.get("email")); return "member/testPage"; - /* - * 리턴값의 testPage는 아무 페이지로 대체해도 괜찮습니다. - * 없는 페이지를 넣어도 무방합니다. - * 404가 떠도 제일 중요한건 #########인증코드 가 잘 출력이 되는지가 중요하므로 너무 신경 안쓰셔도 됩니다. - */ + } } \ No newline at end of file diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/MemberService.java b/hyunique_app/src/main/java/com/kosa5/hyunique/MemberService.java index 37958c9b..310e5020 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/MemberService.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/MemberService.java @@ -7,19 +7,27 @@ import java.io.OutputStreamWriter; import java.net.HttpURLConnection; import java.net.URL; +import java.util.HashMap; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.JsonParser; @Service public class MemberService { + @Value("${key.KAKAO}") + private String kakaoApiKey; + public String getAccessToken (String authorize_code) { String access_Token = ""; String refresh_Token = ""; String reqURL = "https://kauth.kakao.com/oauth/token"; + + try { URL url = new URL(reqURL); @@ -35,7 +43,7 @@ public String getAccessToken (String authorize_code) { StringBuilder sb = new StringBuilder(); sb.append("grant_type=authorization_code"); - sb.append("&client_id=4cfcd6f87f1288c48d04d2a523dae7e6"); //본인이 발급받은 key + sb.append("&client_id="+kakaoApiKey); //발급 api키 sb.append("&redirect_uri=http://localhost:8080/hyunique/KakaoLogin"); // 본인이 설정한 주소 sb.append("&code=" + authorize_code); @@ -73,4 +81,69 @@ public String getAccessToken (String authorize_code) { } return access_Token; } + public HashMap getUserInfo(String access_Token) throws Exception{ + + // 요청하는 클라이언트마다 가진 정보가 다를 수 있기에 HashMap타입으로 선언 + HashMap userInfo = new HashMap(); + String reqURL = "https://kapi.kakao.com/v2/user/me"; + try { + URL url = new URL(reqURL); + HttpURLConnection conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod("GET"); + + // 요청에 필요한 Header에 포함될 내용 + conn.setRequestProperty("Authorization", "Bearer " + access_Token); + + int responseCode = conn.getResponseCode(); + System.out.println("responseCode : " + responseCode); + + BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream())); + + String line = ""; + String result = ""; + + while ((line = br.readLine()) != null) { + result += line; + } + System.out.println("response body : " + result); + + JsonElement element = JsonParser.parseString(result); + + JsonObject properties = null; + JsonObject kakao_account = null; + + try { + properties = element.getAsJsonObject().get("properties").getAsJsonObject(); + } catch (NullPointerException e) { + // properties가 없을 경우, 적절한 처리 + } + + try { + kakao_account = element.getAsJsonObject().get("kakao_account").getAsJsonObject(); + } catch (NullPointerException e) { + // kakao_account가 없을 경우, 적절한 처리 + } + + String nickname; + try { + nickname = properties.getAsJsonObject().get("nickname").getAsString(); + } catch (NullPointerException e) { + nickname = ""; // 닉네임이 없을 경우 빈 문자열로 처리 + } + String email; + try { + email = kakao_account.getAsJsonObject().get("email").getAsString(); + } catch (NullPointerException e) { + email = ""; // 이메일이 없을 경우 빈 문자열로 처리 + } + + userInfo.put("nickname", nickname); + userInfo.put("email", email); + + } catch (IOException e) { + e.printStackTrace(); + throw e; + } + return userInfo; + } } \ No newline at end of file diff --git a/hyunique_app/src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml b/hyunique_app/src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml index 69d5bb63..cf37945f 100644 --- a/hyunique_app/src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml +++ b/hyunique_app/src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml @@ -1,5 +1,6 @@ - - - + + - + - - + + - - - - - + + + + + + + diff --git a/hyunique_app/src/main/webapp/WEB-INF/spring/root-context.xml b/hyunique_app/src/main/webapp/WEB-INF/spring/root-context.xml index 5cc55bcd..6c4d1a78 100644 --- a/hyunique_app/src/main/webapp/WEB-INF/spring/root-context.xml +++ b/hyunique_app/src/main/webapp/WEB-INF/spring/root-context.xml @@ -10,14 +10,16 @@ http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd"> - + - - + + - + + + diff --git a/hyunique_app/src/main/webapp/WEB-INF/views/login.jsp b/hyunique_app/src/main/webapp/WEB-INF/views/login.jsp index 944c6941..06d7632c 100644 --- a/hyunique_app/src/main/webapp/WEB-INF/views/login.jsp +++ b/hyunique_app/src/main/webapp/WEB-INF/views/login.jsp @@ -7,7 +7,7 @@ - + From 9e6d0dc1ff714aedfe313e004504a0547cca76c1 Mon Sep 17 00:00:00 2001 From: zzzjinwook Date: Tue, 22 Aug 2023 16:56:08 +0900 Subject: [PATCH 05/19] =?UTF-8?q?file=20:=20=ED=8C=A8=ED=82=A4=EC=A7=80=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=20=EB=B0=8F=20=ED=8C=8C=EC=9D=BC=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MemberController.java} | 21 +++++++++++++++---- .../hyunique/{ => user}/MemberService.java | 4 +--- .../src/main/webapp/WEB-INF/views/login.jsp | 1 - .../main/webapp/WEB-INF/views/main_temp.jsp | 12 +++++++++++ 4 files changed, 30 insertions(+), 8 deletions(-) rename hyunique_app/src/main/java/com/kosa5/hyunique/{KakaoController.java => user/MemberController.java} (65%) rename hyunique_app/src/main/java/com/kosa5/hyunique/{ => user}/MemberService.java (99%) create mode 100644 hyunique_app/src/main/webapp/WEB-INF/views/main_temp.jsp diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/KakaoController.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberController.java similarity index 65% rename from hyunique_app/src/main/java/com/kosa5/hyunique/KakaoController.java rename to hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberController.java index 94bf221f..a92b39e6 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/KakaoController.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberController.java @@ -1,22 +1,35 @@ -package com.kosa5.hyunique; +package com.kosa5.hyunique.user; import java.util.HashMap; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; @Controller @RequestMapping(value="/") -public class KakaoController { +public class MemberController { + @Value("${key.KAKAO}") + private String kakaoApiKey; @Autowired private MemberService ms; - + //로그인 화면 이동 + @RequestMapping(value="/login") + public String login(Model model) { + model.addAttribute("kakaoApiKey", kakaoApiKey); + return "login"; + } + + + //카카오 API 호출 @RequestMapping(value="/KakaoLogin", method=RequestMethod.GET) public String kakaoLogin(@RequestParam(value = "code", required = false) String code) throws Exception { System.out.println("#########" + code); @@ -27,7 +40,7 @@ public String kakaoLogin(@RequestParam(value = "code", required = false) String System.out.println("###access_Token#### : " + access_Token); System.out.println("###nickname#### : " + userInfo.get("nickname")); System.out.println("###email#### : " + userInfo.get("email")); - return "member/testPage"; + return "main_temp"; } diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/MemberService.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberService.java similarity index 99% rename from hyunique_app/src/main/java/com/kosa5/hyunique/MemberService.java rename to hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberService.java index 310e5020..7e84d4bb 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/MemberService.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberService.java @@ -1,4 +1,4 @@ -package com.kosa5.hyunique; +package com.kosa5.hyunique.user; import java.io.BufferedReader; import java.io.BufferedWriter; @@ -27,8 +27,6 @@ public String getAccessToken (String authorize_code) { String refresh_Token = ""; String reqURL = "https://kauth.kakao.com/oauth/token"; - - try { URL url = new URL(reqURL); diff --git a/hyunique_app/src/main/webapp/WEB-INF/views/login.jsp b/hyunique_app/src/main/webapp/WEB-INF/views/login.jsp index 06d7632c..0aa8444f 100644 --- a/hyunique_app/src/main/webapp/WEB-INF/views/login.jsp +++ b/hyunique_app/src/main/webapp/WEB-INF/views/login.jsp @@ -11,7 +11,6 @@ - \ No newline at end of file diff --git a/hyunique_app/src/main/webapp/WEB-INF/views/main_temp.jsp b/hyunique_app/src/main/webapp/WEB-INF/views/main_temp.jsp new file mode 100644 index 00000000..dd9f9034 --- /dev/null +++ b/hyunique_app/src/main/webapp/WEB-INF/views/main_temp.jsp @@ -0,0 +1,12 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Insert title here + + +

로그인 성공

+ + \ No newline at end of file From 35316aff4075645b254f439336a795e50d150c6f Mon Sep 17 00:00:00 2001 From: zzzjinwook Date: Tue, 22 Aug 2023 17:43:46 +0900 Subject: [PATCH 06/19] =?UTF-8?q?feat=20:=20=EB=B0=9B=EC=95=84=EC=98=A8=20?= =?UTF-8?q?id=20=EB=B6=84=EB=A6=AC=20=EB=B0=8F=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/kosa5/hyunique/user/MemberController.java | 1 + .../src/main/java/com/kosa5/hyunique/user/MemberService.java | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberController.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberController.java index a92b39e6..6ecdfdfb 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberController.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberController.java @@ -40,6 +40,7 @@ public String kakaoLogin(@RequestParam(value = "code", required = false) String System.out.println("###access_Token#### : " + access_Token); System.out.println("###nickname#### : " + userInfo.get("nickname")); System.out.println("###email#### : " + userInfo.get("email")); + System.out.println("###id#### : " + userInfo.get("id")); return "main_temp"; } diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberService.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberService.java index 7e84d4bb..6012cce1 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberService.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberService.java @@ -107,6 +107,7 @@ public HashMap getUserInfo(String access_Token) throws Exception JsonElement element = JsonParser.parseString(result); + JsonObject properties = null; JsonObject kakao_account = null; @@ -122,6 +123,9 @@ public HashMap getUserInfo(String access_Token) throws Exception // kakao_account가 없을 경우, 적절한 처리 } + String id; + id = element.getAsJsonObject().get("id").getAsString(); // 정수 ID를 문자열로 변환 + String nickname; try { nickname = properties.getAsJsonObject().get("nickname").getAsString(); @@ -135,6 +139,7 @@ public HashMap getUserInfo(String access_Token) throws Exception email = ""; // 이메일이 없을 경우 빈 문자열로 처리 } + userInfo.put("id",id); userInfo.put("nickname", nickname); userInfo.put("email", email); From 2f3ffebc66d0186987092e47325603604f97bb0d Mon Sep 17 00:00:00 2001 From: zzzjinwook Date: Wed, 23 Aug 2023 12:10:46 +0900 Subject: [PATCH 07/19] =?UTF-8?q?feat=20:=20=EB=84=A4=EC=9D=B4=EB=B2=84=20?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hyunique_app/pom.xml | 21 ++++ .../kosa5/hyunique/user/MemberController.java | 88 ++++++++++++++- .../kosa5/hyunique/user/NaverLoginApi.java | 28 +++++ .../com/kosa5/hyunique/user/NaverLoginBO.java | 105 ++++++++++++++++++ .../src/main/resources/icon/btnG_comple.png | Bin 0 -> 14735 bytes .../spring/appServlet/servlet-context.xml | 28 ++--- .../main/webapp/WEB-INF/views/Naverlogin.jsp | 16 +++ .../src/main/webapp/WEB-INF/views/login.jsp | 9 +- 8 files changed, 275 insertions(+), 20 deletions(-) create mode 100644 hyunique_app/src/main/java/com/kosa5/hyunique/user/NaverLoginApi.java create mode 100644 hyunique_app/src/main/java/com/kosa5/hyunique/user/NaverLoginBO.java create mode 100644 hyunique_app/src/main/resources/icon/btnG_comple.png create mode 100644 hyunique_app/src/main/webapp/WEB-INF/views/Naverlogin.jsp diff --git a/hyunique_app/pom.xml b/hyunique_app/pom.xml index 274261f9..c0b45704 100644 --- a/hyunique_app/pom.xml +++ b/hyunique_app/pom.xml @@ -154,6 +154,27 @@ gson 2.8.8 + + + com.github.scribejava + scribejava-core + 2.8.1 + + + + + com.googlecode.json-simple + json-simple + 1.1.1 + + + + + javax.servlet + jstl + 1.2 + + diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberController.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberController.java index 6ecdfdfb..2e19bf44 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberController.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberController.java @@ -1,16 +1,23 @@ package com.kosa5.hyunique.user; +import java.io.IOException; import java.util.HashMap; +import javax.servlet.http.HttpSession; + +import org.json.simple.JSONObject; +import org.json.simple.parser.JSONParser; +import org.json.simple.parser.ParseException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; +import com.github.scribejava.core.model.OAuth2AccessToken; + @Controller @RequestMapping(value="/") public class MemberController { @@ -45,4 +52,81 @@ public String kakaoLogin(@RequestParam(value = "code", required = false) String } -} \ No newline at end of file + + + /* NaverLoginBO */ + private NaverLoginBO naverLoginBO; + private String apiResult = null; + + @Autowired + private void setNaverLoginBO(NaverLoginBO naverLoginBO) { + this.naverLoginBO = naverLoginBO; + } + + //로그인 첫 화면 요청 메소드 + @RequestMapping(value = "/Naverlogin", method = { RequestMethod.GET, RequestMethod.POST }) + public String login(Model model, HttpSession session) { + + /* 네이버아이디로 인증 URL을 생성하기 위하여 naverLoginBO클래스의 getAuthorizationUrl메소드 호출 */ + String naverAuthUrl = naverLoginBO.getAuthorizationUrl(session); + + //https://nid.naver.com/oauth2.0/authorize?response_type=code&client_id=sE***************& + //redirect_uri=http%3A%2F%2F211.63.89.90%3A8090%2Flogin_project%2Fcallback&state=e68c269c-5ba9-4c31-85da-54c16c658125 + System.out.println("네이버:" + naverAuthUrl); + + //네이버 + model.addAttribute("url", naverAuthUrl); + + return "Naverlogin"; + } + + //네이버 로그인 성공시 callback호출 메소드 + @RequestMapping(value = "/navercallback", method = { RequestMethod.GET, RequestMethod.POST }) + public String callback(Model model, @RequestParam String code, @RequestParam String state, HttpSession session) throws IOException, ParseException { + + System.out.println("여기는 callback"); + OAuth2AccessToken oauthToken; + oauthToken = naverLoginBO.getAccessToken(session, code, state); + + //1. 로그인 사용자 정보를 읽어온다. + apiResult = naverLoginBO.getUserProfile(oauthToken); //String형식의 json데이터 + + /** apiResult json 구조 + {"resultcode":"00", + "message":"success", + "response":{"id":"33666449","nickname":"shinn****","age":"20-29","gender":"M","email":"sh@naver.com","name":"\uc2e0\ubc94\ud638"}} + **/ + + //2. String형식인 apiResult를 json형태로 바꿈 + JSONParser parser = new JSONParser(); + Object obj = parser.parse(apiResult); + JSONObject jsonObj = (JSONObject) obj; + + //3. 데이터 파싱 + //Top레벨 단계 _response 파싱 + JSONObject response_obj = (JSONObject)jsonObj.get("response"); + //response의 nickname값 파싱 + String nickname = (String)response_obj.get("nickname"); + String id = (String)response_obj.get("id"); + System.out.println(nickname); + System.out.println(id); + + //4.파싱 닉네임 세션으로 저장 + session.setAttribute("sessionId",nickname); //세션 생성 + + model.addAttribute("result", apiResult); + + return "redirect:/"; + } + + //로그아웃 + @RequestMapping(value = "/logout", method = { RequestMethod.GET, RequestMethod.POST }) + public String logout(HttpSession session)throws IOException { + System.out.println("여기는 logout"); + session.invalidate(); + + + return "redirect:main_temp"; + } + +} diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/NaverLoginApi.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/NaverLoginApi.java new file mode 100644 index 00000000..d5a55cef --- /dev/null +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/NaverLoginApi.java @@ -0,0 +1,28 @@ +package com.kosa5.hyunique.user; + +import com.github.scribejava.core.builder.api.DefaultApi20; + +public class NaverLoginApi extends DefaultApi20{ + + protected NaverLoginApi(){ + } + + private static class InstanceHolder{ + private static final NaverLoginApi INSTANCE = new NaverLoginApi(); + } + + + public static NaverLoginApi instance(){ + return InstanceHolder.INSTANCE; + } + + @Override + public String getAccessTokenEndpoint() { + return "https://nid.naver.com/oauth2.0/token?grant_type=authorization_code"; + } + + @Override + protected String getAuthorizationBaseUrl() { + return "https://nid.naver.com/oauth2.0/authorize"; + } +} diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/NaverLoginBO.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/NaverLoginBO.java new file mode 100644 index 00000000..7f223dec --- /dev/null +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/NaverLoginBO.java @@ -0,0 +1,105 @@ +package com.kosa5.hyunique.user; + +import java.io.IOException; +import java.util.UUID; + +import javax.servlet.http.HttpSession; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; +import org.springframework.util.StringUtils; + +import com.github.scribejava.core.builder.ServiceBuilder; +import com.github.scribejava.core.model.OAuth2AccessToken; +import com.github.scribejava.core.model.OAuthRequest; +import com.github.scribejava.core.model.Response; +import com.github.scribejava.core.model.Verb; +import com.github.scribejava.core.oauth.OAuth20Service; + +@Component +public class NaverLoginBO { + @Value("${key.NAVER}") + private String naverApiKey; + + @Value("${id.NAVER}") + private String naverApiId; + + /* 인증 요청문을 구성하는 파라미터 */ + //naverApiId: 애플리케이션 등록 후 발급받은 클라이언트 아이디 + //response_type: 인증 과정에 대한 구분값. code로 값이 고정돼 있습니다. + //redirect_uri: 네이버 로그인 인증의 결과를 전달받을 콜백 URL(URL 인코딩). 애플리케이션을 등록할 때 Callback URL에 설정한 정보입니다. + //state: 애플리케이션이 생성한 상태 토큰 + private final static String REDIRECT_URI = "http://localhost:8080/hyunique/navercallback"; + private final static String SESSION_STATE = "oauth_state"; + /* 프로필 조회 API URL */ + private final static String PROFILE_API_URL = "https://openapi.naver.com/v1/nid/me"; + + /* 네이버 아이디로 인증 URL 생성 Method */ + public String getAuthorizationUrl(HttpSession session) { + + /* 세션 유효성 검증을 위하여 난수를 생성 */ + String state = generateRandomString(); + /* 생성한 난수 값을 session에 저장 */ + setSession(session,state); + + /* Scribe에서 제공하는 인증 URL 생성 기능을 이용하여 네아로 인증 URL 생성 */ + OAuth20Service oauthService = new ServiceBuilder() + .apiKey(naverApiId) + .apiSecret(naverApiKey) + .callback(REDIRECT_URI) + .state(state) //앞서 생성한 난수값을 인증 URL생성시 사용함 + .build(NaverLoginApi.instance()); + + return oauthService.getAuthorizationUrl(); + } + + /* 네이버아이디로 Callback 처리 및 AccessToken 획득 Method */ + public OAuth2AccessToken getAccessToken(HttpSession session, String code, String state) throws IOException{ + + /* Callback으로 전달받은 세선검증용 난수값과 세션에 저장되어있는 값이 일치하는지 확인 */ + String sessionState = getSession(session); + if(StringUtils.pathEquals(sessionState, state)){ + + OAuth20Service oauthService = new ServiceBuilder() + .apiKey(naverApiId) + .apiSecret(naverApiKey) + .callback(REDIRECT_URI) + .state(state) + .build(NaverLoginApi.instance()); + + /* Scribe에서 제공하는 AccessToken 획득 기능으로 네아로 Access Token을 획득 */ + OAuth2AccessToken accessToken = oauthService.getAccessToken(code); + return accessToken; + } + return null; + } + + /* 세션 유효성 검증을 위한 난수 생성기 */ + private String generateRandomString() { + return UUID.randomUUID().toString(); + } + + /* http session에 데이터 저장 */ + private void setSession(HttpSession session,String state){ + session.setAttribute(SESSION_STATE, state); + } + + /* http session에서 데이터 가져오기 */ + private String getSession(HttpSession session){ + return (String) session.getAttribute(SESSION_STATE); + } + /* Access Token을 이용하여 네이버 사용자 프로필 API를 호출 */ + public String getUserProfile(OAuth2AccessToken oauthToken) throws IOException{ + + OAuth20Service oauthService =new ServiceBuilder() + .apiKey(naverApiId) + .apiSecret(naverApiKey) + .callback(REDIRECT_URI).build(NaverLoginApi.instance()); + + OAuthRequest request = new OAuthRequest(Verb.GET, PROFILE_API_URL, oauthService); + oauthService.signRequest(oauthToken, request); + Response response = request.send(); + return response.getBody(); + } + +} \ No newline at end of file diff --git a/hyunique_app/src/main/resources/icon/btnG_comple.png b/hyunique_app/src/main/resources/icon/btnG_comple.png new file mode 100644 index 0000000000000000000000000000000000000000..36e5bfd49460725c1d06ed72e6528bc8726dd06d GIT binary patch literal 14735 zcmeIZWmFu`_BILwK?8(f!3hKi9^4^;;O-7daQDG2gb+f25G*(e?yiFdce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vs|fZ3ML-egHgVjXlf(>k}^f zT$^f{@rlDK35}9`9@gU6nn&Yet{Gw~Y|&~^+;KE%ymW*o(v7dA@?1Te^a_uPV>0Sb z2HYdJK#zU!7pya+4X<+JIR_}26Y%KyepPt?{KAwoM}EHRP<)L ztPGchV%5}mfn3i(290tHu6b~iLX|iRZHNcayR{4_BlgY(sHsA!!qGO7qt4XYLbye{Wh(_0LbT8n#_5_Dzn^J{Y2 z&2^G!jpd^lAk@e_ETEB`eRvR$cuasml;`}H53yodeE+n;<*YNKK6N>lE(#($`LN!O zZcMtP4QbTISGsv_tjZ7RPb+>aj+*i)L?7MlgMzXlkn7azhXLF*GK-)b`DZKOgKA_^ zjUu;L?X#D!utH!@R)&9l4c73AzLZ9q5C$J32sY6kg}b|Cff8 z_K>*$$Lv3nA|ONlALkH$*OjDCZY)p#OYB3ZB07W*A6@yoQ?tc<{NEP`kR4alOtsdj z=!Wg(zux`CU;fwR0Hz5(&c<@AmhiswR;%BGQ;IRS_I-UCdF7&> z1f3OMTQC3f!2G*^x^7TwntSo*7Cx2QKV*xe4 ze!#92+*iBJ)IKT#LQ}AeCbyb6ryihu3H zNimlx3d{>5AU>);M&>5enNp=id;Ztte)8pIg&IV9s2&=@1yyRD!cS`BcCzW^QVhtQ fCUm!ry(fU{IwSb-t5_c1id2wMeOo5=?&JRjXb^r2 literal 0 HcmV?d00001 diff --git a/hyunique_app/src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml b/hyunique_app/src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml index cf37945f..de147213 100644 --- a/hyunique_app/src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml +++ b/hyunique_app/src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml @@ -8,31 +8,27 @@ http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd"> - - - + - + - - + + - - + + + + - + + + + diff --git a/hyunique_app/src/main/webapp/WEB-INF/views/Naverlogin.jsp b/hyunique_app/src/main/webapp/WEB-INF/views/Naverlogin.jsp new file mode 100644 index 00000000..eb58db1d --- /dev/null +++ b/hyunique_app/src/main/webapp/WEB-INF/views/Naverlogin.jsp @@ -0,0 +1,16 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Insert title here + + + + +

+
+ + \ No newline at end of file diff --git a/hyunique_app/src/main/webapp/WEB-INF/views/login.jsp b/hyunique_app/src/main/webapp/WEB-INF/views/login.jsp index 0aa8444f..8e71dc96 100644 --- a/hyunique_app/src/main/webapp/WEB-INF/views/login.jsp +++ b/hyunique_app/src/main/webapp/WEB-INF/views/login.jsp @@ -8,9 +8,14 @@ - - + + + 네이버 로그인 하러 가기 + + +
\ No newline at end of file From f1f321255f2a60a0304aedb31e4f5d5bfd3ddb88 Mon Sep 17 00:00:00 2001 From: zzzjinwook Date: Wed, 23 Aug 2023 12:25:12 +0900 Subject: [PATCH 08/19] =?UTF-8?q?refactor=20:=20=EA=B3=B5=ED=86=B5?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=ED=99=94=EB=A9=B4=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EB=B0=8F=20=EB=A6=AC=ED=8C=A9=ED=86=A0=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/kosa5/hyunique/HomeController.java | 10 -- .../kosa5/hyunique/user/MemberController.java | 125 ++++++------------ .../src/main/webapp/WEB-INF/views/login.jsp | 2 - 3 files changed, 40 insertions(+), 97 deletions(-) diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/HomeController.java b/hyunique_app/src/main/java/com/kosa5/hyunique/HomeController.java index fc17f3c3..4904d65b 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/HomeController.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/HomeController.java @@ -13,10 +13,6 @@ @Controller public class HomeController { - @Value("${key.KAKAO}") - private String kakaoApiKey; - - @RequestMapping(value = "/", method = RequestMethod.GET) public String home(Locale locale, Model model) { @@ -29,10 +25,4 @@ public String home(Locale locale, Model model) { return "home"; } - - @GetMapping("/login") - public String login(Model model) { - model.addAttribute("kakaoApiKey", kakaoApiKey); - return "login"; - } } diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberController.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberController.java index 2e19bf44..7483e649 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberController.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberController.java @@ -2,9 +2,7 @@ import java.io.IOException; import java.util.HashMap; - import javax.servlet.http.HttpSession; - import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; @@ -15,118 +13,75 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; - import com.github.scribejava.core.model.OAuth2AccessToken; @Controller -@RequestMapping(value="/") +@RequestMapping(value = "/") public class MemberController { + @Value("${key.KAKAO}") private String kakaoApiKey; - + @Autowired private MemberService ms; - - - //로그인 화면 이동 - @RequestMapping(value="/login") - public String login(Model model) { - model.addAttribute("kakaoApiKey", kakaoApiKey); - return "login"; - } - - - //카카오 API 호출 - @RequestMapping(value="/KakaoLogin", method=RequestMethod.GET) - public String kakaoLogin(@RequestParam(value = "code", required = false) String code) throws Exception { - System.out.println("#########" + code); - - String access_Token = ms.getAccessToken(code); - - HashMap userInfo = ms.getUserInfo(access_Token); - System.out.println("###access_Token#### : " + access_Token); - System.out.println("###nickname#### : " + userInfo.get("nickname")); - System.out.println("###email#### : " + userInfo.get("email")); - System.out.println("###id#### : " + userInfo.get("id")); - return "main_temp"; - - } - - - /* NaverLoginBO */ + // NaverLoginBO private NaverLoginBO naverLoginBO; private String apiResult = null; - + @Autowired private void setNaverLoginBO(NaverLoginBO naverLoginBO) { this.naverLoginBO = naverLoginBO; } - - //로그인 첫 화면 요청 메소드 - @RequestMapping(value = "/Naverlogin", method = { RequestMethod.GET, RequestMethod.POST }) + + // 공통 로그인 화면 이동 + @RequestMapping(value = "/login", method = { RequestMethod.GET, RequestMethod.POST }) public String login(Model model, HttpSession session) { - - /* 네이버아이디로 인증 URL을 생성하기 위하여 naverLoginBO클래스의 getAuthorizationUrl메소드 호출 */ + model.addAttribute("kakaoApiKey", kakaoApiKey); String naverAuthUrl = naverLoginBO.getAuthorizationUrl(session); - - //https://nid.naver.com/oauth2.0/authorize?response_type=code&client_id=sE***************& - //redirect_uri=http%3A%2F%2F211.63.89.90%3A8090%2Flogin_project%2Fcallback&state=e68c269c-5ba9-4c31-85da-54c16c658125 System.out.println("네이버:" + naverAuthUrl); - - //네이버 model.addAttribute("url", naverAuthUrl); - - return "Naverlogin"; + return "login"; } - - //네이버 로그인 성공시 callback호출 메소드 + + // 카카오 API 호출 + @RequestMapping(value = "/KakaoLogin", method = RequestMethod.GET) + public String kakaoLogin(@RequestParam(value = "code", required = false) String code) throws Exception { + System.out.println("#########" + code); + String access_Token = ms.getAccessToken(code); + HashMap userInfo = ms.getUserInfo(access_Token); + System.out.println("###access_Token#### : " + access_Token); + System.out.println("###nickname#### : " + userInfo.get("nickname")); + System.out.println("###email#### : " + userInfo.get("email")); + System.out.println("###id#### : " + userInfo.get("id")); + return "main_temp"; + } + + // 네이버 로그인 성공시 callback호출 메소드 @RequestMapping(value = "/navercallback", method = { RequestMethod.GET, RequestMethod.POST }) - public String callback(Model model, @RequestParam String code, @RequestParam String state, HttpSession session) throws IOException, ParseException { - + public String callback(Model model, @RequestParam String code, @RequestParam String state, HttpSession session) + throws IOException, ParseException { System.out.println("여기는 callback"); - OAuth2AccessToken oauthToken; - oauthToken = naverLoginBO.getAccessToken(session, code, state); - - //1. 로그인 사용자 정보를 읽어온다. - apiResult = naverLoginBO.getUserProfile(oauthToken); //String형식의 json데이터 - - /** apiResult json 구조 - {"resultcode":"00", - "message":"success", - "response":{"id":"33666449","nickname":"shinn****","age":"20-29","gender":"M","email":"sh@naver.com","name":"\uc2e0\ubc94\ud638"}} - **/ - - //2. String형식인 apiResult를 json형태로 바꿈 + OAuth2AccessToken oauthToken = naverLoginBO.getAccessToken(session, code, state); + apiResult = naverLoginBO.getUserProfile(oauthToken); JSONParser parser = new JSONParser(); Object obj = parser.parse(apiResult); JSONObject jsonObj = (JSONObject) obj; - - //3. 데이터 파싱 - //Top레벨 단계 _response 파싱 - JSONObject response_obj = (JSONObject)jsonObj.get("response"); - //response의 nickname값 파싱 - String nickname = (String)response_obj.get("nickname"); - String id = (String)response_obj.get("id"); + JSONObject response_obj = (JSONObject) jsonObj.get("response"); + String nickname = (String) response_obj.get("nickname"); + String id = (String) response_obj.get("id"); System.out.println(nickname); System.out.println(id); - - //4.파싱 닉네임 세션으로 저장 - session.setAttribute("sessionId",nickname); //세션 생성 - + session.setAttribute("sessionId", nickname); model.addAttribute("result", apiResult); - return "redirect:/"; } - - //로그아웃 + + // 네이버 로그아웃 @RequestMapping(value = "/logout", method = { RequestMethod.GET, RequestMethod.POST }) - public String logout(HttpSession session)throws IOException { - System.out.println("여기는 logout"); - session.invalidate(); - - - return "redirect:main_temp"; - } - + public String logout(HttpSession session) throws IOException { + System.out.println("여기는 logout"); + session.invalidate(); + return "redirect:main_temp"; + } } diff --git a/hyunique_app/src/main/webapp/WEB-INF/views/login.jsp b/hyunique_app/src/main/webapp/WEB-INF/views/login.jsp index 8e71dc96..802337dc 100644 --- a/hyunique_app/src/main/webapp/WEB-INF/views/login.jsp +++ b/hyunique_app/src/main/webapp/WEB-INF/views/login.jsp @@ -11,8 +11,6 @@ - - 네이버 로그인 하러 가기 From d9992611c9052ebb08968c581eb04ee7598be0d7 Mon Sep 17 00:00:00 2001 From: zzzjinwook Date: Wed, 23 Aug 2023 14:45:29 +0900 Subject: [PATCH 09/19] =?UTF-8?q?file=20:=20user=20=EA=B5=AC=EC=A1=B0=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kosa5/hyunique/user/MemberController.java | 34 ++++++++++++++++--- .../hyunique/user/mapper/UserMapper.java | 5 +++ .../hyunique/user/service/UserService.java | 5 +++ .../user/service/UserServicelmpl.java | 5 +++ .../com/kosa5/hyunique/user/vo/UserVO.java | 21 ++++++++++++ .../src/main/resources/mappers/UserMapper.xml | 7 ++++ .../main/webapp/WEB-INF/views/Naverlogin.jsp | 16 --------- .../views/{main_temp.jsp => userInfopage.jsp} | 1 + 8 files changed, 73 insertions(+), 21 deletions(-) create mode 100644 hyunique_app/src/main/java/com/kosa5/hyunique/user/mapper/UserMapper.java create mode 100644 hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserService.java create mode 100644 hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserServicelmpl.java create mode 100644 hyunique_app/src/main/java/com/kosa5/hyunique/user/vo/UserVO.java create mode 100644 hyunique_app/src/main/resources/mappers/UserMapper.xml delete mode 100644 hyunique_app/src/main/webapp/WEB-INF/views/Naverlogin.jsp rename hyunique_app/src/main/webapp/WEB-INF/views/{main_temp.jsp => userInfopage.jsp} (92%) diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberController.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberController.java index 7483e649..f96df32c 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberController.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberController.java @@ -2,7 +2,10 @@ import java.io.IOException; import java.util.HashMap; + +import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; + import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; @@ -13,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; + import com.github.scribejava.core.model.OAuth2AccessToken; @Controller @@ -33,6 +37,11 @@ public class MemberController { private void setNaverLoginBO(NaverLoginBO naverLoginBO) { this.naverLoginBO = naverLoginBO; } + + //세션에 id저장 + private void setSessionId(HttpSession session, String id) { + session.setAttribute("sessionId", id); + } // 공통 로그인 화면 이동 @RequestMapping(value = "/login", method = { RequestMethod.GET, RequestMethod.POST }) @@ -46,7 +55,7 @@ public String login(Model model, HttpSession session) { // 카카오 API 호출 @RequestMapping(value = "/KakaoLogin", method = RequestMethod.GET) - public String kakaoLogin(@RequestParam(value = "code", required = false) String code) throws Exception { + public String kakaoLogin(@RequestParam(value = "code", required = false) String code, HttpSession session) throws Exception { System.out.println("#########" + code); String access_Token = ms.getAccessToken(code); HashMap userInfo = ms.getUserInfo(access_Token); @@ -54,7 +63,8 @@ public String kakaoLogin(@RequestParam(value = "code", required = false) String System.out.println("###nickname#### : " + userInfo.get("nickname")); System.out.println("###email#### : " + userInfo.get("email")); System.out.println("###id#### : " + userInfo.get("id")); - return "main_temp"; + setSessionId(session, (String) userInfo.get("id")); + return "redirect:userInfo"; } // 네이버 로그인 성공시 callback호출 메소드 @@ -74,14 +84,28 @@ public String callback(Model model, @RequestParam String code, @RequestParam Str System.out.println(id); session.setAttribute("sessionId", nickname); model.addAttribute("result", apiResult); - return "redirect:/"; + setSessionId(session, (String) response_obj.get("id")); // 세션에 ID 저장 + return "redirect:userInfo"; } - + + //로그인 성공 후 유저 정보 페이지(임시) 이동 + @RequestMapping(value = "/userInfo", method = RequestMethod.GET) + public String example(HttpSession session) { + String sessionId = (String) session.getAttribute("sessionId"); + if (sessionId != null) { + System.out.println("세션 ID: " + sessionId); + + } else { + System.out.println("로그인되지 않은 사용자"); + // 로그인되지 않은 사용자 처리 + } + return "userInfopage"; + } // 네이버 로그아웃 @RequestMapping(value = "/logout", method = { RequestMethod.GET, RequestMethod.POST }) public String logout(HttpSession session) throws IOException { System.out.println("여기는 logout"); session.invalidate(); - return "redirect:main_temp"; + return "redirect:userInfopage"; } } diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/mapper/UserMapper.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/mapper/UserMapper.java new file mode 100644 index 00000000..162f689a --- /dev/null +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/mapper/UserMapper.java @@ -0,0 +1,5 @@ +package com.kosa5.hyunique.user.mapper; + +public class UserMapper { + +} diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserService.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserService.java new file mode 100644 index 00000000..65a1828f --- /dev/null +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserService.java @@ -0,0 +1,5 @@ +package com.kosa5.hyunique.user.service; + +public class UserService { + +} diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserServicelmpl.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserServicelmpl.java new file mode 100644 index 00000000..1664f207 --- /dev/null +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserServicelmpl.java @@ -0,0 +1,5 @@ +package com.kosa5.hyunique.user.service; + +public class UserServicelmpl { + +} diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/vo/UserVO.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/vo/UserVO.java new file mode 100644 index 00000000..eace2e11 --- /dev/null +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/vo/UserVO.java @@ -0,0 +1,21 @@ +package com.kosa5.hyunique.user.vo; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class UserVO { + private Integer userId; + private String userImg; + private String userBackimg; + private String userNickname; + private String userSex; + private Integer userHeight; + private String userForm; + private String userIntroduce; + private String kakaoOauth; + private String naverOauth; +} diff --git a/hyunique_app/src/main/resources/mappers/UserMapper.xml b/hyunique_app/src/main/resources/mappers/UserMapper.xml new file mode 100644 index 00000000..dd365869 --- /dev/null +++ b/hyunique_app/src/main/resources/mappers/UserMapper.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/hyunique_app/src/main/webapp/WEB-INF/views/Naverlogin.jsp b/hyunique_app/src/main/webapp/WEB-INF/views/Naverlogin.jsp deleted file mode 100644 index eb58db1d..00000000 --- a/hyunique_app/src/main/webapp/WEB-INF/views/Naverlogin.jsp +++ /dev/null @@ -1,16 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> - - - - -Insert title here - - - - - -
- - \ No newline at end of file diff --git a/hyunique_app/src/main/webapp/WEB-INF/views/main_temp.jsp b/hyunique_app/src/main/webapp/WEB-INF/views/userInfopage.jsp similarity index 92% rename from hyunique_app/src/main/webapp/WEB-INF/views/main_temp.jsp rename to hyunique_app/src/main/webapp/WEB-INF/views/userInfopage.jsp index dd9f9034..3e2b3564 100644 --- a/hyunique_app/src/main/webapp/WEB-INF/views/main_temp.jsp +++ b/hyunique_app/src/main/webapp/WEB-INF/views/userInfopage.jsp @@ -8,5 +8,6 @@

로그인 성공

+${sessionId} \ No newline at end of file From 8428182b9ab1739cccfd702b3177772aff6a79df Mon Sep 17 00:00:00 2001 From: zzzjinwook Date: Wed, 23 Aug 2023 16:53:19 +0900 Subject: [PATCH 10/19] =?UTF-8?q?feat=20:=20=EC=9C=A0=EC=A0=80=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20DB=EC=82=BD=EC=9E=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{user => oauth}/NaverLoginApi.java | 2 +- .../{user => oauth}/NaverLoginBO.java | 2 +- .../OAuthController.java} | 18 ++++++++++----- .../OAuthService.java} | 4 ++-- .../hyunique/user/mapper/UserMapper.java | 8 ++++++- .../hyunique/user/service/UserService.java | 4 ++-- .../user/service/UserServicelmpl.java | 23 ++++++++++++++++++- .../src/main/resources/mappers/UserMapper.xml | 14 ++++++++++- .../src/main/resources/mybatis-config.xml | 4 ++-- .../spring/appServlet/servlet-context.xml | 2 +- .../WEB-INF/spring/datasource-context.xml | 6 +---- 11 files changed, 64 insertions(+), 23 deletions(-) rename hyunique_app/src/main/java/com/kosa5/hyunique/{user => oauth}/NaverLoginApi.java (95%) rename hyunique_app/src/main/java/com/kosa5/hyunique/{user => oauth}/NaverLoginBO.java (99%) rename hyunique_app/src/main/java/com/kosa5/hyunique/{user/MemberController.java => oauth/OAuthController.java} (86%) rename hyunique_app/src/main/java/com/kosa5/hyunique/{user/MemberService.java => oauth/OAuthService.java} (98%) diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/NaverLoginApi.java b/hyunique_app/src/main/java/com/kosa5/hyunique/oauth/NaverLoginApi.java similarity index 95% rename from hyunique_app/src/main/java/com/kosa5/hyunique/user/NaverLoginApi.java rename to hyunique_app/src/main/java/com/kosa5/hyunique/oauth/NaverLoginApi.java index d5a55cef..c457bf09 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/NaverLoginApi.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/oauth/NaverLoginApi.java @@ -1,4 +1,4 @@ -package com.kosa5.hyunique.user; +package com.kosa5.hyunique.oauth; import com.github.scribejava.core.builder.api.DefaultApi20; diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/NaverLoginBO.java b/hyunique_app/src/main/java/com/kosa5/hyunique/oauth/NaverLoginBO.java similarity index 99% rename from hyunique_app/src/main/java/com/kosa5/hyunique/user/NaverLoginBO.java rename to hyunique_app/src/main/java/com/kosa5/hyunique/oauth/NaverLoginBO.java index 7f223dec..8f8506b9 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/NaverLoginBO.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/oauth/NaverLoginBO.java @@ -1,4 +1,4 @@ -package com.kosa5.hyunique.user; +package com.kosa5.hyunique.oauth; import java.io.IOException; import java.util.UUID; diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberController.java b/hyunique_app/src/main/java/com/kosa5/hyunique/oauth/OAuthController.java similarity index 86% rename from hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberController.java rename to hyunique_app/src/main/java/com/kosa5/hyunique/oauth/OAuthController.java index f96df32c..e46ed760 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberController.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/oauth/OAuthController.java @@ -1,4 +1,4 @@ -package com.kosa5.hyunique.user; +package com.kosa5.hyunique.oauth; import java.io.IOException; import java.util.HashMap; @@ -18,17 +18,21 @@ import org.springframework.web.bind.annotation.RequestParam; import com.github.scribejava.core.model.OAuth2AccessToken; +import com.kosa5.hyunique.user.service.UserService; @Controller @RequestMapping(value = "/") -public class MemberController { +public class OAuthController { @Value("${key.KAKAO}") private String kakaoApiKey; @Autowired - private MemberService ms; + private OAuthService ms; + @Autowired + private UserService service; + // NaverLoginBO private NaverLoginBO naverLoginBO; private String apiResult = null; @@ -39,7 +43,9 @@ private void setNaverLoginBO(NaverLoginBO naverLoginBO) { } //세션에 id저장 - private void setSessionId(HttpSession session, String id) { + private void setSessionId(HttpSession session, String id, String type) { + //받은 Id로 서버에 이미 있으면 시퀀스 아이디 pl/sql out으로 받아오고, 없으면 정보 삽입 후 시퀀스 아이디 받아오기 + service.insertOrGetUser(id, type); session.setAttribute("sessionId", id); } @@ -63,7 +69,7 @@ public String kakaoLogin(@RequestParam(value = "code", required = false) String System.out.println("###nickname#### : " + userInfo.get("nickname")); System.out.println("###email#### : " + userInfo.get("email")); System.out.println("###id#### : " + userInfo.get("id")); - setSessionId(session, (String) userInfo.get("id")); + setSessionId(session, (String) userInfo.get("id"),"kakao"); return "redirect:userInfo"; } @@ -84,7 +90,7 @@ public String callback(Model model, @RequestParam String code, @RequestParam Str System.out.println(id); session.setAttribute("sessionId", nickname); model.addAttribute("result", apiResult); - setSessionId(session, (String) response_obj.get("id")); // 세션에 ID 저장 + setSessionId(session, (String) response_obj.get("id"),"naver"); // 세션에 ID 저장 return "redirect:userInfo"; } diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberService.java b/hyunique_app/src/main/java/com/kosa5/hyunique/oauth/OAuthService.java similarity index 98% rename from hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberService.java rename to hyunique_app/src/main/java/com/kosa5/hyunique/oauth/OAuthService.java index 6012cce1..b44ac804 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/MemberService.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/oauth/OAuthService.java @@ -1,4 +1,4 @@ -package com.kosa5.hyunique.user; +package com.kosa5.hyunique.oauth; import java.io.BufferedReader; import java.io.BufferedWriter; @@ -17,7 +17,7 @@ import com.google.gson.JsonParser; @Service -public class MemberService { +public class OAuthService { @Value("${key.KAKAO}") private String kakaoApiKey; diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/mapper/UserMapper.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/mapper/UserMapper.java index 162f689a..91e0f47c 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/mapper/UserMapper.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/mapper/UserMapper.java @@ -1,5 +1,11 @@ package com.kosa5.hyunique.user.mapper; -public class UserMapper { +import java.util.Map; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface UserMapper { + void insertOrGetUser(Map params); + } diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserService.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserService.java index 65a1828f..172916fb 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserService.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserService.java @@ -1,5 +1,5 @@ package com.kosa5.hyunique.user.service; -public class UserService { - +public interface UserService { + public String insertOrGetUser(String inputValue, String inputType); } diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserServicelmpl.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserServicelmpl.java index 1664f207..f2832beb 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserServicelmpl.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserServicelmpl.java @@ -1,5 +1,26 @@ package com.kosa5.hyunique.user.service; -public class UserServicelmpl { +import java.util.HashMap; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.kosa5.hyunique.user.mapper.UserMapper; + +@Service +public class UserServicelmpl implements UserService { + + @Autowired + private UserMapper mapper; + + @Override + public String insertOrGetUser(String inputValue, String inputType) { + Map params = new HashMap<>(); + params.put("inputValue", inputValue); + params.put("inputType", inputType); + mapper.insertOrGetUser(params); // UserMapper를 사용하여 쿼리 실행 + return (String) params.get("userId"); + } } diff --git a/hyunique_app/src/main/resources/mappers/UserMapper.xml b/hyunique_app/src/main/resources/mappers/UserMapper.xml index dd365869..99e854e3 100644 --- a/hyunique_app/src/main/resources/mappers/UserMapper.xml +++ b/hyunique_app/src/main/resources/mappers/UserMapper.xml @@ -3,5 +3,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + + + + + \ No newline at end of file diff --git a/hyunique_app/src/main/resources/mybatis-config.xml b/hyunique_app/src/main/resources/mybatis-config.xml index 2b7a619d..3a4b3935 100644 --- a/hyunique_app/src/main/resources/mybatis-config.xml +++ b/hyunique_app/src/main/resources/mybatis-config.xml @@ -18,7 +18,7 @@ 위해 사용합니다. --> - + - + \ No newline at end of file diff --git a/hyunique_app/src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml b/hyunique_app/src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml index de147213..734e6f98 100644 --- a/hyunique_app/src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml +++ b/hyunique_app/src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml @@ -29,6 +29,6 @@ - + diff --git a/hyunique_app/src/main/webapp/WEB-INF/spring/datasource-context.xml b/hyunique_app/src/main/webapp/WEB-INF/spring/datasource-context.xml index 3f4d83f9..096fc4ee 100644 --- a/hyunique_app/src/main/webapp/WEB-INF/spring/datasource-context.xml +++ b/hyunique_app/src/main/webapp/WEB-INF/spring/datasource-context.xml @@ -24,11 +24,7 @@ - - - - - + From e685293ed3798a278d4f33a66244fc7741d3681c Mon Sep 17 00:00:00 2001 From: zzzjinwook Date: Wed, 23 Aug 2023 17:02:17 +0900 Subject: [PATCH 11/19] =?UTF-8?q?fix=20:=20=EC=8B=9C=ED=80=80=EC=8A=A4=20?= =?UTF-8?q?=EB=84=98=EB=B2=84=EB=A1=9C=20=EC=84=B8=EC=85=98=EC=97=90=20?= =?UTF-8?q?=EC=A0=80=EC=9E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kosa5/hyunique/oauth/OAuthController.java | 48 ++++++++++--------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/oauth/OAuthController.java b/hyunique_app/src/main/java/com/kosa5/hyunique/oauth/OAuthController.java index e46ed760..b693b35d 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/oauth/OAuthController.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/oauth/OAuthController.java @@ -32,7 +32,7 @@ public class OAuthController { @Autowired private UserService service; - + // NaverLoginBO private NaverLoginBO naverLoginBO; private String apiResult = null; @@ -41,12 +41,14 @@ public class OAuthController { private void setNaverLoginBO(NaverLoginBO naverLoginBO) { this.naverLoginBO = naverLoginBO; } - - //세션에 id저장 + + // 세션에 id저장 private void setSessionId(HttpSession session, String id, String type) { - //받은 Id로 서버에 이미 있으면 시퀀스 아이디 pl/sql out으로 받아오고, 없으면 정보 삽입 후 시퀀스 아이디 받아오기 - service.insertOrGetUser(id, type); - session.setAttribute("sessionId", id); + try { + session.setAttribute("sessionId", service.insertOrGetUser(id, type)); + } catch (NullPointerException e) { + System.out.println("로그인 혹은 회원가입 실패"); + } } // 공통 로그인 화면 이동 @@ -61,7 +63,8 @@ public String login(Model model, HttpSession session) { // 카카오 API 호출 @RequestMapping(value = "/KakaoLogin", method = RequestMethod.GET) - public String kakaoLogin(@RequestParam(value = "code", required = false) String code, HttpSession session) throws Exception { + public String kakaoLogin(@RequestParam(value = "code", required = false) String code, HttpSession session) + throws Exception { System.out.println("#########" + code); String access_Token = ms.getAccessToken(code); HashMap userInfo = ms.getUserInfo(access_Token); @@ -69,7 +72,7 @@ public String kakaoLogin(@RequestParam(value = "code", required = false) String System.out.println("###nickname#### : " + userInfo.get("nickname")); System.out.println("###email#### : " + userInfo.get("email")); System.out.println("###id#### : " + userInfo.get("id")); - setSessionId(session, (String) userInfo.get("id"),"kakao"); + setSessionId(session, (String) userInfo.get("id"), "kakao"); return "redirect:userInfo"; } @@ -90,23 +93,24 @@ public String callback(Model model, @RequestParam String code, @RequestParam Str System.out.println(id); session.setAttribute("sessionId", nickname); model.addAttribute("result", apiResult); - setSessionId(session, (String) response_obj.get("id"),"naver"); // 세션에 ID 저장 + setSessionId(session, (String) response_obj.get("id"), "naver"); // 세션에 ID 저장 return "redirect:userInfo"; } - - //로그인 성공 후 유저 정보 페이지(임시) 이동 + + // 로그인 성공 후 유저 정보 페이지(임시) 이동 @RequestMapping(value = "/userInfo", method = RequestMethod.GET) - public String example(HttpSession session) { - String sessionId = (String) session.getAttribute("sessionId"); - if (sessionId != null) { - System.out.println("세션 ID: " + sessionId); - - } else { - System.out.println("로그인되지 않은 사용자"); - // 로그인되지 않은 사용자 처리 - } - return "userInfopage"; - } + public String example(HttpSession session) { + String sessionId = (String) session.getAttribute("sessionId"); + if (sessionId != null) { + System.out.println("세션 ID: " + sessionId); + + } else { + System.out.println("로그인되지 않은 사용자"); + // 로그인되지 않은 사용자 처리 + } + return "userInfopage"; + } + // 네이버 로그아웃 @RequestMapping(value = "/logout", method = { RequestMethod.GET, RequestMethod.POST }) public String logout(HttpSession session) throws IOException { From 72ca2819e516facf260c6ee5bdc8e3c1356e3eb1 Mon Sep 17 00:00:00 2001 From: zzzjinwook Date: Thu, 24 Aug 2023 10:23:21 +0900 Subject: [PATCH 12/19] =?UTF-8?q?feat=20:=20=EC=9C=A0=EC=A0=80=20=EA=B8=B0?= =?UTF-8?q?=EB=B3=B8=EC=A0=95=EB=B3=B4=20=EB=B0=8F=20=ED=8C=94=EB=A1=9C?= =?UTF-8?q?=EC=9A=B0=20=EC=88=98=20api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/controller/UserController.java | 27 ++++++++++++ .../hyunique/user/mapper/UserMapper.java | 5 ++- .../hyunique/user/service/UserService.java | 7 +++- ...rServicelmpl.java => UserServiceImpl.java} | 19 +++++++-- .../com/kosa5/hyunique/user/vo/UserVO.java | 26 +++++++----- .../src/main/resources/mappers/UserMapper.xml | 42 ++++++++++++++++--- .../main/webapp/WEB-INF/views/myStylePage.jsp | 12 ++++++ .../webapp/WEB-INF/views/userInfopage.jsp | 1 + 8 files changed, 117 insertions(+), 22 deletions(-) create mode 100644 hyunique_app/src/main/java/com/kosa5/hyunique/user/controller/UserController.java rename hyunique_app/src/main/java/com/kosa5/hyunique/user/service/{UserServicelmpl.java => UserServiceImpl.java} (54%) create mode 100644 hyunique_app/src/main/webapp/WEB-INF/views/myStylePage.jsp diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/controller/UserController.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/controller/UserController.java new file mode 100644 index 00000000..db01c683 --- /dev/null +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/controller/UserController.java @@ -0,0 +1,27 @@ +package com.kosa5.hyunique.user.controller; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +import com.kosa5.hyunique.user.service.UserService; +import com.kosa5.hyunique.user.vo.UserVO; + +@RestController +public class UserController { + + private UserService userService; + + @Autowired + public UserController(UserService userService) { + this.userService = userService; + } + + @GetMapping("/user/{userId}") + public UserVO getUserInfoAndFollowerCount(@PathVariable int userId) { + UserVO user = userService.getUserInfoAndFollowerCount(userId); + System.out.println(user); + return user; + } +} diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/mapper/UserMapper.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/mapper/UserMapper.java index 91e0f47c..53333a2a 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/mapper/UserMapper.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/mapper/UserMapper.java @@ -4,8 +4,11 @@ import org.apache.ibatis.annotations.Mapper; +import com.kosa5.hyunique.user.vo.UserVO; + @Mapper public interface UserMapper { void insertOrGetUser(Map params); - + UserVO getUserInfoAndFollowerCount(int userId); + } diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserService.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserService.java index 172916fb..4be668da 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserService.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserService.java @@ -1,5 +1,10 @@ package com.kosa5.hyunique.user.service; +import com.kosa5.hyunique.user.vo.UserVO; + public interface UserService { - public String insertOrGetUser(String inputValue, String inputType); + public String insertOrGetUser(String inputValue, String inputType); + + UserVO getUserInfoAndFollowerCount(int userId); + } diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserServicelmpl.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserServiceImpl.java similarity index 54% rename from hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserServicelmpl.java rename to hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserServiceImpl.java index f2832beb..8b30b470 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserServicelmpl.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserServiceImpl.java @@ -7,20 +7,31 @@ import org.springframework.stereotype.Service; import com.kosa5.hyunique.user.mapper.UserMapper; +import com.kosa5.hyunique.user.vo.UserVO; @Service -public class UserServicelmpl implements UserService { +public class UserServiceImpl implements UserService { @Autowired - private UserMapper mapper; - + private UserMapper userMapper; + + @Autowired + public UserServiceImpl(UserMapper userMapper) { + this.userMapper = userMapper; + } + @Override public String insertOrGetUser(String inputValue, String inputType) { Map params = new HashMap<>(); params.put("inputValue", inputValue); params.put("inputType", inputType); - mapper.insertOrGetUser(params); // UserMapper를 사용하여 쿼리 실행 + userMapper.insertOrGetUser(params); // UserMapper를 사용하여 쿼리 실행 return (String) params.get("userId"); } + @Override + public UserVO getUserInfoAndFollowerCount(int userId) { + return userMapper.getUserInfoAndFollowerCount(userId); + } + } diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/vo/UserVO.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/vo/UserVO.java index eace2e11..56b5eff7 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/vo/UserVO.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/vo/UserVO.java @@ -8,14 +8,18 @@ @NoArgsConstructor @AllArgsConstructor public class UserVO { - private Integer userId; - private String userImg; - private String userBackimg; - private String userNickname; - private String userSex; - private Integer userHeight; - private String userForm; - private String userIntroduce; - private String kakaoOauth; - private String naverOauth; -} + private int userId; + private String userImg; + private String userBackimg; + private String userNickname; + private String userSex; + private int userHeight; + private String userForm; + private String userIntroduce; + private String kakaoOauth; + private String naverOauth; + private String facebookUrl; + private String xUrl; + private String instagramUrl; + private int followerCount; +} \ No newline at end of file diff --git a/hyunique_app/src/main/resources/mappers/UserMapper.xml b/hyunique_app/src/main/resources/mappers/UserMapper.xml index 99e854e3..eda8d451 100644 --- a/hyunique_app/src/main/resources/mappers/UserMapper.xml +++ b/hyunique_app/src/main/resources/mappers/UserMapper.xml @@ -11,9 +11,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{userId, mode=OUT, jdbcType=VARCHAR})} - + \ No newline at end of file diff --git a/hyunique_app/src/main/webapp/WEB-INF/views/myStylePage.jsp b/hyunique_app/src/main/webapp/WEB-INF/views/myStylePage.jsp new file mode 100644 index 00000000..ce046b54 --- /dev/null +++ b/hyunique_app/src/main/webapp/WEB-INF/views/myStylePage.jsp @@ -0,0 +1,12 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Insert title here + + + + + \ No newline at end of file diff --git a/hyunique_app/src/main/webapp/WEB-INF/views/userInfopage.jsp b/hyunique_app/src/main/webapp/WEB-INF/views/userInfopage.jsp index 3e2b3564..15fe2eca 100644 --- a/hyunique_app/src/main/webapp/WEB-INF/views/userInfopage.jsp +++ b/hyunique_app/src/main/webapp/WEB-INF/views/userInfopage.jsp @@ -9,5 +9,6 @@

로그인 성공

${sessionId} + \ No newline at end of file From e110dda8eec3e287cfafad6982a9771bf21d927d Mon Sep 17 00:00:00 2001 From: zzzjinwook Date: Thu, 24 Aug 2023 11:31:05 +0900 Subject: [PATCH 13/19] =?UTF-8?q?feat=20:=20=EC=9C=A0=EC=A0=80=20=EA=B8=B0?= =?UTF-8?q?=EB=B3=B8=EC=A0=95=EB=B3=B4(=ED=8C=94=EB=A1=9C=EC=9B=8C,=20?= =?UTF-8?q?=EC=8A=A4=ED=83=80=EC=9D=BC=20=ED=8F=AC=ED=95=A8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/controller/UserController.java | 10 ++- .../com/kosa5/hyunique/user/vo/UserVO.java | 1 + .../src/main/resources/mappers/UserMapper.xml | 76 ++++++++++--------- .../main/webapp/WEB-INF/views/myStylePage.jsp | 10 ++- .../webapp/WEB-INF/views/userInfopage.jsp | 8 +- 5 files changed, 59 insertions(+), 46 deletions(-) diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/controller/UserController.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/controller/UserController.java index db01c683..081ed8a1 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/controller/UserController.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/controller/UserController.java @@ -1,14 +1,15 @@ package com.kosa5.hyunique.user.controller; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RestController; import com.kosa5.hyunique.user.service.UserService; import com.kosa5.hyunique.user.vo.UserVO; -@RestController +@Controller public class UserController { private UserService userService; @@ -19,9 +20,10 @@ public UserController(UserService userService) { } @GetMapping("/user/{userId}") - public UserVO getUserInfoAndFollowerCount(@PathVariable int userId) { + public String getUserInfoAndFollowerCount(@PathVariable int userId, Model model) { UserVO user = userService.getUserInfoAndFollowerCount(userId); System.out.println(user); - return user; + model.addAttribute("user", user); + return "myStylePage"; } } diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/vo/UserVO.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/vo/UserVO.java index 56b5eff7..424f862b 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/vo/UserVO.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/vo/UserVO.java @@ -22,4 +22,5 @@ public class UserVO { private String xUrl; private String instagramUrl; private int followerCount; + private String styleNames; } \ No newline at end of file diff --git a/hyunique_app/src/main/resources/mappers/UserMapper.xml b/hyunique_app/src/main/resources/mappers/UserMapper.xml index eda8d451..3d2cb296 100644 --- a/hyunique_app/src/main/resources/mappers/UserMapper.xml +++ b/hyunique_app/src/main/resources/mappers/UserMapper.xml @@ -12,40 +12,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + SELECT + hy_user.user_id as userId, + hy_user.user_img as userImg, + hy_user.user_backimg as userBackimg, + hy_user.user_nickname as userNickname, + hy_user.user_sex as userSex, + hy_user.user_height as userHeight, + hy_user.user_form as userForm, + hy_user.user_introduce as userIntroduce, + hy_user.kakao_oauth as kakaoOauth, + hy_user.naver_oauth as naverOauth, + hy_sns_url.facebook_url as facebookUrl, + hy_sns_url.x_url as xUrl, + hy_sns_url.instagram_url as instagramUrl, + COUNT(hy_follow.follower_id) AS followerCount, + LISTAGG(DISTINCT hy_styletag.style_name, ', ') WITHIN GROUP (ORDER BY hy_styletag.style_name) AS styleNames + FROM + hy_user + LEFT JOIN hy_sns_url ON hy_user.user_id = hy_sns_url.user_id + LEFT JOIN hy_follow ON hy_user.user_id = hy_follow.following_id + LEFT JOIN user_preference ON hy_user.user_id = user_preference.user_id + LEFT JOIN hy_styletag ON user_preference.style_id = hy_styletag.style_id + WHERE + hy_user.user_id = #{userId} + GROUP BY + hy_user.user_id, + hy_user.user_img, + hy_user.user_backimg, + hy_user.user_nickname, + hy_user.user_sex, + hy_user.user_height, + hy_user.user_form, + hy_user.user_introduce, + hy_user.kakao_oauth, + hy_user.naver_oauth, + hy_sns_url.facebook_url, + hy_sns_url.x_url, + hy_sns_url.instagram_url + + \ No newline at end of file diff --git a/hyunique_app/src/main/webapp/WEB-INF/views/myStylePage.jsp b/hyunique_app/src/main/webapp/WEB-INF/views/myStylePage.jsp index ce046b54..ea2d3211 100644 --- a/hyunique_app/src/main/webapp/WEB-INF/views/myStylePage.jsp +++ b/hyunique_app/src/main/webapp/WEB-INF/views/myStylePage.jsp @@ -1,5 +1,6 @@ <%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> + pageEncoding="UTF-8"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> @@ -7,6 +8,11 @@ Insert title here - +
+ +
${user.userNickname} +
${user.followerCount} +
${user.styleNames} +
${user.userIntroduce} \ No newline at end of file diff --git a/hyunique_app/src/main/webapp/WEB-INF/views/userInfopage.jsp b/hyunique_app/src/main/webapp/WEB-INF/views/userInfopage.jsp index 15fe2eca..be55a738 100644 --- a/hyunique_app/src/main/webapp/WEB-INF/views/userInfopage.jsp +++ b/hyunique_app/src/main/webapp/WEB-INF/views/userInfopage.jsp @@ -1,5 +1,5 @@ <%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> + pageEncoding="UTF-8"%> @@ -7,8 +7,8 @@ Insert title here -

로그인 성공

-${sessionId} - +

로그인 성공

+ ${sessionId} + 마이페이지 \ No newline at end of file From 42f6528d7e44ec1b81b5eb2cd2963131ada78e0a Mon Sep 17 00:00:00 2001 From: zzzjinwook Date: Thu, 24 Aug 2023 14:55:50 +0900 Subject: [PATCH 14/19] =?UTF-8?q?file=20:=20=EC=9C=A0=EC=A0=80=20=EC=97=85?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=8A=B8=20=EA=B4=80=EB=A0=A8=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/controller/UserController.java | 55 +++++++-- .../hyunique/user/mapper/UserMapper.java | 2 +- .../hyunique/user/service/UserService.java | 2 + .../user/service/UserServiceImpl.java | 5 + .../com/kosa5/hyunique/user/vo/UserVO.java | 2 +- .../src/main/resources/js/UserUpdate.js | 28 +++++ .../src/main/resources/mappers/UserMapper.xml | 105 +++++++++++------- .../main/webapp/WEB-INF/views/myStylePage.jsp | 6 +- .../WEB-INF/views/userInfoUpdatePage.jsp | 86 ++++++++++++++ 9 files changed, 235 insertions(+), 56 deletions(-) create mode 100644 hyunique_app/src/main/resources/js/UserUpdate.js create mode 100644 hyunique_app/src/main/webapp/WEB-INF/views/userInfoUpdatePage.jsp diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/controller/UserController.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/controller/UserController.java index 081ed8a1..712d0a57 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/controller/UserController.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/controller/UserController.java @@ -1,10 +1,16 @@ package com.kosa5.hyunique.user.controller; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; + import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import com.kosa5.hyunique.user.service.UserService; import com.kosa5.hyunique.user.vo.UserVO; @@ -13,17 +19,46 @@ public class UserController { private UserService userService; - + @Autowired - public UserController(UserService userService) { - this.userService = userService; - } - + public UserController(UserService userService) { + this.userService = userService; + } + @GetMapping("/user/{userId}") - public String getUserInfoAndFollowerCount(@PathVariable int userId, Model model) { - UserVO user = userService.getUserInfoAndFollowerCount(userId); - System.out.println(user); - model.addAttribute("user", user); + public String getUserInfoAndFollowerCount(HttpSession session, Model model) { + String sessionId = (String) session.getAttribute("sessionId"); // 세션에서 아이디 가져오기 + if (sessionId != null) { + int userId = Integer.parseInt(sessionId); + UserVO user = userService.getUserInfoAndFollowerCount(userId); + System.out.println(user); + model.addAttribute("user", user); + session.setAttribute("user", user); // 세션에 UserVO 저장 + } else { + System.out.println("세션 아이디가 null임"); + // 로그인되지 않은 사용자 처리 + } return "myStylePage"; } + + @GetMapping("/user/update") + public String userUpdatePage(HttpServletRequest request, Model model) { + UserVO user = (UserVO) request.getSession().getAttribute("user"); // 세션에서 UserVO 가져오기 + if (user != null) { + model.addAttribute("user", user); + } else { + System.out.println("user값이 null임"); + } + return "userInfoUpdatePage"; + } + + @PostMapping("/user/updateUser") + public ResponseEntity updateUser(@RequestBody UserVO user) { + try { + userService.updateUser(user); + return new ResponseEntity<>("업데이트 성공", HttpStatus.OK); + } catch (Exception e) { + return new ResponseEntity<>("업데이트 실패", HttpStatus.BAD_REQUEST); + } + } } diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/mapper/UserMapper.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/mapper/UserMapper.java index 53333a2a..46c8e825 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/mapper/UserMapper.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/mapper/UserMapper.java @@ -10,5 +10,5 @@ public interface UserMapper { void insertOrGetUser(Map params); UserVO getUserInfoAndFollowerCount(int userId); - + void updateUser(UserVO user); } diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserService.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserService.java index 4be668da..fabea126 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserService.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserService.java @@ -7,4 +7,6 @@ public interface UserService { UserVO getUserInfoAndFollowerCount(int userId); + public void updateUser(UserVO user); + } diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserServiceImpl.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserServiceImpl.java index 8b30b470..881d5e91 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserServiceImpl.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserServiceImpl.java @@ -34,4 +34,9 @@ public UserVO getUserInfoAndFollowerCount(int userId) { return userMapper.getUserInfoAndFollowerCount(userId); } + @Override + public void updateUser(UserVO user) { + userMapper.updateUser(user); + } + } diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/vo/UserVO.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/vo/UserVO.java index 424f862b..c9a848ec 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/vo/UserVO.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/vo/UserVO.java @@ -19,7 +19,7 @@ public class UserVO { private String kakaoOauth; private String naverOauth; private String facebookUrl; - private String xUrl; + private String twitterUrl; private String instagramUrl; private int followerCount; private String styleNames; diff --git a/hyunique_app/src/main/resources/js/UserUpdate.js b/hyunique_app/src/main/resources/js/UserUpdate.js new file mode 100644 index 00000000..18aa9476 --- /dev/null +++ b/hyunique_app/src/main/resources/js/UserUpdate.js @@ -0,0 +1,28 @@ +function updateUser() { + const userNickname = $('input[name="userNickname"]').val(); + const userIntroduce = $('input[name="userIntroduce"]').val(); + const userSex = $('input[name="userSex"]:checked').val(); + const instagramUrl = $('input[name="instagramUrl"]').val(); + const twitterUrl = $('input[name="twitterUrl"]').val(); + const facebookUrl = $('input[name="facebookUrl"]').val(); + + $.ajax({ + url: '/hyunique/updateUser', + type: 'POST', + data: { + userNickname, + userIntroduce, + userSex, + instagramUrl, + twitterUrl, + facebookUrl + }, + success: function (response) { + alert('업데이트 성공!'); + window.location.reload(); + }, + error: function (response) { + alert('업데이트 실패: 다시 시도해주세요.'); + } + }); +} diff --git a/hyunique_app/src/main/resources/mappers/UserMapper.xml b/hyunique_app/src/main/resources/mappers/UserMapper.xml index 3d2cb296..672d52f0 100644 --- a/hyunique_app/src/main/resources/mappers/UserMapper.xml +++ b/hyunique_app/src/main/resources/mappers/UserMapper.xml @@ -5,51 +5,70 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + {call insert_or_get_user(#{inputValue, mode=IN, + jdbcType=VARCHAR}, #{inputType, mode=IN, jdbcType=VARCHAR}, - #{userId, mode=OUT, jdbcType=VARCHAR})} + #{userId, + mode=OUT, jdbcType=VARCHAR})} - + + + UPDATE hy_user + LEFT JOIN hy_sns_url ON hy_user.user_id = hy_sns_url.user_id + SET hy_user.user_nickname = #{userNickname}, + hy_user.user_introduce = #{userIntroduce}, + hy_user.user_sex = #{userSex}, + hy_sns_url.instagram_url = #{instagramUrl}, + hy_sns_url.twitter_url = #{twitterUrl}, + hy_sns_url.facebook_url = #{facebookUrl} + WHERE hy_user.user_id = #{userId}; + + + \ No newline at end of file diff --git a/hyunique_app/src/main/webapp/WEB-INF/views/myStylePage.jsp b/hyunique_app/src/main/webapp/WEB-INF/views/myStylePage.jsp index ea2d3211..b25f1b20 100644 --- a/hyunique_app/src/main/webapp/WEB-INF/views/myStylePage.jsp +++ b/hyunique_app/src/main/webapp/WEB-INF/views/myStylePage.jsp @@ -5,7 +5,7 @@ -Insert title here +마이페이지
@@ -14,5 +14,9 @@
${user.followerCount}
${user.styleNames}
${user.userIntroduce} +
${user.facebookUrl} +
${user.twitterUrl} +
${user.instagramUrl} + 회원정보 수정 \ No newline at end of file diff --git a/hyunique_app/src/main/webapp/WEB-INF/views/userInfoUpdatePage.jsp b/hyunique_app/src/main/webapp/WEB-INF/views/userInfoUpdatePage.jsp new file mode 100644 index 00000000..bfd32dd2 --- /dev/null +++ b/hyunique_app/src/main/webapp/WEB-INF/views/userInfoUpdatePage.jsp @@ -0,0 +1,86 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + + + +Insert title here + + + +
+
+

프로필 설정

+

*필수입력사항

+
+
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ + +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ + +
+
+ +
+
+ +
+ + \ No newline at end of file From 48a3cf56e16ad54279281b8d05bb81c0d2b8f76e Mon Sep 17 00:00:00 2001 From: zzzjinwook Date: Thu, 24 Aug 2023 16:12:04 +0900 Subject: [PATCH 15/19] =?UTF-8?q?feat=20:=20=EC=9C=A0=EC=A0=80=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/controller/UserController.java | 14 +++-- .../user/service/UserServiceImpl.java | 1 + .../src/main/resources/mappers/UserMapper.xml | 54 +++++++++++-------- .../WEB-INF/views/userInfoUpdatePage.jsp | 5 +- .../{ => webapp}/resources/js/UserUpdate.js | 9 ++-- 5 files changed, 53 insertions(+), 30 deletions(-) rename hyunique_app/src/main/{ => webapp}/resources/js/UserUpdate.js (82%) diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/controller/UserController.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/controller/UserController.java index 712d0a57..ede49188 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/controller/UserController.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/controller/UserController.java @@ -11,11 +11,14 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.SessionAttribute; import com.kosa5.hyunique.user.service.UserService; import com.kosa5.hyunique.user.vo.UserVO; @Controller +@RequestMapping("user") public class UserController { private UserService userService; @@ -25,7 +28,7 @@ public UserController(UserService userService) { this.userService = userService; } - @GetMapping("/user/{userId}") + @GetMapping("{userId}") public String getUserInfoAndFollowerCount(HttpSession session, Model model) { String sessionId = (String) session.getAttribute("sessionId"); // 세션에서 아이디 가져오기 if (sessionId != null) { @@ -41,7 +44,7 @@ public String getUserInfoAndFollowerCount(HttpSession session, Model model) { return "myStylePage"; } - @GetMapping("/user/update") + @GetMapping("update") public String userUpdatePage(HttpServletRequest request, Model model) { UserVO user = (UserVO) request.getSession().getAttribute("user"); // 세션에서 UserVO 가져오기 if (user != null) { @@ -52,12 +55,15 @@ public String userUpdatePage(HttpServletRequest request, Model model) { return "userInfoUpdatePage"; } - @PostMapping("/user/updateUser") - public ResponseEntity updateUser(@RequestBody UserVO user) { + @PostMapping("updateUser") + public ResponseEntity updateUser(@RequestBody UserVO user,@SessionAttribute int sessionId) { + System.out.println(sessionId); + user.setUserId(sessionId); try { userService.updateUser(user); return new ResponseEntity<>("업데이트 성공", HttpStatus.OK); } catch (Exception e) { + System.out.println(e); return new ResponseEntity<>("업데이트 실패", HttpStatus.BAD_REQUEST); } } diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserServiceImpl.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserServiceImpl.java index 881d5e91..197a05f3 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserServiceImpl.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserServiceImpl.java @@ -36,6 +36,7 @@ public UserVO getUserInfoAndFollowerCount(int userId) { @Override public void updateUser(UserVO user) { + System.out.println("업데이트 시도는 함"); userMapper.updateUser(user); } diff --git a/hyunique_app/src/main/resources/mappers/UserMapper.xml b/hyunique_app/src/main/resources/mappers/UserMapper.xml index 672d52f0..abd9acad 100644 --- a/hyunique_app/src/main/resources/mappers/UserMapper.xml +++ b/hyunique_app/src/main/resources/mappers/UserMapper.xml @@ -18,30 +18,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" resultType="com.kosa5.hyunique.user.vo.UserVO"> SELECT hy_user.user_id as userId, - hy_user.user_img as userImg, + hy_user.user_img as + userImg, hy_user.user_backimg as userBackimg, - hy_user.user_nickname as userNickname, + hy_user.user_nickname as + userNickname, hy_user.user_sex as userSex, - hy_user.user_height as userHeight, + hy_user.user_height as + userHeight, hy_user.user_form as userForm, - hy_user.user_introduce as userIntroduce, + hy_user.user_introduce as + userIntroduce, hy_user.kakao_oauth as kakaoOauth, - hy_user.naver_oauth as naverOauth, + hy_user.naver_oauth as + naverOauth, hy_sns_url.facebook_url as facebookUrl, hy_sns_url.twitter_url as twitterUrl, - hy_sns_url.instagram_url as instagramUrl, + hy_sns_url.instagram_url as + instagramUrl, COUNT(DISTINCT hy_follow.follower_id) AS followerCount, LISTAGG(DISTINCT hy_styletag.style_name, ', ') WITHIN GROUP (ORDER BY hy_styletag.style_name) AS styleNames FROM hy_user - LEFT JOIN hy_sns_url ON hy_user.user_id = hy_sns_url.user_id - LEFT JOIN hy_follow ON hy_user.user_id = hy_follow.following_id - LEFT JOIN user_preference ON hy_user.user_id = user_preference.user_id - LEFT JOIN hy_styletag ON user_preference.style_id = + LEFT JOIN hy_sns_url + ON hy_user.user_id = hy_sns_url.user_id + LEFT JOIN hy_follow ON + hy_user.user_id = hy_follow.following_id + LEFT JOIN user_preference ON + hy_user.user_id = user_preference.user_id + LEFT JOIN hy_styletag ON + user_preference.style_id = hy_styletag.style_id WHERE - hy_user.user_id = #{userId} + hy_user.user_id = + #{userId} GROUP BY hy_user.user_id, hy_user.user_img, @@ -57,16 +68,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" hy_sns_url.twitter_url, hy_sns_url.instagram_url - - UPDATE hy_user - LEFT JOIN hy_sns_url ON hy_user.user_id = hy_sns_url.user_id - SET hy_user.user_nickname = #{userNickname}, - hy_user.user_introduce = #{userIntroduce}, - hy_user.user_sex = #{userSex}, - hy_sns_url.instagram_url = #{instagramUrl}, - hy_sns_url.twitter_url = #{twitterUrl}, - hy_sns_url.facebook_url = #{facebookUrl} - WHERE hy_user.user_id = #{userId}; + + {call updateUserProcedure( + #{userNickname}, + #{userIntroduce}, + #{userSex}, + #{instagramUrl}, + #{twitterUrl}, + #{facebookUrl}, + #{userId} + )} diff --git a/hyunique_app/src/main/webapp/WEB-INF/views/userInfoUpdatePage.jsp b/hyunique_app/src/main/webapp/WEB-INF/views/userInfoUpdatePage.jsp index bfd32dd2..e23f2390 100644 --- a/hyunique_app/src/main/webapp/WEB-INF/views/userInfoUpdatePage.jsp +++ b/hyunique_app/src/main/webapp/WEB-INF/views/userInfoUpdatePage.jsp @@ -5,7 +5,10 @@ - + + Insert title here diff --git a/hyunique_app/src/main/resources/js/UserUpdate.js b/hyunique_app/src/main/webapp/resources/js/UserUpdate.js similarity index 82% rename from hyunique_app/src/main/resources/js/UserUpdate.js rename to hyunique_app/src/main/webapp/resources/js/UserUpdate.js index 18aa9476..184d0411 100644 --- a/hyunique_app/src/main/resources/js/UserUpdate.js +++ b/hyunique_app/src/main/webapp/resources/js/UserUpdate.js @@ -7,19 +7,20 @@ function updateUser() { const facebookUrl = $('input[name="facebookUrl"]').val(); $.ajax({ - url: '/hyunique/updateUser', + url: '/hyunique/user/updateUser', type: 'POST', - data: { + contentType: 'application/json', + data: JSON.stringify({ userNickname, userIntroduce, userSex, instagramUrl, twitterUrl, facebookUrl - }, + }), success: function (response) { alert('업데이트 성공!'); - window.location.reload(); + window.location.href = 'myStylePage'; }, error: function (response) { alert('업데이트 실패: 다시 시도해주세요.'); From 740f5397542d84889523791a832ab46a36e4e0db Mon Sep 17 00:00:00 2001 From: zzzjinwook Date: Fri, 25 Aug 2023 11:11:33 +0900 Subject: [PATCH 16/19] =?UTF-8?q?feat=20:=20=EA=B2=8C=EC=8B=9C=EA=B8=80=20?= =?UTF-8?q?=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EA=B0=80=EC=A0=B8=EC=98=A4?= =?UTF-8?q?=EA=B8=B0=20=EB=B0=8F=20=EA=B2=8C=EC=8B=9C=EA=B8=80=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/controller/UserController.java | 20 +++++++++++-- .../hyunique/user/mapper/UserMapper.java | 9 +++++- .../hyunique/user/service/UserService.java | 5 ++++ .../user/service/UserServiceImpl.java | 9 +++++- .../com/kosa5/hyunique/user/vo/PostVO.java | 20 +++++++++++++ .../src/main/resources/mappers/UserMapper.xml | 13 ++++++++- .../main/webapp/WEB-INF/views/myStylePage.jsp | 27 ++++++++++++----- .../main/webapp/resources/js/UserUpdate.js | 29 +++++++++++++++++++ 8 files changed, 120 insertions(+), 12 deletions(-) create mode 100644 hyunique_app/src/main/java/com/kosa5/hyunique/user/vo/PostVO.java diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/controller/UserController.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/controller/UserController.java index ede49188..8088ef30 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/controller/UserController.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/controller/UserController.java @@ -1,5 +1,7 @@ package com.kosa5.hyunique.user.controller; +import java.util.List; + import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; @@ -12,9 +14,12 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.SessionAttribute; import com.kosa5.hyunique.user.service.UserService; +import com.kosa5.hyunique.user.vo.PostVO; import com.kosa5.hyunique.user.vo.UserVO; @Controller @@ -28,7 +33,7 @@ public UserController(UserService userService) { this.userService = userService; } - @GetMapping("{userId}") + @GetMapping("{userId}")//유저페이지, 마이페이지 분리? 통합 후 ajax처리? public String getUserInfoAndFollowerCount(HttpSession session, Model model) { String sessionId = (String) session.getAttribute("sessionId"); // 세션에서 아이디 가져오기 if (sessionId != null) { @@ -56,7 +61,7 @@ public String userUpdatePage(HttpServletRequest request, Model model) { } @PostMapping("updateUser") - public ResponseEntity updateUser(@RequestBody UserVO user,@SessionAttribute int sessionId) { + public ResponseEntity updateUser(@RequestBody UserVO user, @SessionAttribute int sessionId) { System.out.println(sessionId); user.setUserId(sessionId); try { @@ -67,4 +72,15 @@ public ResponseEntity updateUser(@RequestBody UserVO user,@SessionAttrib return new ResponseEntity<>("업데이트 실패", HttpStatus.BAD_REQUEST); } } + + @GetMapping("userpostlist") + @ResponseBody + public List getPostsByUserId(HttpServletRequest request, @RequestParam(required = false) Integer userId, @SessionAttribute("sessionId") int sessionId) { + if (userId == null) { + userId = sessionId; + } + return userService.getPostsByUserId(userId); + } + + } diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/mapper/UserMapper.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/mapper/UserMapper.java index 46c8e825..9d55bfeb 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/mapper/UserMapper.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/mapper/UserMapper.java @@ -1,14 +1,21 @@ package com.kosa5.hyunique.user.mapper; +import java.util.List; import java.util.Map; import org.apache.ibatis.annotations.Mapper; +import com.kosa5.hyunique.user.vo.PostVO; import com.kosa5.hyunique.user.vo.UserVO; @Mapper public interface UserMapper { void insertOrGetUser(Map params); - UserVO getUserInfoAndFollowerCount(int userId); + + UserVO getUserInfoAndFollowerCount(int userId); + void updateUser(UserVO user); + + List getPostsByUserId(Integer userId); + } diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserService.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserService.java index fabea126..f3914e8f 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserService.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserService.java @@ -1,5 +1,8 @@ package com.kosa5.hyunique.user.service; +import java.util.List; + +import com.kosa5.hyunique.user.vo.PostVO; import com.kosa5.hyunique.user.vo.UserVO; public interface UserService { @@ -9,4 +12,6 @@ public interface UserService { public void updateUser(UserVO user); + List getPostsByUserId(Integer userId); + } diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserServiceImpl.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserServiceImpl.java index 197a05f3..9e0b71d0 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserServiceImpl.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserServiceImpl.java @@ -1,12 +1,14 @@ package com.kosa5.hyunique.user.service; import java.util.HashMap; +import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.kosa5.hyunique.user.mapper.UserMapper; +import com.kosa5.hyunique.user.vo.PostVO; import com.kosa5.hyunique.user.vo.UserVO; @Service @@ -37,7 +39,12 @@ public UserVO getUserInfoAndFollowerCount(int userId) { @Override public void updateUser(UserVO user) { System.out.println("업데이트 시도는 함"); - userMapper.updateUser(user); + userMapper.updateUser(user); + } + + @Override + public List getPostsByUserId(Integer userId) { + return userMapper.getPostsByUserId(userId); } } diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/vo/PostVO.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/vo/PostVO.java new file mode 100644 index 00000000..471ca0e9 --- /dev/null +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/vo/PostVO.java @@ -0,0 +1,20 @@ +package com.kosa5.hyunique.user.vo; + +import java.sql.Date; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class PostVO { + private int postId; + private Date postDate; + private String postContent; + private int tpoId; + private int seasonId; + private int userId; + private String thumbnailUrl; +} diff --git a/hyunique_app/src/main/resources/mappers/UserMapper.xml b/hyunique_app/src/main/resources/mappers/UserMapper.xml index abd9acad..00c7b8aa 100644 --- a/hyunique_app/src/main/resources/mappers/UserMapper.xml +++ b/hyunique_app/src/main/resources/mappers/UserMapper.xml @@ -68,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" hy_sns_url.twitter_url, hy_sns_url.instagram_url + {call updateUserProcedure( @@ -81,6 +82,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" )} - + \ No newline at end of file diff --git a/hyunique_app/src/main/webapp/WEB-INF/views/myStylePage.jsp b/hyunique_app/src/main/webapp/WEB-INF/views/myStylePage.jsp index b25f1b20..6aeebc18 100644 --- a/hyunique_app/src/main/webapp/WEB-INF/views/myStylePage.jsp +++ b/hyunique_app/src/main/webapp/WEB-INF/views/myStylePage.jsp @@ -1,15 +1,23 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - -마이페이지 + + 마이페이지 + + + -
- +
+ +
${user.userNickname}
${user.followerCount}
${user.styleNames} @@ -18,5 +26,10 @@
${user.twitterUrl}
${user.instagramUrl} 회원정보 수정 +
+
+ 세션아이디 : ${sessionId} + + - \ No newline at end of file + diff --git a/hyunique_app/src/main/webapp/resources/js/UserUpdate.js b/hyunique_app/src/main/webapp/resources/js/UserUpdate.js index 184d0411..2202ccb8 100644 --- a/hyunique_app/src/main/webapp/resources/js/UserUpdate.js +++ b/hyunique_app/src/main/webapp/resources/js/UserUpdate.js @@ -27,3 +27,32 @@ function updateUser() { } }); } + +function userPostList(sessionId) { + $.ajax({ + url: '/hyunique/user/userpostlist', + type: 'GET', + data: { userId: sessionId }, + success: function(posts) { + var thumbnailsDiv = $('#thumbnails'); + thumbnailsDiv.empty(); // 기존 썸네일 이미지 제거 + posts.forEach(function(post) { + var thumbnailImage = $('', { + src: post.thumbnailUrl, + class: 'thumbnail-image' + }); + + var postLink = $('', { + href: '/hyunique/post/' + post.postId + }); + + postLink.append(thumbnailImage); + thumbnailsDiv.append(postLink); // 하이퍼링크로 된 썸네일 이미지 추가 + }); + + }, + error: function(error) { + console.log('게시물을 불러오는 데 실패했습니다:', error); + } + }); + } \ No newline at end of file From 06d79ed124eea04e12f8ab1b692db44e5abfd969 Mon Sep 17 00:00:00 2001 From: zzzjinwook Date: Fri, 25 Aug 2023 11:26:45 +0900 Subject: [PATCH 17/19] =?UTF-8?q?fix=20:=20=EC=95=BD=EA=B0=84=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EB=B3=91=ED=95=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hyunique_app/src/main/webapp/WEB-INF/views/myStylePage.jsp | 4 +++- hyunique_app/src/main/webapp/resources/js/UserUpdate.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hyunique_app/src/main/webapp/WEB-INF/views/myStylePage.jsp b/hyunique_app/src/main/webapp/WEB-INF/views/myStylePage.jsp index 6aeebc18..5e87c28d 100644 --- a/hyunique_app/src/main/webapp/WEB-INF/views/myStylePage.jsp +++ b/hyunique_app/src/main/webapp/WEB-INF/views/myStylePage.jsp @@ -29,7 +29,9 @@
세션아이디 : ${sessionId} - + + + diff --git a/hyunique_app/src/main/webapp/resources/js/UserUpdate.js b/hyunique_app/src/main/webapp/resources/js/UserUpdate.js index 2202ccb8..e815c5b8 100644 --- a/hyunique_app/src/main/webapp/resources/js/UserUpdate.js +++ b/hyunique_app/src/main/webapp/resources/js/UserUpdate.js @@ -55,4 +55,4 @@ function userPostList(sessionId) { console.log('게시물을 불러오는 데 실패했습니다:', error); } }); - } \ No newline at end of file + } From 34905847d921ff2c4fd1bc97d979992d9d6cc043 Mon Sep 17 00:00:00 2001 From: zzzjinwook Date: Fri, 25 Aug 2023 11:29:44 +0900 Subject: [PATCH 18/19] =?UTF-8?q?style=20:=20=EC=A3=BC=EC=84=9D=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/controller/UserController.java | 18 +++++++----- .../hyunique/user/service/UserService.java | 2 +- .../main/webapp/WEB-INF/views/myStylePage.jsp | 29 ++++++++++--------- 3 files changed, 28 insertions(+), 21 deletions(-) diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/controller/UserController.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/controller/UserController.java index 8088ef30..d37900f8 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/controller/UserController.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/controller/UserController.java @@ -33,7 +33,8 @@ public UserController(UserService userService) { this.userService = userService; } - @GetMapping("{userId}")//유저페이지, 마이페이지 분리? 통합 후 ajax처리? + // 유저 기본정보 가져오기 + @GetMapping("{userId}") public String getUserInfoAndFollowerCount(HttpSession session, Model model) { String sessionId = (String) session.getAttribute("sessionId"); // 세션에서 아이디 가져오기 if (sessionId != null) { @@ -49,6 +50,7 @@ public String getUserInfoAndFollowerCount(HttpSession session, Model model) { return "myStylePage"; } + // 유저 기본정보 업데이트 화면 이동 @GetMapping("update") public String userUpdatePage(HttpServletRequest request, Model model) { UserVO user = (UserVO) request.getSession().getAttribute("user"); // 세션에서 UserVO 가져오기 @@ -60,6 +62,7 @@ public String userUpdatePage(HttpServletRequest request, Model model) { return "userInfoUpdatePage"; } + // 유저 기본정보 업데이트 삽입 @PostMapping("updateUser") public ResponseEntity updateUser(@RequestBody UserVO user, @SessionAttribute int sessionId) { System.out.println(sessionId); @@ -73,14 +76,15 @@ public ResponseEntity updateUser(@RequestBody UserVO user, @SessionAttri } } + // 유저 게시글 썸네일 및 URL가져오기 @GetMapping("userpostlist") @ResponseBody - public List getPostsByUserId(HttpServletRequest request, @RequestParam(required = false) Integer userId, @SessionAttribute("sessionId") int sessionId) { - if (userId == null) { - userId = sessionId; - } - return userService.getPostsByUserId(userId); + public List getPostsByUserId(HttpServletRequest request, @RequestParam(required = false) Integer userId, + @SessionAttribute("sessionId") int sessionId) { + if (userId == null) { + userId = sessionId; + } + return userService.getPostsByUserId(userId); } - } diff --git a/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserService.java b/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserService.java index f3914e8f..6f128da9 100644 --- a/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserService.java +++ b/hyunique_app/src/main/java/com/kosa5/hyunique/user/service/UserService.java @@ -12,6 +12,6 @@ public interface UserService { public void updateUser(UserVO user); - List getPostsByUserId(Integer userId); + List getPostsByUserId(Integer userId); } diff --git a/hyunique_app/src/main/webapp/WEB-INF/views/myStylePage.jsp b/hyunique_app/src/main/webapp/WEB-INF/views/myStylePage.jsp index 5e87c28d..359c2377 100644 --- a/hyunique_app/src/main/webapp/WEB-INF/views/myStylePage.jsp +++ b/hyunique_app/src/main/webapp/WEB-INF/views/myStylePage.jsp @@ -1,18 +1,21 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - 마이페이지 - - - + +마이페이지 + + +
@@ -29,8 +32,8 @@
세션아이디 : ${sessionId} - - + + From 5299a175792ddc03bc1e3245653dc7fb9c3655ec Mon Sep 17 00:00:00 2001 From: zzzjinwook Date: Fri, 25 Aug 2023 12:04:56 +0900 Subject: [PATCH 19/19] =?UTF-8?q?feat=20:=20=EC=9C=A0=EC=A0=80=20=ED=82=A4?= =?UTF-8?q?=20=EC=9E=85=EB=A0=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mappers/UserMapper.xml | 1 + .../WEB-INF/views/userInfoUpdatePage.jsp | 33 ++++++++++++------- .../main/webapp/resources/js/UserUpdate.js | 18 +++++++++- 3 files changed, 39 insertions(+), 13 deletions(-) diff --git a/hyunique_app/src/main/resources/mappers/UserMapper.xml b/hyunique_app/src/main/resources/mappers/UserMapper.xml index 00c7b8aa..0bd5d982 100644 --- a/hyunique_app/src/main/resources/mappers/UserMapper.xml +++ b/hyunique_app/src/main/resources/mappers/UserMapper.xml @@ -75,6 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{userNickname}, #{userIntroduce}, #{userSex}, + #{userHeight}, #{instagramUrl}, #{twitterUrl}, #{facebookUrl}, diff --git a/hyunique_app/src/main/webapp/WEB-INF/views/userInfoUpdatePage.jsp b/hyunique_app/src/main/webapp/WEB-INF/views/userInfoUpdatePage.jsp index e23f2390..2b2323f8 100644 --- a/hyunique_app/src/main/webapp/WEB-INF/views/userInfoUpdatePage.jsp +++ b/hyunique_app/src/main/webapp/WEB-INF/views/userInfoUpdatePage.jsp @@ -21,8 +21,8 @@
-
- +
@@ -30,7 +30,7 @@
+ value="${user.userNickname}">
@@ -38,35 +38,44 @@
+ value="${user.userIntroduce}">
- +
- + + - +
+ +
+ +
+
+ +
+ value="${user.instagramUrl}">
- +
@@ -74,7 +83,7 @@
+ value="${user.facebookUrl}">
diff --git a/hyunique_app/src/main/webapp/resources/js/UserUpdate.js b/hyunique_app/src/main/webapp/resources/js/UserUpdate.js index e815c5b8..76292b98 100644 --- a/hyunique_app/src/main/webapp/resources/js/UserUpdate.js +++ b/hyunique_app/src/main/webapp/resources/js/UserUpdate.js @@ -1,7 +1,9 @@ +//유저 정보 업데이트 function updateUser() { const userNickname = $('input[name="userNickname"]').val(); const userIntroduce = $('input[name="userIntroduce"]').val(); - const userSex = $('input[name="userSex"]:checked').val(); + const userSex = $('#userSex').val(); + const userHeight = $('input[name="userHeight"]').val(); const instagramUrl = $('input[name="instagramUrl"]').val(); const twitterUrl = $('input[name="twitterUrl"]').val(); const facebookUrl = $('input[name="facebookUrl"]').val(); @@ -14,6 +16,7 @@ function updateUser() { userNickname, userIntroduce, userSex, + userHeight, instagramUrl, twitterUrl, facebookUrl @@ -28,6 +31,19 @@ function updateUser() { }); } +//유저 성별 미리 설정 +//수정필요 +$(document).ready(function() { + const userSex = "${user.userSex}"; // 서버에서 가져온 성별 값을 할당 + + $("#userSex option").each(function() { + if ($(this).val() === userSex) { + $(this).prop('selected', true); // prop 메서드로 선택 상태 설정 + } + }); +}); + +//유저 게시글 썸네일, 이미지 세팅 function userPostList(sessionId) { $.ajax({ url: '/hyunique/user/userpostlist',