Bladeren bron

fixed merge conflicts

JaseG256 6 jaren geleden
bovenliggende
commit
b5b0e84d4c
27 gewijzigde bestanden met toevoegingen van 397 en 117 verwijderingen
  1. 53
    0
      ZipTeamOrange-ionic-UI/.gitignore
  2. 5
    1
      ZipTeamOrange-ionic-UI/.sourcemaps/main.js.map
  3. 3
    4
      ZipTeamOrange-ionic-UI/ionic.config.json
  4. 1
    1
      ZipTeamOrange-ionic-UI/package.json
  5. 5
    3
      ZipTeamOrange-ionic-UI/src/Classes/Messsage.ts
  6. 7
    4
      ZipTeamOrange-ionic-UI/src/pages/chat/chat.html
  7. 7
    1
      ZipTeamOrange-ionic-UI/src/pages/chat/chat.scss
  8. 24
    14
      ZipTeamOrange-ionic-UI/src/pages/chat/chat.ts
  9. 1
    1
      ZipTeamOrange-ionic-UI/src/pages/firstPage/first.html
  10. 2
    2
      ZipTeamOrange-ionic-UI/src/providers/api-service/api-service.ts
  11. 1
    1
      ZipTeamOrange-ionic-UI/src/providers/auth-service/auth-service.ts
  12. 3
    3
      ZipTeamOrange-ionic-UI/src/providers/message-service/message-service.ts
  13. 2
    2
      ZipTeamOrange-ionic-UI/www/build/0.js
  14. 2
    2
      ZipTeamOrange-ionic-UI/www/build/1.js
  15. 8
    0
      ZipTeamOrange-ionic-UI/www/build/main.css
  16. 107
    70
      ZipTeamOrange-ionic-UI/www/build/main.js
  17. 5
    1
      ZipTeamOrange-ionic-UI/www/build/main.js.map
  18. 5
    1
      ZipTeamOrange-ionic-UI/www/build/vendor.js.map
  19. BIN
      ZipTeamOrange-server/Favicon.ico
  20. 13
    3
      ZipTeamOrange-server/pom.xml
  21. 1
    1
      ZipTeamOrange-server/src/main/java/ZipTeamOrange/Controller/MessageController.java
  22. 1
    1
      ZipTeamOrange-server/src/main/java/ZipTeamOrange/Controller/UserController.java
  23. 19
    0
      ZipTeamOrange-server/src/main/java/ZipTeamOrange/DatabaseConfig.java
  24. 21
    0
      ZipTeamOrange-server/src/main/java/ZipTeamOrange/Root.java
  25. 71
    0
      ZipTeamOrange-server/src/main/java/ZipTeamOrange/user/User.java
  26. 23
    1
      ZipTeamOrange-server/src/main/resources/application.properties
  27. 7
    0
      ZipTeamOrange-server/src/main/resources/applicationOne.properties

+ 53
- 0
ZipTeamOrange-ionic-UI/.gitignore Bestand weergeven

@@ -0,0 +1,53 @@
1
+*~
2
+*.sw[mnpcod]
3
+*.log
4
+*.lock
5
+*.tmp
6
+*.tmp.*
7
+log.txt
8
+*.sublime-project
9
+*.sublime-workspace
10
+
11
+.idea/
12
+.vscode/
13
+.sass-cache/
14
+.versions/
15
+coverage/
16
+collection/
17
+dist/
18
+node_modules/
19
+tmp/
20
+temp/
21
+core/theme-builder/
22
+core/test-components/
23
+core/css/
24
+angular/css/
25
+$RECYCLE.BIN/
26
+
27
+.DS_Store
28
+Thumbs.db
29
+UserInterfaceState.xcuserstate
30
+.env
31
+
32
+.package.tmp.json
33
+
34
+src/themes/version.scss
35
+scripts/e2e/webpackEntryPoints.json
36
+scripts/build/e2e-generated-tsconfig.json
37
+*.css.ts
38
+
39
+stats.json
40
+
41
+# demo stuff
42
+demos/node_modules
43
+demos/polyfills
44
+demos/css
45
+demos/fonts
46
+demos/src/**/*.js
47
+demos/src/**/*.map
48
+demos/src/**/*.ngfactory.ts
49
+demos/src/**/*.d.ts
50
+demos/src/**/*.metadata.json
51
+demos/src/**/*.css.shim.ts
52
+core/css/
53
+angular/css/

+ 5
- 1
ZipTeamOrange-ionic-UI/.sourcemaps/main.js.map
Diff onderdrukt omdat het te groot bestand
Bestand weergeven


+ 3
- 4
ZipTeamOrange-ionic-UI/ionic.config.json Bestand weergeven

@@ -1,8 +1,7 @@
1 1
 {
2 2
   "name": "ionic-ZipTeamOrange",
3
-  "app_id": "",
4
-  "type": "ionic-angular",
5 3
   "integrations": {
6 4
     "cordova": {}
7
-  }
8
-}
5
+  },
6
+  "type": "ionic-angular"
7
+}

+ 1
- 1
ZipTeamOrange-ionic-UI/package.json Bestand weergeven

@@ -34,7 +34,7 @@
34 34
     "zone.js": "0.8.26"
35 35
   },
36 36
   "devDependencies": {
37
-    "@ionic/app-scripts": "3.1.10",
37
+    "@ionic/app-scripts": "^3.1.10",
38 38
     "typescript": "~2.6.2"
39 39
   },
40 40
   "description": "An Ionic project"

+ 5
- 3
ZipTeamOrange-ionic-UI/src/Classes/Messsage.ts Bestand weergeven

@@ -1,9 +1,11 @@
1 1
 import { Chat } from "./Chat";
2 2
 import { User } from "./user";
3 3
 
