ソースを参照

Merge pull request #2 from xt0fer/dev

Yes, now with a real mysql backend and an ionic client.
KrYounger 6 年 前
コミット
8e76a25f2e
コミット者のEメールアドレスに関連付けられたアカウントが存在しません
共有41 個のファイルを変更した7578 個の追加2 個の削除を含む
  1. 3
    1
      .gitignore
  2. 19
    1
      README.md
  3. 17
    0
      frontend/SimpleMonday/.editorconfig
  4. 6
    0
      frontend/SimpleMonday/ionic.config.json
  5. 6954
    0
      frontend/SimpleMonday/package-lock.json
  6. 39
    0
      frontend/SimpleMonday/package.json
  7. 22
    0
      frontend/SimpleMonday/src/app/app.component.ts
  8. 1
    0
      frontend/SimpleMonday/src/app/app.html
  9. 44
    0
      frontend/SimpleMonday/src/app/app.module.ts
  10. 16
    0
      frontend/SimpleMonday/src/app/app.scss
  11. 5
    0
      frontend/SimpleMonday/src/app/main.ts
  12. バイナリ
      frontend/SimpleMonday/src/assets/icon/favicon.ico
  13. バイナリ
      frontend/SimpleMonday/src/assets/imgs/logo.png
  14. 49
    0
      frontend/SimpleMonday/src/index.html
  15. 13
    0
      frontend/SimpleMonday/src/manifest.json
  16. 40
    0
      frontend/SimpleMonday/src/pages/about/about.html
  17. 3
    0
      frontend/SimpleMonday/src/pages/about/about.scss
  18. 14
    0
      frontend/SimpleMonday/src/pages/about/about.ts
  19. 18
    0
      frontend/SimpleMonday/src/pages/contact/contact.html
  20. 3
    0
      frontend/SimpleMonday/src/pages/contact/contact.scss
  21. 24
    0
      frontend/SimpleMonday/src/pages/contact/contact.ts
  22. 18
    0
      frontend/SimpleMonday/src/pages/home/home.html
  23. 3
    0
      frontend/SimpleMonday/src/pages/home/home.scss
  24. 14
    0
      frontend/SimpleMonday/src/pages/home/home.ts
  25. 5
    0
      frontend/SimpleMonday/src/pages/tabs/tabs.html
  26. 19
    0
      frontend/SimpleMonday/src/pages/tabs/tabs.ts
  27. 31
    0
      frontend/SimpleMonday/src/service-worker.js
  28. 88
    0
      frontend/SimpleMonday/src/theme/variables.scss
  29. 28
    0
      frontend/SimpleMonday/tsconfig.json
  30. 11
    0
      frontend/SimpleMonday/tslint.json
  31. 5
    0
      pom.xml
  32. 41
    0
      src/main/java/com/example/throwupthursday/PersonController.java
  33. 11
    0
      src/main/java/com/example/throwupthursday/PersonRepository.java
  34. 2
    0
      src/main/java/com/example/throwupthursday/ThrowupThursdayApplication.java
  35. 1
    0
      src/main/java/com/example/throwupthursday/config/BookLoader.java
  36. 1
    0
      src/main/java/com/example/throwupthursday/config/PersonLoader.java
  37. 1
    0
      src/main/java/com/example/throwupthursday/daos/Book.java
  38. 1
    0
      src/main/java/com/example/throwupthursday/daos/BookDAO.java
  39. 2
    0
      src/main/java/com/example/throwupthursday/daos/Person.java
  40. 2
    0
      src/main/java/com/example/throwupthursday/daos/PersonDAO.java
  41. 4
    0
      src/main/resources/application.properties

+ 3
- 1
.gitignore ファイルの表示

@@ -22,4 +22,6 @@ build/
22 22
 nbbuild/
23 23
 dist/
24 24
 nbdist/
25
-.nb-gradle/
25
+.nb-gradle/
26
+
27
+frontend/SimpleMonday/node_modules

+ 19
- 1
README.md ファイルの表示

@@ -1,11 +1,29 @@
1 1
 # Throwup Thursday
2 2
 
3
-*Use spring, and HAL Browser (for Spring Data REST) to create a couple of POJOs (Book and Person) and
3
+*Use Spring, and HAL Browser (for Spring Data REST) to create a couple of POJOs (Book and Person) and
4 4
 a framework so that we can mock up some data in spring, and then generate
