├── src ├── main │ ├── webapp │ │ ├── resources │ │ │ └── static │ │ │ │ └── assets │ │ │ │ ├── fonts │ │ │ │ ├── FontAwesome.otf │ │ │ │ ├── fontawesome-webfont.eot │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ ├── fontawesome-webfont.woff │ │ │ │ └── fontawesome-webfont.woff2 │ │ │ │ ├── css │ │ │ │ ├── images │ │ │ │ │ ├── overlay1.png │ │ │ │ │ ├── overlay2.png │ │ │ │ │ ├── overlay3.svg │ │ │ │ │ └── overlay4.svg │ │ │ │ ├── noscript.css │ │ │ │ ├── font-awesome.min.css │ │ │ │ └── main.css │ │ │ │ ├── sass │ │ │ │ ├── noscript.scss │ │ │ │ ├── libs │ │ │ │ │ ├── _vars.scss │ │ │ │ │ ├── _mixins.scss │ │ │ │ │ ├── _functions.scss │ │ │ │ │ ├── _html-grid.scss │ │ │ │ │ ├── _breakpoints.scss │ │ │ │ │ └── _vendor.scss │ │ │ │ └── main.scss │ │ │ │ └── js │ │ │ │ ├── main.js │ │ │ │ ├── browser.min.js │ │ │ │ └── breakpoints.min.js │ │ └── WEB-INF │ │ │ └── index.jsp │ ├── java │ │ └── org │ │ │ └── paasta │ │ │ └── sample │ │ │ └── app │ │ │ ├── postgresql │ │ │ └── SampleRepository.java │ │ │ ├── Application.java │ │ │ ├── mysql │ │ │ └── MysqlSampleRepository.java │ │ │ ├── entity │ │ │ ├── mysql │ │ │ │ └── MysqlSample.java │ │ │ └── postgresql │ │ │ │ └── Sample.java │ │ │ ├── config │ │ │ ├── WebMvcConfig.java │ │ │ ├── MysqlDataSourceConfig.java │ │ │ └── PostgresDataSourceConfig.java │ │ │ └── controller │ │ │ └── SampleController.java │ └── resources │ │ └── application.yml └── test │ └── java │ └── org │ └── zerock │ └── ApplicationTests.java ├── README.md ├── manifest.yml └── .gitignore /src/main/webapp/resources/static/assets/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaaS-TA/PAAS-TA-SAMPLE-APP-POSTGRESQL-MYSQL/HEAD/src/main/webapp/resources/static/assets/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /src/main/webapp/resources/static/assets/css/images/overlay1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaaS-TA/PAAS-TA-SAMPLE-APP-POSTGRESQL-MYSQL/HEAD/src/main/webapp/resources/static/assets/css/images/overlay1.png -------------------------------------------------------------------------------- /src/main/webapp/resources/static/assets/css/images/overlay2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaaS-TA/PAAS-TA-SAMPLE-APP-POSTGRESQL-MYSQL/HEAD/src/main/webapp/resources/static/assets/css/images/overlay2.png -------------------------------------------------------------------------------- /src/main/webapp/resources/static/assets/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaaS-TA/PAAS-TA-SAMPLE-APP-POSTGRESQL-MYSQL/HEAD/src/main/webapp/resources/static/assets/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /src/main/webapp/resources/static/assets/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaaS-TA/PAAS-TA-SAMPLE-APP-POSTGRESQL-MYSQL/HEAD/src/main/webapp/resources/static/assets/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /src/main/webapp/resources/static/assets/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaaS-TA/PAAS-TA-SAMPLE-APP-POSTGRESQL-MYSQL/HEAD/src/main/webapp/resources/static/assets/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /src/main/webapp/resources/static/assets/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaaS-TA/PAAS-TA-SAMPLE-APP-POSTGRESQL-MYSQL/HEAD/src/main/webapp/resources/static/assets/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PAAS-TA-SAMPLE-APP-POSTGRESQL-MYSQL 2 | 3 | ## 개발 정보 4 | - JDK 8 5 | - Gradle 4 6 | - Spring IO Platform Cairo-SR3 7 | - Tomcat Embed Jasper 8.5.14 8 | - Spring-boot 2.3.0 9 | - Lombok 1.18.2 10 | - JSP 11 | -------------------------------------------------------------------------------- /src/main/java/org/paasta/sample/app/postgresql/SampleRepository.java: -------------------------------------------------------------------------------- 1 | package org.paasta.sample.app.postgresql; 2 | 3 | import org.paasta.sample.app.entity.postgresql.Sample; 4 | import org.springframework.data.repository.CrudRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface SampleRepository extends CrudRepository { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/org/paasta/sample/app/Application.java: -------------------------------------------------------------------------------- 1 | package org.paasta.sample.app; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/org/paasta/sample/app/mysql/MysqlSampleRepository.java: -------------------------------------------------------------------------------- 1 | package org.paasta.sample.app.mysql; 2 | 3 | import org.paasta.sample.app.entity.mysql.MysqlSample; 4 | import org.springframework.data.repository.CrudRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface MysqlSampleRepository extends CrudRepository { 9 | } 10 | -------------------------------------------------------------------------------- /src/test/java/org/zerock/ApplicationTests.java: -------------------------------------------------------------------------------- 1 | //package org.zerock; 2 | // 3 | //import org.junit.Test; 4 | //import org.junit.runner.RunWith; 5 | //import org.springframework.boot.test.context.SpringBootTest; 6 | //import org.springframework.test.context.junit4.SpringRunner; 7 | // 8 | //@RunWith(SpringRunner.class) 9 | //@SpringBootTest 10 | //public class ApplicationTests { 11 | // 12 | // @Test 13 | // public void contextLoads() { 14 | // } 15 | // 16 | //} 17 | -------------------------------------------------------------------------------- /src/main/webapp/resources/static/assets/css/noscript.css: -------------------------------------------------------------------------------- 1 | /* 2 | Photon by HTML5 UP 3 | html5up.net | @ajlkn 4 | Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) 5 | */ 6 | 7 | /* Header */ 8 | 9 | body.is-preload #header .inner { 10 | -moz-transform: none; 11 | -webkit-transform: none; 12 | -ms-transform: none; 13 | transform: none; 14 | opacity: 1; 15 | } 16 | 17 | body.is-preload #header .inner .actions { 18 | -moz-transform: none; 19 | -webkit-transform: none; 20 | -ms-transform: none; 21 | transform: none; 22 | opacity: 1; 23 | } 24 | 25 | body.is-preload #header:after { 26 | opacity: 0; 27 | } -------------------------------------------------------------------------------- /manifest.yml: -------------------------------------------------------------------------------- 1 | --- 2 | applications: 3 | - name: paas-ta-caas-demo-app 4 | memory: 1024M 5 | instances: 1 6 | buildpack: java_buildpack 7 | services: 8 | - mysql-instance 9 | env: 10 | postgresql_datasource_jdbc-url: jdbc:postgresql://115.68.47.174:31464/postgres 11 | postgresql_datasource_username: postgres 12 | postgresql_datasource_password: q 13 | mysql_datasource_driver-class-name: com.mysql.cj.jdbc.Driver 14 | mysql_datasource_jdbc-url: jdbc:\${vcap.services.mysql-instance.credentials.uri} 15 | mysql_datasource_username: \${vcap.services.mysql-instance.credentials.username} 16 | mysql_datasource_password: \${vcap.services.mysql-instance.credentials.password} 17 | -------------------------------------------------------------------------------- /src/main/webapp/resources/static/assets/sass/noscript.scss: -------------------------------------------------------------------------------- 1 | @import 'libs/vars'; 2 | @import 'libs/functions'; 3 | @import 'libs/mixins'; 4 | @import 'libs/vendor'; 5 | @import 'libs/breakpoints'; 6 | @import 'libs/html-grid'; 7 | 8 | /* 9 | Photon by HTML5 UP 10 | html5up.net | @ajlkn 11 | Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) 12 | */ 13 | 14 | /* Header */ 15 | 16 | body.is-preload { 17 | #header { 18 | .inner { 19 | @include vendor('transform', 'none'); 20 | opacity: 1; 21 | 22 | .actions { 23 | @include vendor('transform', 'none'); 24 | opacity: 1; 25 | } 26 | } 27 | 28 | &:after { 29 | opacity: 0; 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # ignore output and build directories 14 | build/** 15 | bin/** 16 | out/** 17 | 18 | # Package Files # 19 | *.jar 20 | *.war 21 | *.ear 22 | *.zip 23 | *.tar.gz 24 | *.rar 25 | 26 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 27 | hs_err_pid* 28 | 29 | # generated gradle directories and files 30 | .gradle 31 | .settings 32 | 33 | # eclise settings 34 | .classpath 35 | .project 36 | 37 | # idea settings 38 | *.iml 39 | *.idea 40 | .idea/** 41 | 42 | # remove spring bean configuration 43 | .spring* 44 | 45 | /logs/* -------------------------------------------------------------------------------- /src/main/webapp/resources/static/assets/js/main.js: -------------------------------------------------------------------------------- 1 | /* 2 | Photon by HTML5 UP 3 | html5up.net | @ajlkn 4 | Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) 5 | */ 6 | 7 | (function($) { 8 | 9 | var $window = $(window), 10 | $body = $('body'); 11 | 12 | // Breakpoints. 13 | breakpoints({ 14 | xlarge: [ '1141px', '1680px' ], 15 | large: [ '981px', '1140px' ], 16 | medium: [ '737px', '980px' ], 17 | small: [ '481px', '736px' ], 18 | xsmall: [ '321px', '480px' ], 19 | xxsmall: [ null, '320px' ] 20 | }); 21 | 22 | // Play initial animations on page load. 23 | $window.on('load', function() { 24 | window.setTimeout(function() { 25 | $body.removeClass('is-preload'); 26 | }, 100); 27 | }); 28 | 29 | })(jQuery); -------------------------------------------------------------------------------- /src/main/java/org/paasta/sample/app/entity/mysql/MysqlSample.java: -------------------------------------------------------------------------------- 1 | package org.paasta.sample.app.entity.mysql; 2 | 3 | import lombok.Data; 4 | import org.hibernate.annotations.CreationTimestamp; 5 | import org.hibernate.annotations.UpdateTimestamp; 6 | 7 | import javax.persistence.*; 8 | import java.util.Date; 9 | 10 | @Entity 11 | @Table(name = "sample") 12 | @Data 13 | public class MysqlSample { 14 | 15 | @Id 16 | @Column(name = "id") 17 | private long id; 18 | 19 | @Column(name = "name") 20 | private String name; 21 | 22 | @Column(name = "email") 23 | private String email; 24 | 25 | @CreationTimestamp 26 | @Column(name = "created", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", updatable = false) 27 | @Temporal(TemporalType.TIMESTAMP) 28 | private Date created; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/paasta/sample/app/entity/postgresql/Sample.java: -------------------------------------------------------------------------------- 1 | package org.paasta.sample.app.entity.postgresql; 2 | 3 | import lombok.Data; 4 | import org.hibernate.annotations.CreationTimestamp; 5 | import org.hibernate.annotations.UpdateTimestamp; 6 | 7 | import javax.persistence.*; 8 | import java.util.Date; 9 | 10 | @Entity 11 | @Table(name = "sample") 12 | @Data 13 | public class Sample { 14 | 15 | @Id 16 | @Column(name = "id") 17 | private long id; 18 | 19 | @Column(name = "name") 20 | private String name; 21 | 22 | @Column(name = "post_email") 23 | private String email; 24 | 25 | @CreationTimestamp 26 | @Column(name = "created", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", updatable = false) 27 | @Temporal(TemporalType.TIMESTAMP) 28 | private Date created; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | jpa: 3 | generate-ddl: true 4 | show-sql: true 5 | properties: 6 | hibernate.temp.use_jdbc_metadata_defaults: false 7 | 8 | server: 9 | port: 8888 10 | 11 | postgresql: 12 | datasource: 13 | driver-class-name: org.postgresql.Driver 14 | jdbc-url: ${POSTGRES_URL} 15 | # username: ${POSTGRES_USERNAME} 16 | # password: ${POSTGRES_PW} 17 | # jdbc-url: jdbc:postgresql://115.68.47.174:30465/postgres 18 | # jdbc-url: jdbc:postgresql://45.77.19.223:5524/postgres 19 | username: postgres 20 | password: q 21 | 22 | mysql: 23 | datasource: 24 | driver-class-name: com.mysql.cj.jdbc.Driver 25 | # jdbc-url: ${MYSQL_URL} 26 | # username: ${MYSQL_USERNAME} 27 | # password: ${MYSQL_PS} 28 | jdbc-url: jdbc:mysql://45.77.19.223:3306/test 29 | username: root 30 | password: q 31 | -------------------------------------------------------------------------------- /src/main/webapp/resources/static/assets/css/images/overlay3.svg: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/main/webapp/resources/static/assets/css/images/overlay4.svg: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/main/webapp/resources/static/assets/sass/libs/_vars.scss: -------------------------------------------------------------------------------- 1 | // Misc. 2 | $misc: ( 3 | z-index-base: 10000 4 | ); 5 | 6 | // Duration. 7 | $duration: ( 8 | transition: 0.2s 9 | ); 10 | 11 | // Size. 12 | $size: ( 13 | border-radius: 4px, 14 | element-height: 2.75em, 15 | element-margin: 2em, 16 | container-width: 60em 17 | ); 18 | 19 | // Font. 20 | $font: ( 21 | family: ('Source Sans Pro', Helvetica, sans-serif), 22 | family-fixed: ('Courier New', monospace), 23 | weight: 300, 24 | weight-bold: 400 25 | ); 26 | 27 | // Palette. 28 | $palette: ( 29 | bg: #fff, 30 | fg: #666, 31 | fg-bold: #555, 32 | fg-light: #999, 33 | border: rgba(144,144,144,0.5), 34 | border-bg: rgba(144,144,144,0.075), 35 | border2: rgba(144,144,144,0.75), 36 | border2-bg: rgba(144,144,144,0.2), 37 | accent1: #c3e895, 38 | accent2: #8addaa, 39 | accent3: #6bd4c8, 40 | accent4: #57aed3, 41 | accent5: #4a87d3, 42 | accent6: #6b88e6, 43 | accent1-alt: desaturate(darken(#c3e895, 15), 20), 44 | accent2-alt: desaturate(darken(#8addaa, 15), 20), 45 | accent3-alt: desaturate(darken(#6bd4c8, 15), 20), 46 | accent4-alt: desaturate(darken(#57aed3, 15), 20), 47 | accent5-alt: desaturate(darken(#4a87d3, 15), 20), 48 | accent6-alt: desaturate(darken(#6b88e6, 15), 20), 49 | 50 | dark: ( 51 | bg: #666666, 52 | fg-bold: #ffffff, 53 | fg: rgba(255,255,255,0.75), 54 | fg-light: rgba(255,255,255,0.5), 55 | border: #ffffff, 56 | border-bg: rgba(255,255,255,0.125), 57 | border2: rgba(255,255,255,0.75), 58 | border2-bg: rgba(255,255,255,0.25) 59 | ) 60 | ); -------------------------------------------------------------------------------- /src/main/java/org/paasta/sample/app/config/WebMvcConfig.java: -------------------------------------------------------------------------------- 1 | package org.paasta.sample.app.config; 2 | 3 | import java.util.concurrent.TimeUnit; 4 | 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | import org.springframework.http.CacheControl; 8 | import org.springframework.web.servlet.ViewResolver; 9 | import org.springframework.web.servlet.config.annotation.EnableWebMvc; 10 | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; 11 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 12 | import org.springframework.web.servlet.view.InternalResourceViewResolver; 13 | import org.springframework.web.servlet.view.JstlView; 14 | 15 | @Configuration 16 | @EnableWebMvc 17 | public class WebMvcConfig implements WebMvcConfigurer { 18 | 19 | @Override 20 | public void addResourceHandlers(ResourceHandlerRegistry registry) { 21 | registry.addResourceHandler("/resources/**").addResourceLocations("/resources/"); 22 | registry.addResourceHandler("/resources/css/fonts/**").addResourceLocations("/resources/css/fonts/").setCacheControl(CacheControl.maxAge(86400, TimeUnit.SECONDS)); 23 | } 24 | 25 | /** 26 | * View resolver view resolver. 27 | * 28 | * @return the view resolver 29 | */ 30 | @Bean 31 | public ViewResolver viewResolver() { 32 | InternalResourceViewResolver viewResolver = new InternalResourceViewResolver(); 33 | viewResolver.setViewClass(JstlView.class); 34 | viewResolver.setPrefix("/WEB-INF/"); 35 | viewResolver.setSuffix(".jsp"); 36 | return viewResolver; 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /src/main/webapp/resources/static/assets/js/browser.min.js: -------------------------------------------------------------------------------- 1 | /* browser.js v1.0 | @ajlkn | MIT licensed */ 2 | var browser=function(){"use strict";var e={name:null,version:null,os:null,osVersion:null,touch:null,mobile:null,_canUse:null,canUse:function(n){e._canUse||(e._canUse=document.createElement("div"));var o=e._canUse.style,r=n.charAt(0).toUpperCase()+n.slice(1);return n in o||"Moz"+r in o||"Webkit"+r in o||"O"+r in o||"ms"+r in o},init:function(){var n,o,r,i,t=navigator.userAgent;for(n="other",o=0,r=[["firefox",/Firefox\/([0-9\.]+)/],["bb",/BlackBerry.+Version\/([0-9\.]+)/],["bb",/BB[0-9]+.+Version\/([0-9\.]+)/],["opera",/OPR\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)/],["edge",/Edge\/([0-9\.]+)/],["safari",/Version\/([0-9\.]+).+Safari/],["chrome",/Chrome\/([0-9\.]+)/],["ie",/MSIE ([0-9]+)/],["ie",/Trident\/.+rv:([0-9]+)/]],i=0;i0:!!("ontouchstart"in window),e.mobile="wp"==e.os||"android"==e.os||"ios"==e.os||"bb"==e.os}};return e.init(),e}();!function(e,n){"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?module.exports=n():e.browser=n()}(this,function(){return browser}); 3 | -------------------------------------------------------------------------------- /src/main/webapp/resources/static/assets/sass/libs/_mixins.scss: -------------------------------------------------------------------------------- 1 | /// Makes an element's :before pseudoelement a FontAwesome icon. 2 | /// @param {string} $content Optional content value to use. 3 | /// @param {string} $where Optional pseudoelement to target (before or after). 4 | @mixin icon($content: false, $where: before) { 5 | 6 | text-decoration: none; 7 | 8 | &:#{$where} { 9 | 10 | @if $content { 11 | content: $content; 12 | } 13 | 14 | -moz-osx-font-smoothing: grayscale; 15 | -webkit-font-smoothing: antialiased; 16 | font-family: FontAwesome; 17 | font-style: normal; 18 | font-weight: normal; 19 | text-transform: none !important; 20 | 21 | } 22 | 23 | } 24 | 25 | /// Applies padding to an element, taking the current element-margin value into account. 26 | /// @param {mixed} $tb Top/bottom padding. 27 | /// @param {mixed} $lr Left/right padding. 28 | /// @param {list} $pad Optional extra padding (in the following order top, right, bottom, left) 29 | /// @param {bool} $important If true, adds !important. 30 | @mixin padding($tb, $lr, $pad: (0,0,0,0), $important: null) { 31 | 32 | @if $important { 33 | $important: '!important'; 34 | } 35 | 36 | $x: 0.1em; 37 | 38 | @if unit(_size(element-margin)) == 'rem' { 39 | $x: 0.1rem; 40 | } 41 | 42 | padding: ($tb + nth($pad,1)) ($lr + nth($pad,2)) max($x, $tb - _size(element-margin) + nth($pad,3)) ($lr + nth($pad,4)) #{$important}; 43 | 44 | } 45 | 46 | /// Encodes a SVG data URL so IE doesn't choke (via codepen.io/jakob-e/pen/YXXBrp). 47 | /// @param {string} $svg SVG data URL. 48 | /// @return {string} Encoded SVG data URL. 49 | @function svg-url($svg) { 50 | 51 | $svg: str-replace($svg, '"', '\''); 52 | $svg: str-replace($svg, '%', '%25'); 53 | $svg: str-replace($svg, '<', '%3C'); 54 | $svg: str-replace($svg, '>', '%3E'); 55 | $svg: str-replace($svg, '&', '%26'); 56 | $svg: str-replace($svg, '#', '%23'); 57 | $svg: str-replace($svg, '{', '%7B'); 58 | $svg: str-replace($svg, '}', '%7D'); 59 | $svg: str-replace($svg, ';', '%3B'); 60 | 61 | @return url("data:image/svg+xml;charset=utf8,#{$svg}"); 62 | 63 | } -------------------------------------------------------------------------------- /src/main/webapp/resources/static/assets/sass/libs/_functions.scss: -------------------------------------------------------------------------------- 1 | /// Removes a specific item from a list. 2 | /// @author Hugo Giraudel 3 | /// @param {list} $list List. 4 | /// @param {integer} $index Index. 5 | /// @return {list} Updated list. 6 | @function remove-nth($list, $index) { 7 | 8 | $result: null; 9 | 10 | @if type-of($index) != number { 11 | @warn "$index: #{quote($index)} is not a number for `remove-nth`."; 12 | } 13 | @else if $index == 0 { 14 | @warn "List index 0 must be a non-zero integer for `remove-nth`."; 15 | } 16 | @else if abs($index) > length($list) { 17 | @warn "List index is #{$index} but list is only #{length($list)} item long for `remove-nth`."; 18 | } 19 | @else { 20 | 21 | $result: (); 22 | $index: if($index < 0, length($list) + $index + 1, $index); 23 | 24 | @for $i from 1 through length($list) { 25 | 26 | @if $i != $index { 27 | $result: append($result, nth($list, $i)); 28 | } 29 | 30 | } 31 | 32 | } 33 | 34 | @return $result; 35 | 36 | } 37 | 38 | /// Gets a value from a map. 39 | /// @author Hugo Giraudel 40 | /// @param {map} $map Map. 41 | /// @param {string} $keys Key(s). 42 | /// @return {string} Value. 43 | @function val($map, $keys...) { 44 | 45 | @if nth($keys, 1) == null { 46 | $keys: remove-nth($keys, 1); 47 | } 48 | 49 | @each $key in $keys { 50 | $map: map-get($map, $key); 51 | } 52 | 53 | @return $map; 54 | 55 | } 56 | 57 | /// Gets a duration value. 58 | /// @param {string} $keys Key(s). 59 | /// @return {string} Value. 60 | @function _duration($keys...) { 61 | @return val($duration, $keys...); 62 | } 63 | 64 | /// Gets a font value. 65 | /// @param {string} $keys Key(s). 66 | /// @return {string} Value. 67 | @function _font($keys...) { 68 | @return val($font, $keys...); 69 | } 70 | 71 | /// Gets a misc value. 72 | /// @param {string} $keys Key(s). 73 | /// @return {string} Value. 74 | @function _misc($keys...) { 75 | @return val($misc, $keys...); 76 | } 77 | 78 | /// Gets a palette value. 79 | /// @param {string} $keys Key(s). 80 | /// @return {string} Value. 81 | @function _palette($keys...) { 82 | @return val($palette, $keys...); 83 | } 84 | 85 | /// Gets a size value. 86 | /// @param {string} $keys Key(s). 87 | /// @return {string} Value. 88 | @function _size($keys...) { 89 | @return val($size, $keys...); 90 | } -------------------------------------------------------------------------------- /src/main/java/org/paasta/sample/app/config/MysqlDataSourceConfig.java: -------------------------------------------------------------------------------- 1 | package org.paasta.sample.app.config; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | import javax.persistence.EntityManagerFactory; 7 | import javax.sql.DataSource; 8 | 9 | import org.springframework.beans.factory.annotation.Qualifier; 10 | import org.springframework.boot.context.properties.ConfigurationProperties; 11 | import org.springframework.boot.jdbc.DataSourceBuilder; 12 | import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder; 13 | import org.springframework.context.annotation.Bean; 14 | import org.springframework.context.annotation.Configuration; 15 | import org.springframework.data.jpa.repository.config.EnableJpaRepositories; 16 | import org.springframework.orm.jpa.JpaTransactionManager; 17 | import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; 18 | import org.springframework.transaction.PlatformTransactionManager; 19 | import org.springframework.transaction.annotation.EnableTransactionManagement; 20 | 21 | @Configuration 22 | @EnableTransactionManagement 23 | @EnableJpaRepositories(basePackages = "org.paasta.sample.app.mysql", entityManagerFactoryRef = "mysqlEntityManager", transactionManagerRef = "mysqlTransactionManager") 24 | public class MysqlDataSourceConfig { 25 | 26 | @Bean 27 | @ConfigurationProperties(prefix = "mysql.datasource") 28 | public DataSource mysqlDataSource() { 29 | return DataSourceBuilder.create().build(); 30 | } 31 | 32 | @Bean(name = "mysqlEntityManager") 33 | public LocalContainerEntityManagerFactoryBean mysqlEntityManagerFactory(EntityManagerFactoryBuilder builder) { 34 | Map properties = new HashMap(); 35 | properties.put("show-sql", "true"); 36 | properties.put("hibernate.format_sql", "true"); 37 | properties.put("hibernate.hbm2ddl.auto", "create"); 38 | properties.put("hibernate.use-new-id-generator-mappings","false"); 39 | return builder.dataSource(mysqlDataSource()).packages("org.paasta.sample.app.entity.mysql").persistenceUnit("mysql") 40 | .properties(properties).build(); 41 | } 42 | 43 | @Bean(name = "mysqlTransactionManager") 44 | public PlatformTransactionManager mysqlTransactionManager(@Qualifier("mysqlEntityManager") EntityManagerFactory entityManagerFactory) { 45 | return new JpaTransactionManager(entityManagerFactory); 46 | } 47 | 48 | } -------------------------------------------------------------------------------- /src/main/webapp/resources/static/assets/js/breakpoints.min.js: -------------------------------------------------------------------------------- 1 | /* breakpoints.js v1.0 | @ajlkn | MIT licensed */ 2 | var breakpoints=function(){"use strict";function e(e){t.init(e)}var t={list:null,media:{},events:[],init:function(e){t.list=e,window.addEventListener("resize",t.poll),window.addEventListener("orientationchange",t.poll),window.addEventListener("load",t.poll),window.addEventListener("fullscreenchange",t.poll)},active:function(e){var n,a,s,i,r,d,c;if(!(e in t.media)){if(">="==e.substr(0,2)?(a="gte",n=e.substr(2)):"<="==e.substr(0,2)?(a="lte",n=e.substr(2)):">"==e.substr(0,1)?(a="gt",n=e.substr(1)):"<"==e.substr(0,1)?(a="lt",n=e.substr(1)):"!"==e.substr(0,1)?(a="not",n=e.substr(1)):(a="eq",n=e),n&&n in t.list)if(i=t.list[n],Array.isArray(i)){if(r=parseInt(i[0]),d=parseInt(i[1]),isNaN(r)){if(isNaN(d))return;c=i[1].substr(String(d).length)}else c=i[0].substr(String(r).length);if(isNaN(r))switch(a){case"gte":s="screen";break;case"lte":s="screen and (max-width: "+d+c+")";break;case"gt":s="screen and (min-width: "+(d+1)+c+")";break;case"lt":s="screen and (max-width: -1px)";break;case"not":s="screen and (min-width: "+(d+1)+c+")";break;default:s="screen and (max-width: "+d+c+")"}else if(isNaN(d))switch(a){case"gte":s="screen and (min-width: "+r+c+")";break;case"lte":s="screen";break;case"gt":s="screen and (max-width: -1px)";break;case"lt":s="screen and (max-width: "+(r-1)+c+")";break;case"not":s="screen and (max-width: "+(r-1)+c+")";break;default:s="screen and (min-width: "+r+c+")"}else switch(a){case"gte":s="screen and (min-width: "+r+c+")";break;case"lte":s="screen and (max-width: "+d+c+")";break;case"gt":s="screen and (min-width: "+(d+1)+c+")";break;case"lt":s="screen and (max-width: "+(r-1)+c+")";break;case"not":s="screen and (max-width: "+(r-1)+c+"), screen and (min-width: "+(d+1)+c+")";break;default:s="screen and (min-width: "+r+c+") and (max-width: "+d+c+")"}}else s="("==i.charAt(0)?"screen and "+i:i;t.media[e]=!!s&&s}return t.media[e]!==!1&&window.matchMedia(t.media[e]).matches},on:function(e,n){t.events.push({query:e,handler:n,state:!1}),t.active(e)&&n()},poll:function(){var e,n;for(e=0;e properties = new HashMap(); 41 | properties.put("show-sql", "true"); 42 | properties.put("hibernate.format_sql", "true"); 43 | properties.put("hibernate.hbm2ddl.auto", "create"); 44 | return builder 45 | .dataSource(postgresqlDataSource()) 46 | .packages("org.paasta.sample.app.entity.postgresql") 47 | .persistenceUnit("postgresql") 48 | .properties(properties) 49 | .build(); 50 | } 51 | 52 | /* 53 | * transactionFactory 54 | */ 55 | @Primary 56 | @Bean(name = "postgresqlTransactionManager") 57 | public PlatformTransactionManager postgresqlTransactionManager( 58 | @Qualifier("postgresqlEntityManager") EntityManagerFactory entityManagerFactory) { 59 | return new JpaTransactionManager(entityManagerFactory); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/org/paasta/sample/app/controller/SampleController.java: -------------------------------------------------------------------------------- 1 | package org.paasta.sample.app.controller; 2 | 3 | import java.lang.reflect.Method; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | 7 | import org.paasta.sample.app.entity.mysql.MysqlSample; 8 | import org.paasta.sample.app.entity.postgresql.Sample; 9 | import org.paasta.sample.app.mysql.MysqlSampleRepository; 10 | import org.paasta.sample.app.postgresql.SampleRepository; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.stereotype.Controller; 13 | import org.springframework.web.bind.annotation.RequestMapping; 14 | import org.springframework.web.bind.annotation.ResponseBody; 15 | 16 | import com.google.gson.Gson; 17 | 18 | @Controller 19 | public class SampleController { 20 | 21 | @Autowired 22 | MysqlSampleRepository mysqlRepo; 23 | 24 | @Autowired 25 | SampleRepository postRepo; 26 | 27 | @Autowired 28 | Gson gson; 29 | 30 | @RequestMapping("/") 31 | public String home() { 32 | return "index"; 33 | } 34 | 35 | @RequestMapping("/postgres") 36 | @ResponseBody 37 | public String postList() { 38 | System.out.println("여기로 오는 것 체크! 포스트 "); 39 | if(postRepo.count() != 0) { 40 | return gson.toJson(postRepo.findAll()); 41 | } 42 | 43 | try { 44 | List postList = (List) sampleSetter("postgresql", Sample.class); 45 | postList.forEach(sample -> postRepo.save(sample)); 46 | } catch (Exception e) { 47 | // TODO Auto-generated catch block 48 | e.printStackTrace(); 49 | } 50 | 51 | return gson.toJson(postRepo.findAll()); 52 | } 53 | 54 | @RequestMapping("/mysql") 55 | @ResponseBody 56 | public String mysqlList() { 57 | System.out.println("여기로 오는 것 체크! 마이에수 " + mysqlRepo.count()); 58 | if(mysqlRepo.count() != 0) { 59 | return gson.toJson(mysqlRepo.findAll()); 60 | } 61 | 62 | try { 63 | List mysqlList = (List) sampleSetter("mysql", MysqlSample.class); 64 | mysqlList.forEach(mysqlSample -> mysqlRepo.save(mysqlSample)); //mysqlRepo.save(mysqlSample) 65 | } catch (Exception e) { 66 | // TODO Auto-generated catch block 67 | e.printStackTrace(); 68 | } 69 | 70 | return gson.toJson(mysqlRepo.findAll()); 71 | } 72 | 73 | private List sampleSetter(String DBName, Object type) throws Exception { 74 | List resultList = new ArrayList<>(); 75 | Object resultObject = null; 76 | Class aClass = (Class) type; 77 | 78 | Method methodSetId = aClass.getMethod("setId", Long.TYPE); 79 | Method methodSetName = aClass.getMethod("setName", String.class); 80 | Method methodSetEmail = aClass.getMethod("setEmail", String.class); 81 | 82 | 83 | for(int index=1; index<6; index++) { 84 | resultObject = ((Class) type).newInstance(); 85 | methodSetId.invoke(resultObject, index); 86 | methodSetName.invoke(resultObject, DBName + "-sample" + index); 87 | methodSetEmail.invoke(resultObject, "sample" + index + "@sample.com"); 88 | resultList.add(resultObject); 89 | } 90 | return resultList; 91 | } 92 | 93 | } 94 | -------------------------------------------------------------------------------- /src/main/webapp/resources/static/assets/sass/libs/_html-grid.scss: -------------------------------------------------------------------------------- 1 | // html-grid.scss v1.0 | @ajlkn | MIT licensed */ 2 | 3 | // Mixins. 4 | 5 | /// Initializes the current element as an HTML grid. 6 | /// @param {mixed} $gutters Gutters (either a single number to set both column/row gutters, or a list to set them individually). 7 | /// @param {mixed} $suffix Column class suffix (optional; either a single suffix or a list). 8 | @mixin html-grid($gutters: 1.5em, $suffix: '') { 9 | 10 | // Initialize. 11 | $cols: 12; 12 | $multipliers: 0, 0.25, 0.5, 1, 1.50, 2.00; 13 | $unit: 100% / $cols; 14 | 15 | // Suffixes. 16 | $suffixes: null; 17 | 18 | @if (type-of($suffix) == 'list') { 19 | $suffixes: $suffix; 20 | } 21 | @else { 22 | $suffixes: ($suffix); 23 | } 24 | 25 | // Gutters. 26 | $guttersCols: null; 27 | $guttersRows: null; 28 | 29 | @if (type-of($gutters) == 'list') { 30 | 31 | $guttersCols: nth($gutters, 1); 32 | $guttersRows: nth($gutters, 2); 33 | 34 | } 35 | @else { 36 | 37 | $guttersCols: $gutters; 38 | $guttersRows: 0; 39 | 40 | } 41 | 42 | // Row. 43 | display: flex; 44 | flex-wrap: wrap; 45 | box-sizing: border-box; 46 | align-items: stretch; 47 | 48 | // Columns. 49 | > * { 50 | box-sizing: border-box; 51 | } 52 | 53 | // Gutters. 54 | &.gtr-uniform { 55 | > * { 56 | > :last-child { 57 | margin-bottom: 0; 58 | } 59 | } 60 | } 61 | 62 | // Alignment. 63 | &.aln-left { 64 | justify-content: flex-start; 65 | } 66 | 67 | &.aln-center { 68 | justify-content: center; 69 | } 70 | 71 | &.aln-right { 72 | justify-content: flex-end; 73 | } 74 | 75 | &.aln-top { 76 | align-items: flex-start; 77 | } 78 | 79 | &.aln-middle { 80 | align-items: center; 81 | } 82 | 83 | &.aln-bottom { 84 | align-items: flex-end; 85 | } 86 | 87 | // Step through suffixes. 88 | @each $suffix in $suffixes { 89 | 90 | // Suffix. 91 | @if ($suffix != '') { 92 | $suffix: '-' + $suffix; 93 | } 94 | @else { 95 | $suffix: ''; 96 | } 97 | 98 | // Row. 99 | 100 | // Important. 101 | > .imp#{$suffix} { 102 | order: -1; 103 | } 104 | 105 | // Columns, offsets. 106 | @for $i from 1 through $cols { 107 | > .col-#{$i}#{$suffix} { 108 | width: $unit * $i; 109 | } 110 | 111 | > .off-#{$i}#{$suffix} { 112 | margin-left: $unit * $i; 113 | } 114 | } 115 | 116 | // Step through multipliers. 117 | @each $multiplier in $multipliers { 118 | 119 | // Gutters. 120 | $class: null; 121 | 122 | @if ($multiplier != 1) { 123 | $class: '.gtr-' + ($multiplier * 100); 124 | } 125 | 126 | &#{$class} { 127 | margin-top: ($guttersRows * $multiplier * -1); 128 | margin-left: ($guttersCols * $multiplier * -1); 129 | 130 | > * { 131 | padding: ($guttersRows * $multiplier) 0 0 ($guttersCols * $multiplier); 132 | } 133 | 134 | // Uniform. 135 | &.gtr-uniform { 136 | margin-top: $guttersCols * $multiplier * -1; 137 | 138 | > * { 139 | padding-top: $guttersCols * $multiplier; 140 | } 141 | } 142 | 143 | } 144 | 145 | } 146 | 147 | } 148 | 149 | } -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/index.jsp: -------------------------------------------------------------------------------- 1 | <%@page contentType="text/html" pageEncoding="UTF-8"%> 2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 3 | 4 | 5 | 6 | PaaS-TA Sample App 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |