From c5174dfb8ff0023a01290fef78523f3c96ce40bc Mon Sep 17 00:00:00 2001 From: Le Deng Date: Fri, 10 Mar 2017 12:35:15 -0500 Subject: [PATCH] latest --- bookstore-api/.idea/workspace.xml | 90 +++++++++---------- .../main/java/com/bookstore/domain/Order.java | 1 + store-front/src/app/app.module.ts | 4 +- .../app/components/order/order.component.css | 0 .../app/components/order/order.component.html | 3 + .../components/order/order.component.spec.ts | 28 ++++++ .../app/components/order/order.component.ts | 15 ++++ store-front/src/app/models/billing-address.ts | 10 +++ store-front/src/app/models/order.ts | 6 ++ .../src/app/models/shipping-address.ts | 10 +++ 10 files changed, 121 insertions(+), 46 deletions(-) create mode 100644 store-front/src/app/components/order/order.component.css create mode 100644 store-front/src/app/components/order/order.component.html create mode 100644 store-front/src/app/components/order/order.component.spec.ts create mode 100644 store-front/src/app/components/order/order.component.ts create mode 100644 store-front/src/app/models/billing-address.ts create mode 100644 store-front/src/app/models/shipping-address.ts diff --git a/bookstore-api/.idea/workspace.xml b/bookstore-api/.idea/workspace.xml index 07b7465..f96979b 100644 --- a/bookstore-api/.idea/workspace.xml +++ b/bookstore-api/.idea/workspace.xml @@ -26,28 +26,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -148,11 +126,11 @@ - + - - + + @@ -160,6 +138,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -204,7 +202,6 @@ @@ -1038,12 +1036,12 @@ - + - @@ -1067,7 +1065,7 @@ - + @@ -1137,13 +1135,6 @@ - - - - - - - @@ -1151,13 +1142,6 @@ - - - - - - - @@ -1555,13 +1539,29 @@ - - + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bookstore-api/src/main/java/com/bookstore/domain/Order.java b/bookstore-api/src/main/java/com/bookstore/domain/Order.java index fb58ff8..a8ede11 100644 --- a/bookstore-api/src/main/java/com/bookstore/domain/Order.java +++ b/bookstore-api/src/main/java/com/bookstore/domain/Order.java @@ -40,6 +40,7 @@ public class Order implements Serializable { private Payment payment; @ManyToOne + @JsonIgnore private User user; public Long getId() { diff --git a/store-front/src/app/app.module.ts b/store-front/src/app/app.module.ts index 9a6cc94..90463fa 100644 --- a/store-front/src/app/app.module.ts +++ b/store-front/src/app/app.module.ts @@ -26,6 +26,7 @@ import { MyProfileComponent } from './components/my-profile/my-profile.component import { BookListComponent } from './components/book-list/book-list.component'; import { BookDetailComponent } from './components/book-detail/book-detail.component'; import { ShoppingCartComponent } from './components/shopping-cart/shopping-cart.component'; +import { OrderComponent } from './components/order/order.component'; @NgModule({ declarations: [ @@ -37,7 +38,8 @@ import { ShoppingCartComponent } from './components/shopping-cart/shopping-cart. MyProfileComponent, BookListComponent, BookDetailComponent, - ShoppingCartComponent + ShoppingCartComponent, + OrderComponent ], imports: [ BrowserModule, diff --git a/store-front/src/app/components/order/order.component.css b/store-front/src/app/components/order/order.component.css new file mode 100644 index 0000000..e69de29 diff --git a/store-front/src/app/components/order/order.component.html b/store-front/src/app/components/order/order.component.html new file mode 100644 index 0000000..c1bb21d --- /dev/null +++ b/store-front/src/app/components/order/order.component.html @@ -0,0 +1,3 @@ +

+ order works! +

diff --git a/store-front/src/app/components/order/order.component.spec.ts b/store-front/src/app/components/order/order.component.spec.ts new file mode 100644 index 0000000..21cdef1 --- /dev/null +++ b/store-front/src/app/components/order/order.component.spec.ts @@ -0,0 +1,28 @@ +/* tslint:disable:no-unused-variable */ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { By } from '@angular/platform-browser'; +import { DebugElement } from '@angular/core'; + +import { OrderComponent } from './order.component'; + +describe('OrderComponent', () => { + let component: OrderComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ OrderComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(OrderComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/store-front/src/app/components/order/order.component.ts b/store-front/src/app/components/order/order.component.ts new file mode 100644 index 0000000..f0fbd72 --- /dev/null +++ b/store-front/src/app/components/order/order.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-order', + templateUrl: './order.component.html', + styleUrls: ['./order.component.css'] +}) +export class OrderComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/store-front/src/app/models/billing-address.ts b/store-front/src/app/models/billing-address.ts new file mode 100644 index 0000000..6d21f01 --- /dev/null +++ b/store-front/src/app/models/billing-address.ts @@ -0,0 +1,10 @@ +export class BillingAddress { + public id:number; + public billingAddressName:string; + public billingAddressStreet1:string; + public billingAddressStreet2:string; + public billingAddressCity:string; + public billingAddressState:string; + public billingAddressCountry:string; + public billingAddressZipcode:string; +} diff --git a/store-front/src/app/models/order.ts b/store-front/src/app/models/order.ts index 23d2748..b9eceee 100644 --- a/store-front/src/app/models/order.ts +++ b/store-front/src/app/models/order.ts @@ -1,2 +1,8 @@ export class Order { + public id:number; + public orderDate: string; + public shippingDate: string; + public shippingMethod: string; + public orderStatus: string; + public orderTotal: number; } diff --git a/store-front/src/app/models/shipping-address.ts b/store-front/src/app/models/shipping-address.ts new file mode 100644 index 0000000..d10392a --- /dev/null +++ b/store-front/src/app/models/shipping-address.ts @@ -0,0 +1,10 @@ +export class ShippingAddress { + public id:number; + public shippingAddressName:string; + public shippingAddressStreet1:string; + public shippingAddressStreet2:string; + public shippingAddressCity:string; + public shippingAddressState:string; + public shippingAddressCountry:string; + public shippingAddressZipcode:string; +}