5 5
 JSON and other marvels.*
6 6
 
7 7
 **Run and then point a browser to [http://localhost:8080/]()**
8 8
 
9
+## New and Improved!! As seen ov TV! 
10
+## ThrowupThursday can now talk to a MySQL db running on your machine.
11
+
12
+Yes, that's right, you can do a very simple CRUDRepository in Spring to suply the data you need!
13
+
14
+You're welcome.
15
+
16
+## New and Improved! Now with the earth-shattering SimpleMonday Client!!
17
+
18
+Then open VSC on the SAME project. Go into frontend/SimpleMonday and find a simple Ionic 3 client, which can talk to the 
19
+Spring server above, fetch a single GET from the server display the results in the People tab of the 
20
+SimpleMonday client.
21
+
22
+BUT to make this work, you need to go to [http://localhost:8100]() with the Chrome browser, and then
23
+download and INSTALL this extension: https://chrome.google.com/webstore/detail/cors-toggle/jioikioepegflmdnbocfhgmpmopmjkim
24
+That will allow the SimpleMonday client to load the JSON from localhost:8080
25
+Otherwise the SimpleMonday client runs afoul of CORS (look it up).
26
+
9 27
 
10 28
 #### Kris and Wilhem wrote this, because we feel sorry for the poor Zipcoder-wanna-bees.
11 29
 

+ 17
- 0
frontend/SimpleMonday/.editorconfig ファイルの表示

@@ -0,0 +1,17 @@
1
+# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs
2
+# editorconfig.org
3
+
4
+root = true
5
+
6
+[*]
7
+indent_style = space
8
+indent_size = 2
9
+
10
+# We recommend you to keep these unchanged
11
+end_of_line = lf
12
+charset = utf-8
13
+trim_trailing_whitespace = true
14
+insert_final_newline = true
15
+
16
+[*.md]
17
+trim_trailing_whitespace = false

+ 6
- 0
frontend/SimpleMonday/ionic.config.json ファイルの表示

@@ -0,0 +1,6 @@
1
+{
2
+  "name": "SimpleMonday",
3
+  "app_id": "",
4
+  "type": "ionic-angular",
5
+  "integrations": {}
6
+}

+ 6954
- 0
frontend/SimpleMonday/package-lock.json
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 39
- 0
frontend/SimpleMonday/package.json ファイルの表示

@@ -0,0 +1,39 @@
1
+{
2
+  "name": "SimpleMonday",
3
+  "version": "0.0.1",
4
+  "author": "Ionic Framework",
5
+  "homepage": "http://ionicframework.com/",
6
+  "private": true,
7
+  "scripts": {
8
+    "clean": "ionic-app-scripts clean",
9
+    "build": "ionic-app-scripts build",
10
+    "lint": "ionic-app-scripts lint",
11
+    "ionic:build": "ionic-app-scripts build",
12
+    "ionic:serve": "ionic-app-scripts serve"
13
+  },
14
+  "dependencies": {
15
+    "@angular/animations": "5.2.9",
16
+    "@angular/common": "5.2.9",
17
+    "@angular/compiler": "5.2.9",
18
+    "@angular/compiler-cli": "5.2.9",
19
+    "@angular/core": "5.2.9",
20
+    "@angular/forms": "5.2.9",
21
+    "@angular/http": "5.2.9",
22
+    "@angular/platform-browser": "5.2.9",
23
+    "@angular/platform-browser-dynamic": "5.2.9",
24
+    "@ionic-native/core": "4.6.0",
25
+    "@ionic-native/splash-screen": "4.6.0",
26
+    "@ionic-native/status-bar": "4.6.0",
27
+    "@ionic/storage": "2.1.3",
28
+    "ionic-angular": "3.9.2",
29
+    "ionicons": "3.0.0",
30
+    "rxjs": "5.5.8",
31
+    "sw-toolbox": "3.6.0",
32
+    "zone.js": "0.8.20"
33
+  },
34
+  "devDependencies": {
35
+    "@ionic/app-scripts": "3.1.8",
36
+    "typescript": "~2.6.2"
37
+  },
38
+  "description": "An Ionic project"
39
+}

+ 22
- 0
frontend/SimpleMonday/src/app/app.component.ts ファイルの表示

@@ -0,0 +1,22 @@
1
+import { Component } from '@angular/core';
2
+import { Platform } from 'ionic-angular';
3
+import { StatusBar } from '@ionic-native/status-bar';
4
+import { SplashScreen } from '@ionic-native/splash-screen';
5
+
6
+import { TabsPage } from '../pages/tabs/tabs';
7
+
8
+@Component({
9
+  templateUrl: 'app.html'
10
+})
11
+export class MyApp {
12
+  rootPage:any = TabsPage;
13
+
14
+  constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
15
+    platform.ready().then(() => {
16
+      // Okay, so the platform is ready and our plugins are available.
17
+      // Here you can do any higher level native things you might need.
18
+      statusBar.styleDefault();
19
+      splashScreen.hide();
20
+    });
21
+  }
22
+}

+ 1
- 0
frontend/SimpleMonday/src/app/app.html ファイルの表示

@@ -0,0 +1 @@
1
+<ion-nav [root]="rootPage"></ion-nav>

+ 44
- 0
frontend/SimpleMonday/src/app/app.module.ts ファイルの表示

@@ -0,0 +1,44 @@
1
+import { NgModule, ErrorHandler } from '@angular/core';
2
+import { BrowserModule } from '@angular/platform-browser';
3
+import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
4
+import { MyApp } from './app.component';
5
+import { HttpModule } from '@angular/http';
6
+
7
+import { AboutPage } from '../pages/about/about';
8
+import { ContactPage } from '../pages/contact/contact';
9
+import { HomePage } from '../pages/home/home';
10
+import { TabsPage } from '../pages/tabs/tabs';
11
+
12
+import { StatusBar } from '@ionic-native/status-bar';
13
+import { SplashScreen } from '@ionic-native/splash-screen';
14
+import { PeopleSupplyProvider } from '../providers/people-supply/people-supply';
15
+
16
+@NgModule({
17
+  declarations: [
18
+    MyApp,
19
+    AboutPage,
20
+    ContactPage,
21
+    HomePage,
22
+    TabsPage
23
+  ],
24
+  imports: [
25
+    BrowserModule,
26
+    HttpModule,
27
+    IonicModule.forRoot(MyApp)
28
+  ],
29
+  bootstrap: [IonicApp],
30
+  entryComponents: [
31
+    MyApp,
32
+    AboutPage,
33
+    ContactPage,
34
+    HomePage,
35
+    TabsPage
36
+  ],
37
+  providers: [
38
+    StatusBar,
39
+    SplashScreen,
40
+    {provide: ErrorHandler, useClass: IonicErrorHandler},
41
+    PeopleSupplyProvider
42
+  ]
43
+})
44
+export class AppModule {}

+ 16
- 0
frontend/SimpleMonday/src/app/app.scss ファイルの表示

@@ -0,0 +1,16 @@
1
+// http://ionicframework.com/docs/theming/
2
+
3
+
4
+// App Global Sass
5
+// --------------------------------------------------
6
+// Put style rules here that you want to apply globally. These
7
+// styles are for the entire app and not just one component.
8
+// Additionally, this file can be also used as an entry point
9
+// to import other Sass files to be included in the output CSS.
10
+//
11
+// Shared Sass variables, which can be used to adjust Ionic's
12
+// default Sass variables, belong in "theme/variables.scss".
13
+//
14
+// To declare rules for a specific mode, create a child rule
15
+// for the .md, .ios, or .wp mode classes. The mode class is
16
+// automatically applied to the <body> element in the app.

+ 5
- 0
frontend/SimpleMonday/src/app/main.ts ファイルの表示

@@ -0,0 +1,5 @@
1
+import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
2
+
3
+import { AppModule } from './app.module';
4
+
5
+platformBrowserDynamic().bootstrapModule(AppModule);

バイナリ
frontend/SimpleMonday/src/assets/icon/favicon.ico ファイルの表示


バイナリ
frontend/SimpleMonday/src/assets/imgs/logo.png ファイルの表示


+ 49
- 0
frontend/SimpleMonday/src/index.html ファイルの表示

@@ -0,0 +1,49 @@
1
+<!DOCTYPE html>
2
+<html lang="en" dir="ltr">
3
+<head>
4
+  <meta charset="UTF-8">
5
+  <title>Ionic App</title>
6
+  <meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
7
+  <meta name="format-detection" content="telephone=no">
8
+  <meta name="msapplication-tap-highlight" content="no">
9
+
10
+  <link rel="icon" type="image/x-icon" href="assets/icon/favicon.ico">
11
+  <link rel="manifest" href="manifest.json">
12
+  <meta name="theme-color" content="#4e8ef7">
13
+
14
+  <!-- add to homescreen for ios -->
15
+  <meta name="apple-mobile-web-app-capable" content="yes">
16
+  <meta name="apple-mobile-web-app-status-bar-style" content="black">
17
+
18
+  <!-- cordova.js required for cordova apps (remove if not needed) -->
19
+  <script src="cordova.js"></script>
20
+
21
+  <!-- un-comment this code to enable service worker
22
+  <script>
23
+    if ('serviceWorker' in navigator) {
24
+      navigator.serviceWorker.register('service-worker.js')
25
+        .then(() => console.log('service worker installed'))
26
+        .catch(err => console.error('Error', err));
27
+    }
28
+  </script>-->
29
+
30
+  <link href="build/main.css" rel="stylesheet">
31
+
32
+</head>
33
+<body>
34
+
35
+  <!-- Ionic's root component and where the app will load -->
36
+  <ion-app></ion-app>
37
+
38
+  <!-- The polyfills js is generated during the build process -->
39
+  <script src="build/polyfills.js"></script>
40
+
41
+  <!-- The vendor js is generated during the build process
42
+       It contains all of the dependencies in node_modules -->
43
+  <script src="build/vendor.js"></script>
44
+
45
+  <!-- The main bundle js is generated during the build process -->
46
+  <script src="build/main.js"></script>
47
+
48
+</body>
49
+</html>

+ 13
- 0
frontend/SimpleMonday/src/manifest.json ファイルの表示

@@ -0,0 +1,13 @@
1
+{
2
+  "name": "Ionic",
3
+  "short_name": "Ionic",
4
+  "start_url": "index.html",
5
+  "display": "standalone",
6
+  "icons": [{
7
+    "src": "assets/imgs/logo.png",
8
+    "sizes": "512x512",
9
+    "type": "image/png"
10
+  }],
11
+  "background_color": "#4e8ef7",
12
+  "theme_color": "#4e8ef7"
13
+}

+ 40
- 0
frontend/SimpleMonday/src/pages/about/about.html ファイルの表示

@@ -0,0 +1,40 @@
1
+<ion-header>
2
+  <ion-navbar>
3
+    <ion-title>
4
+      About Simply Monday
5
+    </ion-title>
6
+  </ion-navbar>
7
+</ion-header>
8
+
9
+<ion-content padding>
10
+  <h2>Monday Monday, -- The Mommas and Papas</h2>
11
+<p>Bah-da bah-da-da-da
12
+  Bah-da bah-da-da-da
13
+  Bah-da bah-da-da-da</p><p>
14
+  Monday, Monday, so good to me
15
+  Monday mornin´, it was all I hoped it would be
16
+  Oh Monday mornin´, Monday mornin´ couldn´t guarantee
17
+  That Monday evenin´ you would still be here with me</p><p>
18
+  Monday, Monday, can´t trust that day
19
+  Monday, Monday, sometimes it just turns out that way
20
+  Oh Monday mornin´ you gave me no warnin´ of what was to be
21
+  Oh Monday, Monday, how could you leave and not take me</p><p>
22
+  Every other day, every other day
23
+  Every other day of the week is fine, yeah
24
+  But whenever Monday comes, but whenever Monday comes
25
+  A-you can find me cryin´ all of the time</p><p>
26
+  Monday, Monday, so good to me
27
+  Monday mornin´, it was all I hoped it would be
28
+  But Monday mornin´, Monday mornin´ couldn´t guarantee
29
+  That Monday evenin´ you would still be here with me</p><p>
30
+  Every other day, every other day
31
+  Every other day of the week is fine, yeah
32
+  But whenever Monday comes, but whenever Monday comes
33
+  A-you can find me cryin´ all of the time</p><p>
34
+  Monday, Monday, can´t trust that day
35
+  Monday, Monday, it just turns out that way
36
+  Oh Monday, Monday, won´t go away
37
+  Monday, Monday, it´s here to stay
38
+  Oh Monday, Monday
39
+  Oh Monday, Monday</p>
40
+</ion-content>

+ 3
- 0
frontend/SimpleMonday/src/pages/about/about.scss ファイルの表示

@@ -0,0 +1,3 @@
1
+page-about {
2
+
3
+}

+ 14
- 0
frontend/SimpleMonday/src/pages/about/about.ts ファイルの表示

@@ -0,0 +1,14 @@
1
+import { Component } from '@angular/core';
2
+import { NavController } from 'ionic-angular';
3
+
4
+@Component({
5
+  selector: 'page-about',
6
+  templateUrl: 'about.html'
7
+})
8
+export class AboutPage {
9
+
10
+  constructor(public navCtrl: NavController) {
11
+
12
+  }
13
+
14
+}

+ 18
- 0
frontend/SimpleMonday/src/pages/contact/contact.html ファイルの表示

@@ -0,0 +1,18 @@
1
+<ion-header>
2
+  <ion-navbar>
3
+    <ion-title>
4
+      Contact
5
+    </ion-title>
6
+  </ion-navbar>
7
+</ion-header>
8
+
9
+<ion-content>
10
+  <ion-list>
11
+      <ion-list-header>Live People!</ion-list-header>
12
+
13
+      <ion-item *ngFor="let person of people">
14
+        <!-- <img [src]="person.data.url" /> -->
15
+        <ion-icon name="person" item-start></ion-icon> {{person.name}} age: {{person.age}}
16
+      </ion-item>
17
+    </ion-list>
18
+</ion-content>

+ 3
- 0
frontend/SimpleMonday/src/pages/contact/contact.scss ファイルの表示

@@ -0,0 +1,3 @@
1
+page-contact {
2
+
3
+}

+ 24
- 0
frontend/SimpleMonday/src/pages/contact/contact.ts ファイルの表示

@@ -0,0 +1,24 @@
1
+import { Component } from '@angular/core';
2
+import { NavController } from 'ionic-angular';
3
+import { Http } from '@angular/http';
4
+
5
+import 'rxjs/add/operator/map';
6
+
7
+
8
+@Component({
9
+  selector: 'page-contact',
10
+  templateUrl: 'contact.html'
11
+})
12
+
13
+export class ContactPage {
14
+  people: any;
15
+
16
+  constructor(public navCtrl: NavController, public http: Http) {
17
+    this.http.get('http://localhost:8080/persons').map(res => res.json()).subscribe(data => {
18
+        //console.log(data);
19
+        this.people = data._embedded.persons;
20
+    });
21
+
22
+  }
23
+
24
+}

+ 18
- 0
frontend/SimpleMonday/src/pages/home/home.html ファイルの表示

@@ -0,0 +1,18 @@
1
+<ion-header>
2
+  <ion-navbar>
3
+    <ion-title>Home</ion-title>
4
+  </ion-navbar>
5
+</ion-header>
6
+
7
+<ion-content padding>
8
+  <h2>Welcome to Simple Monday!</h2>
9
+  <p>
10
+    This starter project comes with simple tabs-based layout for apps
11
+    that are going to primarily use a Tabbed UI.
12
+  </p>
13
+  <p>
14
+    Take a look at the <code>src/pages/</code> directory to add or change tabs,
15
+    update any existing page or create new pages.
16
+  </p>
17
+  <p>and this also loads the persons from the ThrowupThursday Spring.io server. You're welcome.</p>
18
+</ion-content>

+ 3
- 0
frontend/SimpleMonday/src/pages/home/home.scss ファイルの表示

@@ -0,0 +1,3 @@
1
+page-home {
2
+
3
+}

+ 14
- 0
frontend/SimpleMonday/src/pages/home/home.ts ファイルの表示

@@ -0,0 +1,14 @@
1
+import { Component } from '@angular/core';
2
+import { NavController } from 'ionic-angular';
3
+
4
+@Component({
5
+  selector: 'page-home',
6
+  templateUrl: 'home.html'
7
+})
8
+export class HomePage {
9
+
10
+  constructor(public navCtrl: NavController) {
11
+
12
+  }
13
+
14
+}

+ 5
- 0
frontend/SimpleMonday/src/pages/tabs/tabs.html ファイルの表示

@@ -0,0 +1,5 @@
1
+<ion-tabs>
2
+  <ion-tab [root]="tab1Root" tabTitle="Home" tabIcon="home"></ion-tab>
3
+  <ion-tab [root]="tab2Root" tabTitle="About" tabIcon="information-circle"></ion-tab>
4
+  <ion-tab [root]="tab3Root" tabTitle="People" tabIcon="contacts"></ion-tab>
5
+</ion-tabs>

+ 19
- 0
frontend/SimpleMonday/src/pages/tabs/tabs.ts ファイルの表示

@@ -0,0 +1,19 @@
1
+import { Component } from '@angular/core';
2
+
3
+import { AboutPage } from '../about/about';
4
+import { ContactPage } from '../contact/contact';
5
+import { HomePage } from '../home/home';
6
+
7
+@Component({
8
+  templateUrl: 'tabs.html'
9
+})
10
+export class TabsPage {
11
+
12
+  tab1Root = HomePage;
13
+  tab2Root = AboutPage;
14
+  tab3Root = ContactPage;
15
+
16
+  constructor() {
17
+
18
+  }
19
+}

+ 31
- 0
frontend/SimpleMonday/src/service-worker.js ファイルの表示

@@ -0,0 +1,31 @@
1
+/**
2
+ * Check out https://googlechromelabs.github.io/sw-toolbox/ for
3
+ * more info on how to use sw-toolbox to custom configure your service worker.
4
+ */
5
+
6
+
7
+'use strict';
8
+importScripts('./build/sw-toolbox.js');
9
+
10
+self.toolbox.options.cache = {
11
+  name: 'ionic-cache'
12
+};
13
+
14
+// pre-cache our key assets
15
+self.toolbox.precache(
16
+  [
17
+    './build/main.js',
18
+    './build/vendor.js',
19
+    './build/main.css',
20
+    './build/polyfills.js',
21
+    'index.html',
22
+    'manifest.json'
23
+  ]
24
+);
25
+
26
+// dynamically cache any other local assets
27
+self.toolbox.router.any('/*', self.toolbox.fastest);
28
+
29
+// for any other requests go to the network, cache,
30
+// and then only use that cached resource if your user goes offline
31
+self.toolbox.router.default = self.toolbox.networkFirst;

+ 88
- 0
frontend/SimpleMonday/src/theme/variables.scss ファイルの表示

@@ -0,0 +1,88 @@
1
+// Ionic Variables and Theming. For more info, please see:
2
+// http://ionicframework.com/docs/theming/
3
+
4
+// Font path is used to include ionicons,
5
+// roboto, and noto sans fonts
6
+$font-path: "../assets/fonts";
7
+
8
+
9
+// The app direction is used to include
10
+// rtl styles in your app. For more info, please see:
11
+// http://ionicframework.com/docs/theming/rtl-support/
12
+$app-direction: ltr;
13
+
14
+
15
+@import "ionic.globals";
16
+
17
+
18
+// Shared Variables
19
+// --------------------------------------------------
20
+// To customize the look and feel of this app, you can override
21
+// the Sass variables found in Ionic's source scss files.
22
+// To view all the possible Ionic variables, see:
23
+// http://ionicframework.com/docs/theming/overriding-ionic-variables/
24
+
25
+
26
+
27
+
28
+// Named Color Variables
29
+// --------------------------------------------------
30
+// Named colors makes it easy to reuse colors on various components.
31
+// It's highly recommended to change the default colors
32
+// to match your app's branding. Ionic uses a Sass map of
33
+// colors so you can add, rename and remove colors as needed.
34
+// The "primary" color is the only required color in the map.
35
+
36
+$colors: (
37
+  primary:    #488aff,
38
+  secondary:  #32db64,
39
+  danger:     #f53d3d,
40
+  light:      #f4f4f4,
41
+  dark:       #222
42
+);
43
+
44
+
45
+// App iOS Variables
46
+// --------------------------------------------------
47
+// iOS only Sass variables can go here
48
+
49
+
50
+
51
+
52
+// App Material Design Variables
53
+// --------------------------------------------------
54
+// Material Design only Sass variables can go here
55
+
56
+
57
+
58
+
59
+// App Windows Variables
60
+// --------------------------------------------------
61
+// Windows only Sass variables can go here
62
+
63
+
64
+
65
+
66
+// App Theme
67
+// --------------------------------------------------
68
+// Ionic apps can have different themes applied, which can
69
+// then be future customized. This import comes last
70
+// so that the above variables are used and Ionic's
71
+// default are overridden.
72
+
73
+@import "ionic.theme.default";
74
+
75
+
76
+// Ionicons
77
+// --------------------------------------------------
78
+// The premium icon font for Ionic. For more info, please see:
79
+// http://ionicframework.com/docs/ionicons/
80
+
81
+@import "ionic.ionicons";
82
+
83
+
84
+// Fonts
85
+// --------------------------------------------------
86
+
87
+@import "roboto";
88
+@import "noto-sans";

+ 28
- 0
frontend/SimpleMonday/tsconfig.json ファイルの表示

@@ -0,0 +1,28 @@
1
+{
2
+  "compilerOptions": {
3
+    "allowSyntheticDefaultImports": true,
4
+    "declaration": false,
5
+    "emitDecoratorMetadata": true,
6
+    "experimentalDecorators": true,
7
+    "lib": [
8
+      "dom",
9
+      "es2015"
10
+    ],
11
+    "module": "es2015",
12
+    "moduleResolution": "node",
13
+    "sourceMap": true,
14
+    "target": "es5"
15
+  },
16
+  "include": [
17
+    "src/**/*.ts"
18
+  ],
19
+  "exclude": [
20
+    "node_modules",
21
+    "src/**/*.spec.ts",
22
+    "src/**/__tests__/*.ts"
23
+  ],
24
+  "compileOnSave": false,
25
+  "atom": {
26
+    "rewriteTsconfig": false
27
+  }
28
+}

+ 11
- 0
frontend/SimpleMonday/tslint.json ファイルの表示

@@ -0,0 +1,11 @@
1
+{
2
+  "rules": {
3
+    "no-duplicate-variable": true,
4
+    "no-unused-variable": [
5
+      true
6
+    ]
7
+  },
8
+  "rulesDirectory": [
9
+    "node_modules/tslint-eslint-rules/dist/rules"
10
+  ]
11
+}

+ 5
- 0
pom.xml ファイルの表示

@@ -30,6 +30,10 @@
30 30
 			<artifactId>spring-boot-starter-data-jpa</artifactId>
31 31
 		</dependency>
32 32
 		<dependency>
33
+			<groupId>mysql</groupId>
34
+			<artifactId>mysql-connector-java</artifactId>
35
+		</dependency>
36
+		<dependency>
33 37
 			<groupId>org.springframework.boot</groupId>
34 38
 			<artifactId>spring-boot-starter-data-rest</artifactId>
35 39
 		</dependency>
@@ -69,3 +73,4 @@
69 73
 
70 74
 
71 75
 </project>
76
+

+ 41
- 0
src/main/java/com/example/throwupthursday/PersonController.java ファイルの表示

@@ -0,0 +1,41 @@
1
+package com.example.throwupthursday;
2
+
3
+
4
+import org.springframework.beans.factory.annotation.Autowired;
5
+import org.springframework.stereotype.Controller;
6
+import org.springframework.web.bind.annotation.RequestMapping;
7
+import org.springframework.web.bind.annotation.GetMapping;
8
+import org.springframework.web.bind.annotation.RequestParam;
9
+import org.springframework.web.bind.annotation.ResponseBody;
10
+
11
+import com.example.throwupthursday.daos.Person;
12
+import com.example.throwupthursday.PersonRepository;
13
+
14
+@Controller    // This means that this class is a Controller
15
+@RequestMapping(path="/people") // This means URL's start with /demo (after Application path)
16
+public class PersonController {
17
+    @Autowired // This means to get the bean called userRepository
18
+    // Which is auto-generated by Spring, we will use it to handle the data
19
+    private PersonRepository personRepository;
20
+
21
+    @GetMapping(path="/add") // Map ONLY GET Requests
22
+    public @ResponseBody String addNewUser (@RequestParam String name
23
+            , @RequestParam Integer age) {
24
+        // @ResponseBody means the returned String is the response, not a view name
25
+        // @RequestParam means it is a parameter from the GET or POST request
26
+
27
+        Person n = new Person();
28
+        n.setName(name);
29
+        n.setAge(age);
30
+        personRepository.save(n);
31
+        return "Saved";
32
+    }
33
+
34
+    @GetMapping(path="/all")
35
+    public @ResponseBody Iterable<Person> getAllUsers() {
36
+        // This returns a JSON or XML with the users
37
+        return personRepository.findAll();
38
+    }
39
+}
40
+
41
+// $ curl 'localhost:8080/people/add?name=George&age=28'

+ 11
- 0
src/main/java/com/example/throwupthursday/PersonRepository.java ファイルの表示

@@ -0,0 +1,11 @@
1
+package com.example.throwupthursday;
2
+import org.springframework.data.repository.CrudRepository;
3
+
4
+import com.example.throwupthursday.daos.Person;
5
+
6
+// This will be AUTO IMPLEMENTED by Spring into a Bean called userRepository
7
+// CRUD refers Create, Read, Update, Delete
8
+
9
+public interface PersonRepository extends CrudRepository<Person, Long> {
10
+
11
+}

+ 2
- 0
src/main/java/com/example/throwupthursday/ThrowupThursdayApplication.java ファイルの表示

@@ -3,6 +3,8 @@ package com.example.throwupthursday;
3 3
 import org.springframework.boot.SpringApplication;
4 4
 import org.springframework.boot.autoconfigure.SpringBootApplication;
5 5
 
6
+//
7
+
6 8
 @SpringBootApplication
7 9
 public class ThrowupThursdayApplication {
8 10
 

+ 1
- 0
src/main/java/com/example/throwupthursday/config/BookLoader.java ファイルの表示

@@ -7,6 +7,7 @@ import org.springframework.boot.ApplicationArguments;
7 7
 import org.springframework.boot.ApplicationRunner;
8 8
 import org.springframework.stereotype.Component;
9 9
 
10
+
10 11
 @Component
11 12
 public class BookLoader implements ApplicationRunner {
12 13
     private BookDAO book;

+ 1
- 0
src/main/java/com/example/throwupthursday/config/PersonLoader.java ファイルの表示

@@ -7,6 +7,7 @@ import org.springframework.boot.ApplicationArguments;
7 7
 import org.springframework.boot.ApplicationRunner;
8 8
 import org.springframework.stereotype.Component;
9 9
 
10
+
10 11
 @Component
11 12
 public class PersonLoader implements ApplicationRunner {
12 13
     private PersonDAO person;

+ 1
- 0
src/main/java/com/example/throwupthursday/daos/Book.java ファイルの表示

@@ -15,6 +15,7 @@ import javax.persistence.GenerationType;
15 15
 //            "isbn10":"0871404427",
16 16
 //            "isbn13":"9780871404428"
17 17
 
18
+
18 19
 @Entity
19 20
 public class Book {
20 21
     @javax.persistence.Id

+ 1
- 0
src/main/java/com/example/throwupthursday/daos/BookDAO.java ファイルの表示

@@ -4,6 +4,7 @@ import org.springframework.data.repository.PagingAndSortingRepository;
4 4
 import org.springframework.data.rest.core.annotation.RepositoryRestResource;
5 5
 import org.springframework.stereotype.Repository;
6 6
 
7
+
7 8
 @Repository
8 9
 @RepositoryRestResource(collectionResourceRel = "books", path = "books")
9 10
 public interface BookDAO extends PagingAndSortingRepository<Book, Long> {

+ 2
- 0
src/main/java/com/example/throwupthursday/daos/Person.java ファイルの表示

@@ -5,6 +5,8 @@ import org.springframework.data.annotation.Id;
5 5
 import javax.persistence.Entity;
6 6
 import javax.persistence.*;
7 7
 
8
+// POJO
9
+
8 10
 @Entity
9 11
 public class Person {
10 12
     @javax.persistence.Id

+ 2
- 0
src/main/java/com/example/throwupthursday/daos/PersonDAO.java ファイルの表示

@@ -4,6 +4,8 @@ import org.springframework.data.repository.PagingAndSortingRepository;
4 4
 import org.springframework.data.rest.core.annotation.RepositoryRestResource;
5 5
 import org.springframework.stereotype.Repository;
6 6
 
7
+// DAO Person
8
+
7 9
 @Repository
8 10
 @RepositoryRestResource(collectionResourceRel = "persons", path = "persons")
9 11
 public interface PersonDAO extends PagingAndSortingRepository<Person, Long> {

+ 4
- 0
src/main/resources/application.properties ファイルの表示

@@ -0,0 +1,4 @@
1
+spring.jpa.hibernate.ddl-auto=create
2
+spring.datasource.url=jdbc:mysql://localhost:3306/throwup
3
+spring.datasource.username=kristofer
4
+spring.datasource.password=kristofer