4
-export class Message{
5
-    id: number;
6
-    message: String;
4
+export class Message {
5
+    private id: number;
6
+    private message: String;
7 7
     private chat: Chat;
8 8
     private user: User;
9
+    private username: String;
10
+    private timestamp: Date;
9 11
 }

+ 7
- 4
ZipTeamOrange-ionic-UI/src/pages/chat/chat.html Bestand weergeven

@@ -14,12 +14,15 @@
14 14
 <!-- *ngFor="let m of msg">{{ m }} -->
15 15
 
16 16
 <ion-content padding >
17
-  <div *ngFor="let m of msg">
18
-    {{ m.message }}
17
+  <div *ngFor="let m of msg" class="message-wrapper">
18
+    <div class="name">
19
+      <b>{{m.username}}Nhu</b> <span class="timestamp"><small>{{m.timestamp}}8:40</small></span> <div class="message">{{m.message}}</div>  
20
+      <p></p>    
21
+    </div>
19 22
   </div>
20 23
 
21 24
   <form  #test1="ngForm" ng-submit="send(test1.value)">
22
-    <ion-textarea  type="text" name="message" [(ngModel)]="test" ></ion-textarea>
23
-    <button ion-button (click)="send(test1.value)"(click)="getMessages()">send</button>
25
+    <ion-textarea  type="text" name="message" [(ngModel)]="test" class="user-message"></ion-textarea>
26
+    <button ion-button (click)="send(test1.value)" >send</button>
24 27
   </form>
25 28
 </ion-content>

+ 7
- 1
ZipTeamOrange-ionic-UI/src/pages/chat/chat.scss Bestand weergeven

@@ -1,3 +1,9 @@
1 1
 page-chat {
2
-
2
+    .user-message {
3
+        border: 1px solid #CCC;
4
+    }
5
+    .username {
6
+        font-style: bold
7
+    }
8
+    
3 9
 }

+ 24
- 14
ZipTeamOrange-ionic-UI/src/pages/chat/chat.ts Bestand weergeven

@@ -1,15 +1,13 @@
1
-import { Component } from '@angular/core';
1
+import { Component, OnInit, Input } from '@angular/core';
2 2
 import { IonicPage, NavController, NavParams } from 'ionic-angular';
3 3
 import { NgForm } from '../../../node_modules/@angular/forms';
4 4
 import { MessageServiceProvider } from '../../providers/message-service/message-service';
5 5
 import { Message } from '../../../node_modules/@angular/compiler/src/i18n/i18n_ast';
6
+// import {OnInit} from '@angular/core';
7
+// import { interval } from '../../../node_modules/rxjs/observable/interval';
8
+// import { startWith } from '../../../node_modules/rxjs/operators';
9
+// import { switchMap } from '../../../node_modules/rxjs/operator/switchMap';
6 10
 
7
-/**
8
- * Generated class for the ChatPage page.
9
- *
10
- * See https://ionicframework.com/docs/components/#navigation for more info on
11
- * Ionic pages and navigation.
12
- */
13 11
 
14 12
 @IonicPage()
15 13
 @Component({
@@ -19,28 +17,40 @@ import { Message } from '../../../node_modules/@angular/compiler/src/i18n/i18n_a
19 17
 export class ChatPage {
20 18
   test: any;
21 19
   msg: any;
20
+  @Input()
22 21
   messages: Message [];
22
+  mApi: any;
23
+
23 24
   constructor(public navCtrl: NavController, public navParams: NavParams, public messageApi: MessageServiceProvider) {
25
+  this.mApi = messageApi;
24 26
   }
25 27
 
26 28
   ionViewDidLoad() {
27 29
     console.log('ionViewDidLoad ChatPage');
28
-    this.getMessages();
30
+    this.getMessages(this);
29 31
   }
30 32
 
31 33
   send(createAccountInfo: NgForm){
32 34
     console.log("clicked");
33 35
     console.log(createAccountInfo)
34 36
     this.messageApi.saveMessage(createAccountInfo).subscribe(console.log);
35
-    this.getMessages()
37
+    this.test = '';
38
+    this.getMessages(this);
36 39
   }
37 40
 
38
-  getMessages(){
39
-    this.messageApi.getMessages().subscribe(data => {
40
-      this.msg = data
41
-      console.log(data)
41
+  getMessages(chatPage){
42
+    chatPage.messageApi.getMessages().subscribe(data => {
43
+      this.msg = data;
44
+      console.log(this.msg);
42 45
     });
43
-    this.test = this.messageApi.getCurrentMessage();
46
+ }
47
+
48
+  ngOnInit() {
49
+    setInterval(() => {this.getMessages(this)}, 500);
44 50
   }
45 51
 
52
+
53
+
54
+
55
+
46 56
 }

+ 1
- 1
ZipTeamOrange-ionic-UI/src/pages/firstPage/first.html Bestand weergeven

@@ -39,7 +39,7 @@
39 39
     </form>
40 40
     <ion-row>
41 41
       <ion-col color="secondary">
42
-        <button ion-button class="register-btn" block clear (click)="createAccount()">Create Account</button>
42
+        <button ion-button class="register-btn" block clear (click)="createAccount(registerForm)">Create Account</button>
43 43
       </ion-col>
44 44
     </ion-row>
45 45
   </div>

+ 2
- 2
ZipTeamOrange-ionic-UI/src/providers/api-service/api-service.ts Bestand weergeven

@@ -16,12 +16,12 @@ export class ApiServiceProvider {
16 16
   }
17 17
 
18 18
   getUsers(){
19
-    return this.http.get('http:localhost:8080/users')
19
+    return this.http.get('https://arcane-ridge.herokuapp.com/users')
20 20
   }
21 21
 
22 22
   save(createAccountInfo: any) : Observable<Object> {
23 23
     //return this.http.post(`http://localhost:8080/ZipTeamOrange/add?username=${createAccountInfo.name}&email=${createAccountInfo.email}&password=${createAccountInfo.password}`, {})
24
-    return this.http.post(`http://localhost:8080/user/add`, createAccountInfo);
24
+    return this.http.post(`https://arcane-ridge.herokuapp.com/user/add`, createAccountInfo);
25 25
   }
26 26
 
27 27
 }

+ 1
- 1
ZipTeamOrange-ionic-UI/src/providers/auth-service/auth-service.ts Bestand weergeven

@@ -19,7 +19,7 @@ export class AuthServiceProvider {
19 19
   postData(createAccountInfo: any){
20 20
     return new Promise((resolve, reject) => {
21 21
 
22
-      this.http.post(`http://localhost:8080/user/add`, createAccountInfo, {responseType: 'text'}).subscribe((res: any) => {
22
+      this.http.post(`https://arcane-ridge.herokuapp.com/api/auth/signup`, createAccountInfo, {responseType: 'text'}).subscribe((res: any) => {
23 23
       console.log(JSON.parse(res))
24 24
       resolve(JSON.parse(res));
25 25
       }, (err) => {

+ 3
- 3
ZipTeamOrange-ionic-UI/src/providers/message-service/message-service.ts Bestand weergeven

@@ -18,7 +18,7 @@ export class MessageServiceProvider {
18 18
   }
19 19
 
20 20
   getMessages(){
21
-    return this.http.get('http://localhost:8080/message/all');
21
+    return this.http.get('https://arcane-ridge.herokuapp.com//message/all');
22 22
   }
23 23
 
24 24
   getCurrentMessage(){
@@ -26,7 +26,7 @@ export class MessageServiceProvider {
26 26
   }
27 27
 
28 28
   saveMessage(createAccountInfo: any) : Observable<Object> {
29
-    return this.http.post(`http://localhost:8080/message/add`, createAccountInfo);
29
+    return this.http.post('https://arcane-ridge.herokuapp.com//message/add', createAccountInfo);
30 30
   }
31 31
 
32
-}
32
+}

+ 2
- 2
ZipTeamOrange-ionic-UI/www/build/0.js Bestand weergeven

@@ -1,6 +1,6 @@
1 1
 webpackJsonp([0],{
2 2
 
3
-/***/ 286:
3
+/***/ 285:
4 4
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
5 5
 
6 6
 "use strict";
@@ -8,7 +8,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
8 8
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SignUpPageModule", function() { return SignUpPageModule; });
9 9
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
10 10
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(20);
11
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__sign_up__ = __webpack_require__(103);
11
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__sign_up__ = __webpack_require__(102);
12 12
 var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
13 13
     var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
14 14
     if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);

+ 2
- 2
ZipTeamOrange-ionic-UI/www/build/1.js Bestand weergeven

@@ -1,6 +1,6 @@
1 1
 webpackJsonp([1],{
2 2
 
3
-/***/ 285:
3
+/***/ 286:
4 4
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
5 5
 
6 6
 "use strict";
@@ -8,7 +8,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
8 8
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FirstPageModule", function() { return FirstPageModule; });
9 9
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
10 10
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(20);
11
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__first__ = __webpack_require__(102);
11
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__first__ = __webpack_require__(103);
12 12
 var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
13 13
     var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
14 14
     if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);

+ 8
- 0
ZipTeamOrange-ionic-UI/www/build/main.css Bestand weergeven

@@ -25677,3 +25677,11 @@ ion-navbar.toolbar {
25677 25677
   min-height: calc(46px + constant(safe-area-inset-bottom));
25678 25678
   min-height: calc(46px + env(safe-area-inset-bottom));
25679 25679
 }
25680
+
25681
+page-chat .user-message {
25682
+  border: 1px solid #CCC;
25683
+}
25684
+
25685
+page-chat .username {
25686
+  font-style: bold;
25687
+}

+ 107
- 70
ZipTeamOrange-ionic-UI/www/build/main.js Bestand weergeven

@@ -20,39 +20,50 @@ var __metadata = (this && this.__metadata) || function (k, v) {
20 20
 
21 21
 
22 22
 
23
-/**
24
- * Generated class for the ChatPage page.
25
- *
26
- * See https://ionicframework.com/docs/components/#navigation for more info on
27
- * Ionic pages and navigation.
28
- */
23
+// import {OnInit} from '@angular/core';
24
+// import { interval } from '../../../node_modules/rxjs/observable/interval';
25
+// import { startWith } from '../../../node_modules/rxjs/operators';
26
+// import { switchMap } from '../../../node_modules/rxjs/operator/switchMap';
29 27
 var ChatPage = /** @class */ (function () {
30 28
     function ChatPage(navCtrl, navParams, messageApi) {
31 29
         this.navCtrl = navCtrl;
32 30
         this.navParams = navParams;
33 31
         this.messageApi = messageApi;
32
+        this.mApi = messageApi;
34 33
     }
35 34
     ChatPage.prototype.ionViewDidLoad = function () {
36 35
         console.log('ionViewDidLoad ChatPage');
37
-        this.getMessages();
36
+        this.getMessages(this);
38 37
     };
39 38
     ChatPage.prototype.send = function (createAccountInfo) {
40 39
         console.log("clicked");
41 40
         console.log(createAccountInfo);
42 41
         this.messageApi.saveMessage(createAccountInfo).subscribe(console.log);
43
-        this.getMessages();
42
+        this.test = '';
43
+        this.getMessages(this);
44 44
     };
45
-    ChatPage.prototype.getMessages = function () {
45
+    ChatPage.prototype.getMessages = function (chatPage) {
46 46
         var _this = this;
47
-        this.messageApi.getMessages().subscribe(function (data) {
47
+        chatPage.messageApi.getMessages().subscribe(function (data) {
48 48
             _this.msg = data;
49
-            console.log(data);
49
+            console.log(_this.msg);
50 50
         });
51
-        this.test = this.messageApi.getCurrentMessage();
52 51
     };
52
+    ChatPage.prototype.ngOnInit = function () {
53
+        var _this = this;
54
+        setInterval(function () { _this.getMessages(_this); }, 500);
55
+    };
56
+    __decorate([
57
+        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */])(),
58
+        __metadata("design:type", Array)
59
+    ], ChatPage.prototype, "messages", void 0);
53 60
     ChatPage = __decorate([
54 61
         Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({
62
+<<<<<<< HEAD
55 63
             selector: 'page-chat',template:/*ion-inline-start:"/Users/jasong/Labs/ZipTeam/ZipTeamOrange-ionic-UI/src/pages/chat/chat.html"*/'<!--\n  Generated template for the ChatPage page.\n\n  See http://ionicframework.com/docs/components/#navigation for more info on\n  Ionic pages and navigation.\n-->\n<ion-header>\n\n  <ion-navbar>\n    <ion-title>chatPage</ion-title>\n  </ion-navbar>\n\n</ion-header>\n<!-- *ngFor="let m of msg">{{ m }} -->\n\n<ion-content padding >\n  <div *ngFor="let m of msg">\n    {{ m.message }}\n  </div>\n\n  <form  #test1="ngForm" ng-submit="send(test1.value)">\n    <ion-textarea  type="text" name="message" [(ngModel)]="test" ></ion-textarea>\n    <button ion-button (click)="send(test1.value)"(click)="getMessages()">send</button>\n  </form>\n</ion-content>\n'/*ion-inline-end:"/Users/jasong/Labs/ZipTeam/ZipTeamOrange-ionic-UI/src/pages/chat/chat.html"*/,
64
+=======
65
+            selector: 'page-chat',template:/*ion-inline-start:"/Users/alizalang/Desktop/ZipTeam/ZipTeamOrange-ionic-UI/src/pages/chat/chat.html"*/'<!--\n  Generated template for the ChatPage page.\n\n  See http://ionicframework.com/docs/components/#navigation for more info on\n  Ionic pages and navigation.\n-->\n<ion-header>\n\n  <ion-navbar>\n    <ion-title>chatPage</ion-title>\n  </ion-navbar>\n\n</ion-header>\n<!-- *ngFor="let m of msg">{{ m }} -->\n\n<ion-content padding >\n  <div *ngFor="let m of msg" class="message-wrapper">\n    <div class="name">\n      <b>{{m.username}}Nhu</b> <span class="timestamp"><small>{{m.timestamp}}8:40</small></span> <div class="message">{{m.message}}</div>  \n      <p></p>    \n    </div>\n  </div>\n\n  <form  #test1="ngForm" ng-submit="send(test1.value)">\n    <ion-textarea  type="text" name="message" [(ngModel)]="test" class="user-message"></ion-textarea>\n    <button ion-button (click)="send(test1.value)" >send</button>\n  </form>\n</ion-content>\n'/*ion-inline-end:"/Users/alizalang/Desktop/ZipTeam/ZipTeamOrange-ionic-UI/src/pages/chat/chat.html"*/,
66
+>>>>>>> e9af7a6a8011fcb914952fcfb97bc9d9550b2637
56 67
         }),
57 68
         __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["e" /* NavController */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["f" /* NavParams */], __WEBPACK_IMPORTED_MODULE_2__providers_message_service_message_service__["a" /* MessageServiceProvider */]])
58 69
     ], ChatPage);
@@ -67,12 +78,10 @@ var ChatPage = /** @class */ (function () {
67 78
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
68 79
 
69 80
 "use strict";
70
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FirstPage; });
81
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SignUpPage; });
71 82
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
72 83
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(20);
73
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__sign_up_sign_up__ = __webpack_require__(103);
74
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__providers_auth_service_auth_service__ = __webpack_require__(159);
75
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__chat_chat__ = __webpack_require__(101);
84
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__providers_api_service_api_service__ = __webpack_require__(158);
76 85
 var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
77 86
     var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
78 87
     if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -85,20 +94,22 @@ var __metadata = (this && this.__metadata) || function (k, v) {
85 94
 
86 95
 
87 96
 
88
-
89
-
97
+"";
90 98
 /**
91
- * Generated class for the FirstPage page.
99
+ * Generated class for the SignUpPage page.
92 100
  *
93 101
  * See https://ionicframework.com/docs/components/#navigation for more info on
94 102
  * Ionic pages and navigation.
95 103
  */
96
-var FirstPage = /** @class */ (function () {
97
-    function FirstPage(navCtrl, navParams, authService) {
104
+var SignUpPage = /** @class */ (function () {
105
+    function SignUpPage(navCtrl, navParams, apiProvider, toastCtrl) {
98 106
         this.navCtrl = navCtrl;
99 107
         this.navParams = navParams;
100
-        this.authService = authService;
108
+        this.apiProvider = apiProvider;
109
+        this.toastCtrl = toastCtrl;
110
+        this.user = {};
101 111
     }
112
+<<<<<<< HEAD
102 113
     FirstPage.prototype.ionViewDidLoad = function () {
103 114
         console.log('ionViewDidLoad FirstPage');
104 115
     };
@@ -114,21 +125,38 @@ var FirstPage = /** @class */ (function () {
114 125
                 console.log("check your info");
115 126
             }
116 127
         }).catch(console.log);
128
+=======
129
+    // ngOnInit(){
130
+    //   this.loadUsers();
131
+    // }
132
+    // loadUsers(){
133
+    //   this.apiProvider.getUsers().subscribe(data => this.user =data["_embedded"]["users"],
134
+    // err => {
135
+    //   console.log(err);
136
+    // });
137
+    // }
138
+    SignUpPage.prototype.ionViewDidLoad = function () {
139
+        console.log('ionViewDidLoad SignUpPage');
140
+>>>>>>> e9af7a6a8011fcb914952fcfb97bc9d9550b2637
117 141
     };
118
-    FirstPage.prototype.createAccount = function () {
119
-        this.navCtrl.push(__WEBPACK_IMPORTED_MODULE_2__sign_up_sign_up__["a" /* SignUpPage */]);
120
-        console.log("clicked");
142
+    SignUpPage.prototype.save = function (createAccountInfo) {
143
+        //  console.log(createAccountInfo)
144
+        this.apiProvider.save(createAccountInfo).subscribe(console.log);
121 145
     };
122
-    FirstPage = __decorate([
146
+    SignUpPage = __decorate([
123 147
         Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({
148
+<<<<<<< HEAD
124 149
             selector: 'page-first',template:/*ion-inline-start:"/Users/jasong/Labs/ZipTeam/ZipTeamOrange-ionic-UI/src/pages/firstPage/first.html"*/'<!--\n  Generated template for the FirstPage page.\n\n  See http://ionicframework.com/docs/components/#navigation for more info on\n  Ionic pages and navigation.\n-->\n<ion-header>\n  <ion-navbar color="primary">\n    <button menuToggle ion- button icon-only>\n      <ion-icon name ="menu"></ion-icon>\n    </button>\n    <ion-title text-center>ZipTeamOrange</ion-title>\n  </ion-navbar>\n\n</ion-header>\n\n\n<ion-content padding>\n  <h4>Welcome to this page</h4>\n  <div class="login-box">\n    <form #registerForm="ngForm" ng-submit="loginButton(registerForm.value)" >\n      <ion-row>\n        <ion-col>\n          <ion-list inset>\n            <ion-item>\n              <ion-input type="text" placeholder="Username" name="userName" required [(ngModel)]="Username" ></ion-input>\n            </ion-item>\n            <ion-item>\n              <ion-input type="password" placeholder="Password" name="password" required [(ngModel)]="password"></ion-input>\n            </ion-item>\n          </ion-list>\n        </ion-col>\n      </ion-row>\n      <ion-row>\n        <ion-col class="signup-col">\n          <button ion-button class="submit-btn" full type="submit" [disabled]="!registerForm.form.valid" (click)="loginButton(registerForm.value)">Login</button>\n        </ion-col>\n      </ion-row>\n    </form>\n    <ion-row>\n      <ion-col color="secondary">\n        <button ion-button class="register-btn" block clear (click)="createAccount()">Create Account</button>\n      </ion-col>\n    </ion-row>\n  </div>\n  \n</ion-content>'/*ion-inline-end:"/Users/jasong/Labs/ZipTeam/ZipTeamOrange-ionic-UI/src/pages/firstPage/first.html"*/,
150
+=======
151
+            selector: 'page-sign-up',template:/*ion-inline-start:"/Users/alizalang/Desktop/ZipTeam/ZipTeamOrange-ionic-UI/src/pages/sign-up/sign-up.html"*/'<!--\n  Generated template for the SignUpPage page.\n\n  See http://ionicframework.com/docs/components/#navigation for more info on\n  Ionic pages and navigation.\n-->\n<ion-header>\n\n    <ion-navbar color="primary">\n      <ion-title>sign-up</ion-title>\n    </ion-navbar>\n  \n  </ion-header>\n  \n  \n  <ion-content padding>\n      <div class="signUp-box">\n      <form #registerForm="ngForm" ng-submit="save(registerForm.value)">\n        <ion-row>\n          <ion-col>\n            <ion-list inset>\n              <ion-item>\n                <ion-input type="text" placeholder="Username" name="userName" required [(ngModel)]="Username" ></ion-input>\n              </ion-item>\n              <ion-item>\n                  <ion-input type="text" placeholder="Email" name="email" required [(ngModel)]="Email" ></ion-input>\n                </ion-item>\n              <ion-item>\n                <ion-input type="password" placeholder="Password" name="password" required [(ngModel)]="password"></ion-input>\n              </ion-item>\n            </ion-list>\n          </ion-col>\n        </ion-row>\n        <ion-row>\n          <ion-col class="signup-col">\n            <button ion-button class="submit-btn" full type="submit" (click)="save(registerForm.value)" [disabled]="!registerForm.form.valid">Create Account</button>\n          </ion-col>\n        </ion-row>\n      </form>\n    \n    </div>\n  \n  </ion-content>\n  \n'/*ion-inline-end:"/Users/alizalang/Desktop/ZipTeam/ZipTeamOrange-ionic-UI/src/pages/sign-up/sign-up.html"*/,
152
+>>>>>>> e9af7a6a8011fcb914952fcfb97bc9d9550b2637
125 153
         }),
126
-        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["e" /* NavController */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["f" /* NavParams */], __WEBPACK_IMPORTED_MODULE_3__providers_auth_service_auth_service__["a" /* AuthServiceProvider */]])
127
-    ], FirstPage);
128
-    return FirstPage;
154
+        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["e" /* NavController */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["f" /* NavParams */], __WEBPACK_IMPORTED_MODULE_2__providers_api_service_api_service__["a" /* ApiServiceProvider */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* ToastController */]])
155
+    ], SignUpPage);
156
+    return SignUpPage;
129 157
 }());
130 158
 
131
-//# sourceMappingURL=first.js.map
159
+//# sourceMappingURL=sign-up.js.map
132 160
 
133 161
 /***/ }),
134 162
 
@@ -136,10 +164,12 @@ var FirstPage = /** @class */ (function () {
136 164
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
137 165
 
138 166
 "use strict";
139
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SignUpPage; });
167
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FirstPage; });
140 168
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
141 169
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(20);
142
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__providers_api_service_api_service__ = __webpack_require__(158);
170
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__sign_up_sign_up__ = __webpack_require__(102);
171
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__providers_auth_service_auth_service__ = __webpack_require__(159);
172
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__chat_chat__ = __webpack_require__(101);
143 173
 var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
144 174
     var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
145 175
     if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -152,47 +182,54 @@ var __metadata = (this && this.__metadata) || function (k, v) {
152 182
 
153 183
 
154 184
 
155
-"";
185
+
186
+
156 187
 /**
157
- * Generated class for the SignUpPage page.
188
+ * Generated class for the FirstPage page.
158 189
  *
159 190
  * See https://ionicframework.com/docs/components/#navigation for more info on
160 191
  * Ionic pages and navigation.
161 192
  */
162
-var SignUpPage = /** @class */ (function () {
163
-    function SignUpPage(navCtrl, navParams, apiProvider, toastCtrl) {
193
+var FirstPage = /** @class */ (function () {
194
+    function FirstPage(navCtrl, navParams, authService) {
164 195
         this.navCtrl = navCtrl;
165 196
         this.navParams = navParams;
166
-        this.apiProvider = apiProvider;
167
-        this.toastCtrl = toastCtrl;
168
-        this.user = {};
197
+        this.authService = authService;
169 198
     }
170
-    // ngOnInit(){
171
-    //   this.loadUsers();
172
-    // }
173
-    // loadUsers(){
174
-    //   this.apiProvider.getUsers().subscribe(data => this.user =data["_embedded"]["users"],
175
-    // err => {
176
-    //   console.log(err);
177
-    // });
178
-    // }
179
-    SignUpPage.prototype.ionViewDidLoad = function () {
180
-        console.log('ionViewDidLoad SignUpPage');
199
+    FirstPage.prototype.ionViewDidLoad = function () {
200
+        console.log('ionViewDidLoad FirstPage');
181 201
     };
182
-    SignUpPage.prototype.save = function (createAccountInfo) {
183
-        //  console.log(createAccountInfo)
184
-        this.apiProvider.save(createAccountInfo).subscribe(console.log);
202
+    FirstPage.prototype.loginButton = function (createAccountInfo) {
203
+        var _this = this;
204
+        this.authService.postData(createAccountInfo).then(function (result) {
205
+            _this.responseData = result;
206
+            console.log(createAccountInfo);
207
+            if (!_this.responseData.createAccountInfo) {
208
+                _this.navCtrl.push(__WEBPACK_IMPORTED_MODULE_4__chat_chat__["a" /* ChatPage */]);
209
+            }
210
+            else {
211
+                console.log("check your info");
212
+            }
213
+        }).catch(console.log);
185 214
     };
186
-    SignUpPage = __decorate([
215
+    FirstPage.prototype.createAccount = function () {
216
+        this.navCtrl.push(__WEBPACK_IMPORTED_MODULE_2__sign_up_sign_up__["a" /* SignUpPage */]);
217
+        console.log("clicked");
218
+    };
219
+    FirstPage = __decorate([
187 220
         Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({
221
+<<<<<<< HEAD
188 222
             selector: 'page-sign-up',template:/*ion-inline-start:"/Users/jasong/Labs/ZipTeam/ZipTeamOrange-ionic-UI/src/pages/sign-up/sign-up.html"*/'<!--\n  Generated template for the SignUpPage page.\n\n  See http://ionicframework.com/docs/components/#navigation for more info on\n  Ionic pages and navigation.\n-->\n<ion-header>\n\n    <ion-navbar color="primary">\n      <ion-title>sign-up</ion-title>\n    </ion-navbar>\n  \n  </ion-header>\n  \n  \n  <ion-content padding>\n      <div class="signUp-box">\n      <form #registerForm="ngForm" ng-submit="save(registerForm.value)">\n        <ion-row>\n          <ion-col>\n            <ion-list inset>\n              <ion-item>\n                <ion-input type="text" placeholder="Username" name="userName" required [(ngModel)]="Username" ></ion-input>\n              </ion-item>\n              <ion-item>\n                  <ion-input type="text" placeholder="Email" name="email" required [(ngModel)]="Email" ></ion-input>\n                </ion-item>\n              <ion-item>\n                <ion-input type="password" placeholder="Password" name="password" required [(ngModel)]="password"></ion-input>\n              </ion-item>\n            </ion-list>\n          </ion-col>\n        </ion-row>\n        <ion-row>\n          <ion-col class="signup-col">\n            <button ion-button class="submit-btn" full type="submit" (click)="save(registerForm.value)" [disabled]="!registerForm.form.valid">Create Account</button>\n          </ion-col>\n        </ion-row>\n      </form>\n    \n    </div>\n  \n  </ion-content>\n  \n'/*ion-inline-end:"/Users/jasong/Labs/ZipTeam/ZipTeamOrange-ionic-UI/src/pages/sign-up/sign-up.html"*/,
223
+=======
224
+            selector: 'page-first',template:/*ion-inline-start:"/Users/alizalang/Desktop/ZipTeam/ZipTeamOrange-ionic-UI/src/pages/firstPage/first.html"*/'<!--\n  Generated template for the FirstPage page.\n\n  See http://ionicframework.com/docs/components/#navigation for more info on\n  Ionic pages and navigation.\n-->\n<ion-header>\n  <ion-navbar color="primary">\n    <button menuToggle ion- button icon-only>\n      <ion-icon name ="menu"></ion-icon>\n    </button>\n    <ion-title text-center>ZipTeamOrange</ion-title>\n  </ion-navbar>\n\n</ion-header>\n\n\n<ion-content padding>\n  <h4>Welcome to this page</h4>\n  <div class="login-box">\n    <form #registerForm="ngForm" ng-submit="loginButton(registerForm.value)" >\n      <ion-row>\n        <ion-col>\n          <ion-list inset>\n            <ion-item>\n              <ion-input type="text" placeholder="Username" name="userName" required [(ngModel)]="Username" ></ion-input>\n            </ion-item>\n            <ion-item>\n              <ion-input type="password" placeholder="Password" name="password" required [(ngModel)]="password"></ion-input>\n            </ion-item>\n          </ion-list>\n        </ion-col>\n      </ion-row>\n      <ion-row>\n        <ion-col class="signup-col">\n          <button ion-button class="submit-btn" full type="submit" [disabled]="!registerForm.form.valid" (click)="loginButton(registerForm.value)">Login</button>\n        </ion-col>\n      </ion-row>\n    </form>\n    <ion-row>\n      <ion-col color="secondary">\n        <button ion-button class="register-btn" block clear (click)="createAccount()">Create Account</button>\n      </ion-col>\n    </ion-row>\n  </div>\n  \n</ion-content>'/*ion-inline-end:"/Users/alizalang/Desktop/ZipTeam/ZipTeamOrange-ionic-UI/src/pages/firstPage/first.html"*/,
225
+>>>>>>> e9af7a6a8011fcb914952fcfb97bc9d9550b2637
189 226
         }),
190
-        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["e" /* NavController */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["f" /* NavParams */], __WEBPACK_IMPORTED_MODULE_2__providers_api_service_api_service__["a" /* ApiServiceProvider */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* ToastController */]])
191
-    ], SignUpPage);
192
-    return SignUpPage;
227
+        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["e" /* NavController */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["f" /* NavParams */], __WEBPACK_IMPORTED_MODULE_3__providers_auth_service_auth_service__["a" /* AuthServiceProvider */]])
228
+    ], FirstPage);
229
+    return FirstPage;
193 230
 }());
194 231
 
195
-//# sourceMappingURL=sign-up.js.map
232
+//# sourceMappingURL=first.js.map
196 233
 
197 234
 /***/ }),
198 235
 
@@ -222,11 +259,11 @@ var map = {
222 259
 		2
223 260
 	],
224 261
 	"../pages/firstPage/first.module": [
225
-		285,
262
+		286,
226 263
 		1
227 264
 	],
228 265
 	"../pages/sign-up/sign-up.module": [
229
-		286,
266
+		285,
230 267
 		0
231 268
 	]
232 269
 };
@@ -277,13 +314,13 @@ var MessageServiceProvider = /** @class */ (function () {
277 314
         console.log('Hello MessageServiceProvider Provider');
278 315
     }
279 316
     MessageServiceProvider.prototype.getMessages = function () {
280
-        return this.http.get('http://localhost:8080/message/all');
317
+        return this.http.get('https://arcane-ridge.herokuapp.com//message/all');
281 318
     };
282 319
     MessageServiceProvider.prototype.getCurrentMessage = function () {
283 320
         return this.messages;
284 321
     };
285 322
     MessageServiceProvider.prototype.saveMessage = function (createAccountInfo) {
286
-        return this.http.post("http://localhost:8080/message/add", createAccountInfo);
323
+        return this.http.post('https://arcane-ridge.herokuapp.com//message/add', createAccountInfo);
287 324
     };
288 325
     MessageServiceProvider = __decorate([
289 326
         Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["A" /* Injectable */])(),
@@ -326,11 +363,11 @@ var ApiServiceProvider = /** @class */ (function () {
326 363
         console.log('Hello ApiServiceProvider Provider');
327 364
     }
328 365
     ApiServiceProvider.prototype.getUsers = function () {
329
-        return this.http.get('http:localhost:8080/users');
366
+        return this.http.get('https://arcane-ridge.herokuapp.com/users');
330 367
     };
331 368
     ApiServiceProvider.prototype.save = function (createAccountInfo) {
332 369
         //return this.http.post(`http://localhost:8080/ZipTeamOrange/add?username=${createAccountInfo.name}&email=${createAccountInfo.email}&password=${createAccountInfo.password}`, {})
333
-        return this.http.post("http://localhost:8080/user/add", createAccountInfo);
370
+        return this.http.post("https://arcane-ridge.herokuapp.com/user/add", createAccountInfo);
334 371
     };
335 372
     ApiServiceProvider = __decorate([
336 373
         Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["A" /* Injectable */])(),
@@ -378,7 +415,7 @@ var AuthServiceProvider = /** @class */ (function () {
378 415
     AuthServiceProvider.prototype.postData = function (createAccountInfo) {
379 416
         var _this = this;
380 417
         return new Promise(function (resolve, reject) {
381
-            _this.http.post("http://localhost:8080/user/add", createAccountInfo, { responseType: 'text' }).subscribe(function (res) {
418
+            _this.http.post("https://arcane-ridge.herokuapp.com/user/add", createAccountInfo, { responseType: 'text' }).subscribe(function (res) {
382 419
                 console.log(JSON.parse(res));
383 420
                 resolve(JSON.parse(res));
384 421
             }, function (err) {
@@ -406,7 +443,7 @@ var AuthServiceProvider = /** @class */ (function () {
406 443
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__about_about__ = __webpack_require__(204);
407 444
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__contact_contact__ = __webpack_require__(205);
408 445
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__home_home__ = __webpack_require__(206);
409
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__firstPage_first__ = __webpack_require__(102);
446
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__firstPage_first__ = __webpack_require__(103);
410 447
 var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
411 448
     var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
412 449
     if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -574,8 +611,8 @@ Object(__WEBPACK_IMPORTED_MODULE_0__angular_platform_browser_dynamic__["a" /* pl
574 611
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__pages_tabs_tabs__ = __webpack_require__(203);
575 612
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__ionic_native_status_bar__ = __webpack_require__(199);
576 613
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__ionic_native_splash_screen__ = __webpack_require__(202);
577
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__pages_firstPage_first__ = __webpack_require__(102);
578
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__pages_sign_up_sign_up__ = __webpack_require__(103);
614
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__pages_firstPage_first__ = __webpack_require__(103);
615
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__pages_sign_up_sign_up__ = __webpack_require__(102);
579 616
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__providers_api_service_api_service__ = __webpack_require__(158);
580 617
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__node_modules_angular_common_http__ = __webpack_require__(46);
581 618
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__providers_auth_service_auth_service__ = __webpack_require__(159);
@@ -625,8 +662,8 @@ var AppModule = /** @class */ (function () {
625 662
                 __WEBPACK_IMPORTED_MODULE_2_ionic_angular__["c" /* IonicModule */].forRoot(__WEBPACK_IMPORTED_MODULE_3__app_component__["a" /* MyApp */], {}, {
626 663
                     links: [
627 664
                         { loadChildren: '../pages/chat/chat.module#ChatPageModule', name: 'ChatPage', segment: 'chat', priority: 'low', defaultHistory: [] },
628
-                        { loadChildren: '../pages/firstPage/first.module#FirstPageModule', name: 'FirstPage', segment: 'first', priority: 'low', defaultHistory: [] },
629
-                        { loadChildren: '../pages/sign-up/sign-up.module#SignUpPageModule', name: 'SignUpPage', segment: 'sign-up', priority: 'low', defaultHistory: [] }
665
+                        { loadChildren: '../pages/sign-up/sign-up.module#SignUpPageModule', name: 'SignUpPage', segment: 'sign-up', priority: 'low', defaultHistory: [] },
666
+                        { loadChildren: '../pages/firstPage/first.module#FirstPageModule', name: 'FirstPage', segment: 'first', priority: 'low', defaultHistory: [] }
630 667
                     ]
631 668
                 })
632 669
             ],

+ 5
- 1
ZipTeamOrange-ionic-UI/www/build/main.js.map
Diff onderdrukt omdat het te groot bestand
Bestand weergeven


+ 5
- 1
ZipTeamOrange-ionic-UI/www/build/vendor.js.map
Diff onderdrukt omdat het te groot bestand
Bestand weergeven


BIN
ZipTeamOrange-server/Favicon.ico Bestand weergeven


+ 13
- 3
ZipTeamOrange-server/pom.xml Bestand weergeven

@@ -60,16 +60,26 @@
60 60
 			<artifactId>spring-boot-devtools</artifactId>
61 61
 			<scope>runtime</scope>
62 62
 		</dependency>
63
+		<!--<dependency>-->
64
+			<!--<groupId>mysql</groupId>-->
65
+			<!--<artifactId>mysql-connector-java</artifactId>-->
66
+			<!--&lt;!&ndash;<scope>runtime</scope>&ndash;&gt;-->
67
+		<!--</dependency>-->
63 68
 		<dependency>
64
-			<groupId>mysql</groupId>
65
-			<artifactId>mysql-connector-java</artifactId>
66
-			<!--<scope>runtime</scope>-->
69
+			<groupId>org.postgresql</groupId>
70
+			<artifactId>postgresql</artifactId>
71
+            <version>42.2.1</version>
67 72
 		</dependency>
68 73
 		<dependency>
69 74
 			<groupId>org.springframework.boot</groupId>
70 75
 			<artifactId>spring-boot-starter-test</artifactId>
71 76
 			<scope>test</scope>
72 77
 		</dependency>
78
+        <dependency>
79
+            <groupId>org.apache.tomcat</groupId>
80
+            <artifactId>tomcat-jdbc</artifactId>
81
+            <version>8.5.31</version>
82
+        </dependency>
73 83
 	</dependencies>
74 84
 
75 85
 	<build>

+ 1
- 1
ZipTeamOrange-server/src/main/java/ZipTeamOrange/Controller/MessageController.java Bestand weergeven

@@ -12,7 +12,7 @@ import javax.annotation.security.RolesAllowed;
12 12
 
13 13
 @RestController
14 14
 @RequestMapping(path = "/message")
15
-@CrossOrigin("http://localhost:8100")
15
+@CrossOrigin
16 16
 public class MessageController {
17 17
     ObjectMapper ob = new ObjectMapper();
18 18
 

+ 1
- 1
ZipTeamOrange-server/src/main/java/ZipTeamOrange/Controller/UserController.java Bestand weergeven

@@ -20,7 +20,7 @@ public class UserController {
20 20
     private UserRepository userRepository;
21 21
 
22 22
     @PostMapping(path="/add")
23
-    @CrossOrigin(origins = {"http://localhost:8100", "http://localhost:8101", "http://localhost:8102"})
23
+    @CrossOrigin(origins = {"https://arcane-ridge.herokuapp.com/", "http://localhost:8100", "http://localhost:8101", "http://localhost:8102"})
24 24
     public @ResponseBody String addNewUser(@RequestBody User user) throws JsonProcessingException {
25 25
         userRepository.save(user);
26 26
         return ob.writeValueAsString(user);

+ 19
- 0
ZipTeamOrange-server/src/main/java/ZipTeamOrange/DatabaseConfig.java Bestand weergeven

@@ -0,0 +1,19 @@
1
+//package ZipTeamOrange;
2
+//
3
+//import org.springframework.boot.context.properties.ConfigurationProperties;
4
+//import org.springframework.boot.jdbc.DataSourceBuilder;
5
+//import org.springframework.context.annotation.Bean;
6
+//import org.springframework.context.annotation.Configuration;
7
+//import org.springframework.context.annotation.Primary;
8
+//
9
+//import javax.sql.DataSource;
10
+//
11
+//@Configuration
12
+//public class DatabaseConfig {
13
+//    @Bean
14
+//    @Primary
15
+//    @ConfigurationProperties(prefix = "spring.datasource")
16
+//    public DataSource dataSource() {
17
+//        return DataSourceBuilder.create().build();
18
+//    }
19
+//}

+ 21
- 0
ZipTeamOrange-server/src/main/java/ZipTeamOrange/Root.java Bestand weergeven

@@ -0,0 +1,21 @@
1
+package ZipTeamOrange;
2
+
3
+
4
+import ZipTeamOrange.user.User;
5
+import org.springframework.stereotype.Controller;
6
+import org.springframework.web.bind.annotation.GetMapping;
7
+import org.springframework.web.bind.annotation.RequestMapping;
8
+import org.springframework.web.bind.annotation.ResponseBody;
9
+
10
+@Controller
11
+//@RequestMapping(path = "/user")
12
+public class Root {
13
+
14
+    @GetMapping(path="/")
15
+    public @ResponseBody
16
+    String sayHello(){
17
+        //this returns a JSON or XML with users
18
+        return "Hello";
19
+    }
20
+
21
+}

+ 71
- 0
ZipTeamOrange-server/src/main/java/ZipTeamOrange/user/User.java Bestand weergeven

@@ -0,0 +1,71 @@
1
+package ZipTeamOrange.user;
2
+
3
+import ZipTeamOrange.chat.Chat;
4
+import ZipTeamOrange.message.Message;
5
+import javax.persistence.*;
6
+import java.util.Set;
7
+
8
+
9
+@Entity
10
+@Table(name="ChatUser")
11
+public class User {
12
+
13
+    @Id
14
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
15
+    private Long id;
16
+    private String userName;
17
+    private String email;
18
+    private String password;
19
+    @OneToMany(mappedBy = "user")
20
+    private Set<Message> messages;
21
+    @ManyToMany
22
+    @JoinTable(
23
+            name = "USER_CHAT",
24
+            joinColumns = { @JoinColumn(name = "user_id") },
25
+            inverseJoinColumns = { @JoinColumn(name = "chat_id") }
26
+    )
27
+    private Set<Chat> chat;
28
+
29
+
30
+    public User() {
31
+    }
32
+
33
+
34
+    public User(String userName, String email, String password) {
35
+        this.userName = userName;
36
+        this.email = email;
37
+        this.password = password;
38
+    }
39
+
40
+    public Long getId() {
41
+        return id;
42
+    }
43
+
44
+    public void setId(Long id) {
45
+        this.id = id;
46
+    }
47
+
48
+    public String getUserName() {
49
+        return userName;
50
+    }
51
+
52
+    public void setUserName(String userName) {
53
+        this.userName = userName;
54
+    }
55
+
56
+    public String getEmail() {
57
+        return email;
58
+    }
59
+
60
+    public void setEmail(String email) {
61
+        this.email = email;
62
+    }
63
+
64
+    public String getPassword() {
65
+        return password;
66
+    }
67
+
68
+    public void setPassword(String password) {
69
+        this.password = password;
70
+    }
71
+}

+ 23
- 1
ZipTeamOrange-server/src/main/resources/application.properties Bestand weergeven

@@ -1,3 +1,4 @@
1
+<<<<<<< HEAD
1 2
 #spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
2 3
 spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
3 4
 spring.jpa.hibernate.ddl-auto=create-drop
@@ -16,4 +17,25 @@ logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
16 17
 
17 18
 ## App Properties
18 19
 app.jwtSecret= JWTSuperSecretKey
19
-app.jwtExpirationInMs = 604800000
20
+app.jwtExpirationInMs = 604800000
21
+=======
22
+#spring.datasource.url= postgres://vanvxvunakzykh:7f9d6108e7c2676b57af5eb672250e42c960147e28ba8786bb45ffa0efb5b866@ec2-75-101-142-91.compute-1.amazonaws.com:5432/d4i371u3ci642k
23
+#spring.datasource.driverClassName=org.postgresql.Driver
24
+#spring.datasource.maxActive=10
25
+#spring.datasource.maxIdle=5
26
+#spring.datasource.minIdle=2
27
+#spring.datasource.initialSize=5
28
+#spring.datasource.removeAbandoned=true
29
+
30
+#spring.datasource.url= ${JDBC_DATABASE_URL}
31
+spring.datasource.url=jdbc:postgresql://localhost:5432/ChadH
32
+spring.datasource.username=
33
+spring.datasource.password=
34
+spring.jpa.hibernate.ddl-auto=create-drop
35
+
36
+# Disable feature detection by this undocumented parameter. Check the org.hibernate.engine.jdbc.internal.JdbcServiceImpl.configure method for more details.
37
+spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults = false
38
+
39
+# Because detection is disabled you have to set correct dialect by hand.
40
+spring.jpa.database-platform=org.hibernate.dialect.PostgreSQL9Dialect
41
+>>>>>>> e9af7a6a8011fcb914952fcfb97bc9d9550b2637

+ 7
- 0
ZipTeamOrange-server/src/main/resources/applicationOne.properties Bestand weergeven

@@ -0,0 +1,7 @@
1
+#spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
2
+spring.jpa.hibernate.ddl-auto=create-drop
3
+spring.datasource.url=jdbc:mysql://localhost:3306/ZipTeamOrange?useSSL=false
4
+spring.datasource.username=root
5
+spring.datasource.password=
6
+logging.level.org.hibernate.SQL=DEBUG
7
+logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE