27 changed files with 534 additions and 88 deletions
Split View
Diff Options
-
4Shopify-Cart/src/main/resources/application.properties
-
6ShopifyUI/proxy.conf.json
-
4ShopifyUI/src/app/app-routing.module.ts
-
22ShopifyUI/src/app/auth/login/login.component.ts
-
4ShopifyUI/src/app/auth/sign-up/sign-up.component.css
-
35ShopifyUI/src/app/auth/sign-up/sign-up.component.html
-
36ShopifyUI/src/app/auth/sign-up/sign-up.component.ts
-
18ShopifyUI/src/app/components/admin/admin.component.css
-
39ShopifyUI/src/app/components/admin/admin.component.html
-
49ShopifyUI/src/app/components/cart/cart.component.html
-
17ShopifyUI/src/app/components/cart/cart.component.ts
-
3ShopifyUI/src/app/components/home/home.component.css
-
23ShopifyUI/src/app/components/home/home.component.html
-
17ShopifyUI/src/app/components/home/home.component.ts
-
49ShopifyUI/src/app/components/payments/payments.component.html
-
16ShopifyUI/src/app/components/payments/payments.component.ts
-
37ShopifyUI/src/app/components/product-detail/product-detail.component.css
-
62ShopifyUI/src/app/components/product-detail/product-detail.component.html
-
61ShopifyUI/src/app/components/product-detail/product-detail.component.ts
-
23ShopifyUI/src/app/components/products/products.component.html
-
18ShopifyUI/src/app/components/products/products.component.ts
-
14ShopifyUI/src/app/model/review.model.ts
-
8ShopifyUI/src/app/model/reviewDto.model.ts
-
4ShopifyUI/src/app/service/cart.service.ts
-
13ShopifyUI/src/app/service/review.service.ts
-
31ShopifyUI/src/app/service/user.service.ts
-
9ShopifyUI/src/styles.css
@ -1,14 +1,14 @@ |
|||
{ |
|||
"/api1": { |
|||
"target": "http://10.3.117.26:8001", |
|||
"target": "http://10.3.117.23:8001", |
|||
"secure": false |
|||
}, |
|||
"/api2": { |
|||
"target": "http://10.3.117.26:8002", |
|||
"target": "http://10.3.117.23:8002", |
|||
"secure": false |
|||
}, |
|||
"/api3": { |
|||
"target": "http://10.3.117.26:8003", |
|||
"target": "http://10.3.117.23:8003", |
|||
"secure": false |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
.admin-heading { |
|||
font-size: 5em; |
|||
font-weight: 700; |
|||
color: #1B4F72; |
|||
} |
|||
|
|||
.card-heading { |
|||
/* font-size: 5em; */ |
|||
font-weight: 500; |
|||
background-color: #1B4F72; |
|||
padding: 12px 16px; |
|||
height: 250px; |
|||
border-radius: 20px; |
|||
} |
|||
|
|||
.card-heading h3 { |
|||
vertical-align: middle; |
|||
} |
|||
@ -1 +1,38 @@ |
|||
<p>admin works!</p> |
|||
<div class="row navbar"> |
|||
<div class="col-10"> |
|||
<h2>Shopify</h2> |
|||
</div> |
|||
<div class="col-1"> |
|||
<a routerLink="/home">Home</a> |
|||
</div> |
|||
<div class="col-1"> |
|||
<a routerLink="/products">Products</a> |
|||
</div> |
|||
</div> |
|||
<br><br><br> |
|||
<div class="row"> |
|||
<div class="col-12 text-center"> |
|||
<p class="admin-heading">Welcome Admin</p> |
|||
</div> |
|||
<div> |
|||
<br><br><br> |
|||
<div class="row text-center m-auto"> |
|||
<div class="col-4"> |
|||
<div class="card card-heading"> |
|||
<br><br> |
|||
<h3>View All Orders</h3> |
|||
</div> |
|||
</div> |
|||
<div class="col-4"> |
|||
<div class="card card-heading"> |
|||
<br><br> |
|||
<h3>View All Products</h3> |
|||
</div> |
|||
</div> |
|||
<div class="col-4"> |
|||
<div class="card card-heading"> |
|||
<br><br> |
|||
<h3>View User Requests</h3> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
@ -1,6 +1,10 @@ |
|||
export class ReviewDto { |
|||
reviewText:string; |
|||
rating:number; |
|||
username:string; |
|||
product_name:string; |
|||
import { Product } from "./product.model"; |
|||
import { User } from "./user.model"; |
|||
|
|||
export class Review { |
|||
id?:number; |
|||
reviewText:string = ''; |
|||
rating:number = 0; |
|||
user?: User |
|||
product?: Product; |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
export class ReviewDto { |
|||
id?: number; |
|||
reviewText:string; |
|||
rating:number; |
|||
userId?:number; |
|||
username:string; |
|||
productName:string; |
|||
} |
|||
@ -1,9 +1,38 @@ |
|||
import { HttpClient, HttpHeaders } from '@angular/common/http'; |
|||
import { Injectable } from '@angular/core'; |
|||
import { Observable } from 'rxjs'; |
|||
import { User } from '../model/user.model'; |
|||
|
|||
@Injectable({ |
|||
providedIn: 'root' |
|||
}) |
|||
export class UserService { |
|||
|
|||
constructor() { } |
|||
path:string = "http://localhost:59279/api1"; |
|||
|
|||
constructor(private httpClient:HttpClient) { } |
|||
|
|||
public postUser(user:User): Observable<User> { |
|||
let user_post_api = this.path + '/sign-up'; |
|||
let authcode = btoa(user.username + ":" + user.password) |
|||
user.username = authcode; |
|||
user.password = ""; |
|||
return this.httpClient.post<User>(user_post_api,user); |
|||
} |
|||
|
|||
public loginUser(user: User) { |
|||
let httpOptions = { |
|||
headers: new HttpHeaders({ |
|||
'Content-Type': 'application/json', |
|||
'Authorization': 'Basic ' + btoa(user.username + ":" + user.password) |
|||
}) |
|||
} |
|||
let user_login_api = this.path + "/login" |
|||
return this.httpClient.get(user_login_api, httpOptions); |
|||
} |
|||
|
|||
public getUserByName(username:string): Observable<User> { |
|||
let user_getName_api = this.path + "/user/name/" + username; |
|||
return this.httpClient.get<User>(user_getName_api); |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue