Browse Source

UI Updated

gauravfullcomponent
Gowrisankar J g 4 years ago
parent
commit
88610242f2
36 changed files with 353 additions and 723 deletions
  1. 22
      Angular-UrbanBazaar/src/app/app-routing.module.ts
  2. 29
      Angular-UrbanBazaar/src/app/app.module.ts
  3. 40
      Angular-UrbanBazaar/src/app/auth/sign-up/sign-up.component.ts
  4. 51
      Angular-UrbanBazaar/src/app/components/home/home.component.html
  5. 51
      Angular-UrbanBazaar/src/app/components/home/home.component.ts
  6. 107
      Angular-UrbanBazaar/src/app/components/memberlist/memberlist.component.ts
  7. 36
      Angular-UrbanBazaar/src/app/components/page-nav-bar/page-nav-bar.component.html
  8. 18
      Angular-UrbanBazaar/src/app/components/page-nav-bar/page-nav-bar.component.ts
  9. 0
      Angular-UrbanBazaar/src/app/components/user-add/user-add.component.css
  10. 1
      Angular-UrbanBazaar/src/app/components/user-add/user-add.component.html
  11. 25
      Angular-UrbanBazaar/src/app/components/user-add/user-add.component.spec.ts
  12. 15
      Angular-UrbanBazaar/src/app/components/user-add/user-add.component.ts
  13. 46
      Angular-UrbanBazaar/src/app/components/user-profile-details/user-profile-details.component.ts
  14. 0
      Angular-UrbanBazaar/src/app/components/user-search/user-search.component.css
  15. 1
      Angular-UrbanBazaar/src/app/components/user-search/user-search.component.html
  16. 25
      Angular-UrbanBazaar/src/app/components/user-search/user-search.component.spec.ts
  17. 15
      Angular-UrbanBazaar/src/app/components/user-search/user-search.component.ts
  18. 3
      Angular-UrbanBazaar/src/app/components/user-show/user-show.component.css
  19. 29
      Angular-UrbanBazaar/src/app/components/user-show/user-show.component.html
  20. 25
      Angular-UrbanBazaar/src/app/components/user-show/user-show.component.spec.ts
  21. 22
      Angular-UrbanBazaar/src/app/components/user-show/user-show.component.ts
  22. 16
      Angular-UrbanBazaar/src/app/models/cart.ts
  23. 8
      Angular-UrbanBazaar/src/app/models/login.ts
  24. 16
      Angular-UrbanBazaar/src/app/models/member-user.ts
  25. 35
      Angular-UrbanBazaar/src/app/models/orders.ts
  26. 7
      Angular-UrbanBazaar/src/app/models/product-category.ts
  27. 19
      Angular-UrbanBazaar/src/app/models/product.ts
  28. 24
      Angular-UrbanBazaar/src/app/models/user.ts
  29. 73
      Angular-UrbanBazaar/src/app/services/cart.service.ts
  30. 69
      Angular-UrbanBazaar/src/app/services/member-user.service.ts
  31. 22
      Angular-UrbanBazaar/src/app/services/orders.service.ts
  32. 13
      Angular-UrbanBazaar/src/app/services/product-category.service.ts
  33. 23
      Angular-UrbanBazaar/src/app/services/product.service.ts
  34. 89
      Angular-UrbanBazaar/src/app/services/user.service.ts
  35. 7
      UB_UserServiceProxy/src/main/resources/application.properties
  36. 94
      grocery_db_tables.sql

22
Angular-UrbanBazaar/src/app/app-routing.module.ts

@ -1,21 +1,29 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { LoginComponent } from './auth/login/login.component';
import { SignUpComponent } from './auth/sign-up/sign-up.component';
import { CartComponent } from './components/cart/cart.component';
import { HomeComponent } from './components/home/home.component';
import { MemberlistComponent } from './components/memberlist/memberlist.component';
import { UserProfileDetailsComponent } from './components/user-profile-details/user-profile-details.component';
import { UserShowComponent } from './components/user-show/user-show.component';
const routes: Routes = [
{path: '', component: LoginComponent},
{path: 'home', component: HomeComponent},
{path: 'showAllUsers', component: UserShowComponent},
{path: 'profile', component: UserProfileDetailsComponent},
{path: 'showCart', component: CartComponent},
{ path: '', component: LoginComponent},
{ path: 'login', component: LoginComponent},
{ path: 'signup', component: SignUpComponent},
{ path: 'user-profile-details', component: UserProfileDetailsComponent},
{ path: 'memberlist', component: MemberlistComponent},
{ path: 'showCart', component: CartComponent},
{ path: 'home', component: HomeComponent,
children: [
{ path: 'user-profile-details', component: UserProfileDetailsComponent, outlet: 'user'},
{ path: 'memberlist', component: MemberlistComponent, outlet: 'member'}
]
}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
imports: [RouterModule.forRoot(routes ,{ useHash: true })],
exports: [RouterModule]

29
Angular-UrbanBazaar/src/app/app.module.ts

@ -1,11 +1,9 @@
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { HttpClientModule } from '@angular/common/http';
import { UserShowComponent } from './components/user-show/user-show.component';
import { UserProfileDetailsComponent } from './components/user-profile-details/user-profile-details.component';
import { PageNavBarComponent } from './components/page-nav-bar/page-nav-bar.component';
import { HomeComponent } from './components/home/home.component';
@ -14,35 +12,16 @@ import { MatInputModule } from '@angular/material/input';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatCardModule } from '@angular/material/card';
import { MatButtonModule } from '@angular/material/button';
import { MatDividerModule } from '@angular/material/divider';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FlexLayoutModule } from '@angular/flex-layout';
import { LoginComponent } from './auth/login/login.component';
import { SignUpComponent } from './auth/sign-up/sign-up.component';
import { RouterModule, Routes } from '@angular/router';
import { HttpModule } from '@angular/http';
import { MemberlistComponent } from './components/memberlist/memberlist.component';
const appRoutes : Routes =
[
{path:'',component:LoginComponent},
{path:'login',component:LoginComponent},
{path:'signup',component:SignUpComponent},
{path:'user-profile-details',component:UserProfileDetailsComponent},
{path:'memberlist',component:MemberlistComponent},
{path:'home',component:HomeComponent,
children: [
{path:'user-profile-details',component:UserProfileDetailsComponent,outlet:'user'},
{path:'memberlist',component:MemberlistComponent,outlet:'member'}
]
}
]
@NgModule({
declarations: [
AppComponent,
UserShowComponent,
UserProfileDetailsComponent,
PageNavBarComponent,
HomeComponent,
@ -53,6 +32,7 @@ children: [
],
imports: [
BrowserModule,
BrowserAnimationsModule,
AppRoutingModule,
FormsModule,
ReactiveFormsModule,
@ -62,10 +42,7 @@ children: [
MatInputModule,
MatCardModule,
MatButtonModule,
BrowserAnimationsModule,AppRoutingModule,
RouterModule.forRoot(appRoutes,{ useHash: true }),
FormsModule,
HttpModule,
MatDividerModule,
],
providers: [],
bootstrap: [AppComponent]

40
Angular-UrbanBazaar/src/app/auth/sign-up/sign-up.component.ts

@ -7,35 +7,31 @@ import { UserService } from 'src/app/services/user.service';
@Component({
selector: 'app-sign-up',
templateUrl: './sign-up.component.html',
styleUrls: ['./sign-up.component.css']
styleUrls: ['./sign-up.component.css'],
})
export class SignUpComponent implements OnInit {
user: User;
tys: string = 't';
temp: Observable<User>;
user :User;
tys :string="t"
temp : Observable<User>;
isFormSubmitted : boolean;
public signup(signupForm : NgForm) {
isFormSubmitted: boolean;
public signup(signupForm: NgForm) {
if (signupForm.invalid) {
alert("Kindly enter all details")
alert('Kindly enter all details');
return;
}
this.isFormSubmitted=true;
this._userservice.addUser(this.user).subscribe(x => { this.tys="y"; alert("Signup Successful")
if(this.tys=="t")
alert("not")});
}
constructor(private _userservice:UserService) {
this.user=new User();
this.isFormSubmitted=false;
}
this.isFormSubmitted = true;
ngOnInit(): void {
this._userservice.addUser(this.user).subscribe((x) => {
this.tys = 'y';
alert('Signup Successful');
if (this.tys == 't') alert('not');
});
}
constructor(private _userservice: UserService) {
this.user = new User();
this.isFormSubmitted = false;
}
ngOnInit(): void {}
}

51
Angular-UrbanBazaar/src/app/components/home/home.component.html

@ -1,50 +1,23 @@
<body>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;
<button style="shape-outside: circle();color:forestgreen;
background-color: white; border-color: forestgreen;" class="EditProfile" (click)=EditProfile()>Edit
Profile</button> &nbsp;
<button style="shape-outside: circle();color:forestgreen; background-color: white; border-color: forestgreen;" class="EditProfile" (click)=EditProfile()>Edit Profile</button>
&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;
<button style="shape-outside: circle();color: forestgreen; background-color: white; border-color: forestgreen;" class="Members List of Curent User" (click)=Members()>Members List of Curent User</button>
<br/><br/>
<button style="shape-outside: circle();color: forestgreen; background-color: white; border-color: forestgreen;" class="Members List of Curent User" (click)=Members()>Members List of Curent User</button>
<br /><br />
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="text"
[(ngModel)]="searchValue" id="searchValue" [ngModelOptions]="{standalone: true}"
placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0"
type="submit" (click)="searchProduct()">Search</button>
</form>
<button class="showCart" (click)="showCart()">Show Cart</button>
<input class="form-control mr-sm-2" type="text" [(ngModel)]="searchValue" id="searchValue" [ngModelOptions]="{standalone: true}" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit" (click)="searchProduct()">Search</button>
</form>
<button class="showCart" (click)="showCart()">Show Cart</button>
<div class="cardParent">
<div class="card" *ngFor="let i of Searchedproducts">
<img src="{{i.productimage}}" style="width:85%">
<h5>{{i.productname}}</h5>
<p class="price">Rs. {{i.productprice}} <br>
Weight: {{i.productweight}} Kg</p>
<p class="price">Rs. {{i.productprice}} <br> Weight: {{i.productweight}} Kg</p>
<p><button class="AddToCart" (click)=addCart(i)>Add to Cart</button></p>
</div>
</div>
</body>
<!-- <div >
<app-page-nav-bar></app-page-nav-bar>
</div> -->
<!-- <button type="button" style="text-align:center;background-color:dimgray;" cls="btn" (click)="btnClick();">EditProfile</button> -->
<!-- <div style="text-align:center;">
<a [routerLink]="['/home', {outlets: {'member': ['memberlist']}}]">Members List of Curent User</a>
</div>
<router-outlet name="member"></router-outlet> -->
<!--
<div style="text-align:center;">
<a [routerLink]="['/home', {outlets: {'user': ['user-profile-details']}}]">EditProfile</a>
</div>
<router-outlet name="user"></router-outlet> -->
</body>

51
Angular-UrbanBazaar/src/app/components/home/home.component.ts

@ -1,55 +1,52 @@
import { Component, OnInit } from '@angular/core';
import { ProductService } from './../../services/product.service';
import { Observable } from 'rxjs';
import { Product } from './../../models/product';
import { ActivatedRoute, Router } from '@angular/router';
import { Router } from '@angular/router';
import { CartService } from 'src/app/services/cart.service';
import { Cart } from 'src/app/models/cart';
import { ThrowStmt } from '@angular/compiler';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.css']
styleUrls: ['./home.component.css'],
})
export class HomeComponent implements OnInit {
public products: Product[];
public Searchedproducts: Product[];
searchValue : string = "";
searchValue: string = '';
constructor(private productservice: ProductService,
private router: Router,
private cartservice: CartService,
) {}
constructor(
private productservice: ProductService,
private router: Router,
private cartservice: CartService
) {}
public showCart(){
public showCart() {
this.router.navigateByUrl('/showCart');
}
addCart(item:any){
addCart(item: any) {
this.cartservice.addtoCart(item);
}
searchProduct() {
if(this.searchValue=="") {
if (this.searchValue == '') {
this.Searchedproducts = this.products;
} else {
// this.productservice.searchProduct(this.searchValue).subscribe(
// res => {this.Searchedproducts = res;}
// );
this.Searchedproducts = this.products.filter(p => p.productname.toLocaleLowerCase().includes(this.searchValue));
this.Searchedproducts = this.products.filter((p) =>
p.productname.toLocaleLowerCase().includes(this.searchValue)
);
}
}
EditProfile(){
this.router.navigateByUrl('/user-profile-details')
}
Members(){
this.router.navigateByUrl('/memberlist')
}
EditProfile() {
this.router.navigateByUrl('/user-profile-details');
}
Members() {
this.router.navigateByUrl('/memberlist');
}
ngOnInit(): void {
this.productservice.showAllProduct().subscribe(res=>{
this.productservice.showAllProduct().subscribe((res) => {
this.products = res;
this.Searchedproducts = res;
})
}}
});
}
}

107
Angular-UrbanBazaar/src/app/components/memberlist/memberlist.component.ts

@ -8,82 +8,67 @@ import { UserService } from 'src/app/services/user.service';
@Component({
selector: 'app-memberlist',
templateUrl: './memberlist.component.html',
styleUrls: ['./memberlist.component.css']
styleUrls: ['./memberlist.component.css'],
})
export class MemberlistComponent implements OnInit {
currentUser: Observable<MemberUser[]>;
member: MemberUser;
userid: number = this._userservice.currentUser.userid;
public toggleButton: boolean = false;
mem: MemberUser;
isFormSubmitted: boolean = false;
currentUser : Observable<MemberUser[]>;
member : MemberUser;
userid :number =this._userservice.currentUser.userid
public toggleButton: boolean ;
mem :MemberUser
isFormSubmitted : boolean;
public add(addmemForm : NgForm) {
this.mem.userid=this._userservice.currentUser.userid
constructor(
private _memberService: MemberUserService,
private _userservice: UserService
) {
this.member = new MemberUser();
this.mem = new MemberUser();
this.isFormSubmitted = false;
this.toggleButton = true;
this.currentUser = this._memberService.searchMembersbyUser(
this._userservice.currentUser.userid
);
this.currentUser.subscribe();
}
public add(addmemForm: NgForm) {
this.mem.userid = this._userservice.currentUser.userid;
if (addmemForm.invalid) {
alert("Kindly enter all details")
alert('Kindly enter all details');
return;
}
this.isFormSubmitted=true;
this._memberService.addMemberUser(this.mem).subscribe(x => { alert("Member added Successfuly")
this.isFormSubmitted = true;
})
// .subscribe(x => {alert("Sign up Successfull")});
this._memberService.addMemberUser(this.mem).subscribe((x) => {
alert('Member added Successfuly');
});
}
public delete(updateForm : NgForm,v: MemberUser) {
this._memberService.deleteMemberUser(v.memberid).subscribe(x => { alert("Member deleted Successfuly")
})
public delete(updateForm: NgForm, v: MemberUser) {
this._memberService.deleteMemberUser(v.memberid).subscribe((x) => {
alert('Member deleted Successfuly');
});
}
constructor(private _memberService : MemberUserService,private _userservice:UserService) {
this.member=new MemberUser()
this.mem=new MemberUser();
this.isFormSubmitted=false;
this.toggleButton=true
this.currentUser = this._memberService.searchMembersbyUser(this._userservice.currentUser.userid);
this.currentUser.subscribe();
}
update(updateForm : NgForm ,v:MemberUser) {
public update(updateForm: NgForm, v: MemberUser) {
if (updateForm.invalid) {
return;
}
// console.log(v)
this._memberService.updateMemberUser(v).subscribe(x=>{
alert("Member Id: "+v.memberid+" with MemberName "+v.membername+" is updated") })
// alert("Record Updated")})
this._memberService.updateMemberUser(v).subscribe((x) => {
alert(
'Member Id: ' +
v.memberid +
' with MemberName ' +
v.membername +
' is updated'
);
});
}
// addMember(updateForm : NgForm ,v:MemberUser) {
// if (updateForm.invalid) {
// return;
// }
// // console.log(v)
// this._memberService.addMemberUser(v).subscribe(x=>{
// alert("Member Id: "+v.memberid+" with MemberName "+v.membername+" is updated") })
// // alert("Record Updated")})
enable() { this.toggleButton = false; }
disable() { this.toggleButton = true; }
// }
enable(){
this.toggleButton = false
}
disable(){
this.toggleButton = true
}
ngOnInit(): void {
}
ngOnInit(): void {}
}

36
Angular-UrbanBazaar/src/app/components/page-nav-bar/page-nav-bar.component.html

@ -1,29 +1,19 @@
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Urban Bazaar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<a class="navbar-brand" href="#">Urban Bazaar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="/home">Home <span class="sr-only">(current)</span></a>
</li>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="/home">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item active">
<a class="nav-link" href="/profile"> Profile <span class="sr-only">(current)</span></a>
</li>
<!-- Dropdown -->
<!-- <li class="nav-item dropdown" dropdown>
<a dropdownToggle mdbWavesEffect type="button" class="nav-link dropdown-toggle waves-light" mdbWavesEffect>
Profile<span class="caret"></span></a>
<div *dropdownMenu class="dropdown-menu dropdown-menu-right dropdown dropdown-primary" role="menu">
<a class="dropdown-item waves-light" mdbWavesEffect href="#">My account</a>
<a class="dropdown-item waves-light" mdbWavesEffect href="#">Log out</a>
</div>
</li> -->
</ul>
</div>
<li class="nav-item active">
<a class="nav-link" href="/user-profile-details">
Profile <span class="sr-only">(current)</span></a>
</li>
</ul>
</div>
</nav>

18
Angular-UrbanBazaar/src/app/components/page-nav-bar/page-nav-bar.component.ts

@ -1,9 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { ProductService } from 'src/app/services/product.service';
import { Product } from 'src/app/models/product';
import { Router } from '@angular/router';
import { UserService } from 'src/app/services/user.service';
@Component({
selector: 'app-page-nav-bar',
@ -12,18 +7,7 @@ import { UserService } from 'src/app/services/user.service';
})
export class PageNavBarComponent implements OnInit {
searchValue: string = "";
products : Observable<Product[]>
constructor(private _productService : ProductService, private router: Router) { }
clickme() {
alert('searchValue: '+this.searchValue);
this.products = this._productService.searchProduct(this.searchValue);
this._productService.search = this.searchValue;
// this.router.navigate(["/search", {search: this.searchValue}]);
}
constructor() { }
ngOnInit(): void {
}

0
Angular-UrbanBazaar/src/app/components/user-add/user-add.component.css

1
Angular-UrbanBazaar/src/app/components/user-add/user-add.component.html

@ -1 +0,0 @@
<p>user-add works!</p>

25
Angular-UrbanBazaar/src/app/components/user-add/user-add.component.spec.ts

@ -1,25 +0,0 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { UserAddComponent } from './user-add.component';
describe('UserAddComponent', () => {
let component: UserAddComponent;
let fixture: ComponentFixture<UserAddComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ UserAddComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(UserAddComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

15
Angular-UrbanBazaar/src/app/components/user-add/user-add.component.ts

@ -1,15 +0,0 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-user-add',
templateUrl: './user-add.component.html',
styleUrls: ['./user-add.component.css']
})
export class UserAddComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

46
Angular-UrbanBazaar/src/app/components/user-profile-details/user-profile-details.component.ts

@ -7,43 +7,39 @@ import { UserService } from 'src/app/services/user.service';
@Component({
selector: 'app-user-profile-details',
templateUrl: './user-profile-details.component.html',
styleUrls: ['./user-profile-details.component.css']
styleUrls: ['./user-profile-details.component.css'],
})
export class UserProfileDetailsComponent implements OnInit {
currentUser : Observable<User>;
user : User;
public toggleButton: boolean ;
currentUser: Observable<User>;
user: User;
public toggleButton: boolean;
// /isFormSubmitted : boolean;
constructor(private _userService : UserService) {
this.user=new User()
this.toggleButton=true
this.currentUser = this._userService.searchUser(this._userService.currentUser.userid);
this.currentUser.subscribe((userold: User)=> this.user = userold);
constructor(private _userService: UserService) {
this.user = new User();
this.toggleButton = true;
this.currentUser = this._userService.searchUser(
this._userService.currentUser.userid
);
this.currentUser.subscribe((userold: User) => (this.user = userold));
}
update(vendorForm : NgForm) {
public update(vendorForm: NgForm) {
if (vendorForm.invalid) {
return;
}
// this.isFormSubmitted=true;
this._userService.updateUser(this.user).subscribe(x => { })
alert("Record Updated")
this._userService.updateUser(this.user).subscribe((x) => {});
alert('Record Updated');
}
enable(){
this.toggleButton = false
}
disable(){
this.toggleButton = true
}
ngOnInit(): void {
enable() {
this.toggleButton = false;
}
disable() {
this.toggleButton = true;
}
ngOnInit(): void {}
}

0
Angular-UrbanBazaar/src/app/components/user-search/user-search.component.css

1
Angular-UrbanBazaar/src/app/components/user-search/user-search.component.html

@ -1 +0,0 @@
<p>user-search works!</p>

25
Angular-UrbanBazaar/src/app/components/user-search/user-search.component.spec.ts

@ -1,25 +0,0 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { UserSearchComponent } from './user-search.component';
describe('UserSearchComponent', () => {
let component: UserSearchComponent;
let fixture: ComponentFixture<UserSearchComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ UserSearchComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(UserSearchComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

15
Angular-UrbanBazaar/src/app/components/user-search/user-search.component.ts

@ -1,15 +0,0 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-user-search',
templateUrl: './user-search.component.html',
styleUrls: ['./user-search.component.css']
})
export class UserSearchComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

3
Angular-UrbanBazaar/src/app/components/user-show/user-show.component.css

@ -1,3 +0,0 @@
body {
padding-left: 10px;
}

29
Angular-UrbanBazaar/src/app/components/user-show/user-show.component.html

@ -1,29 +0,0 @@
<p>user-show works!</p>
<body>
<h3>All User Details</h3>
<table class="table table-hover">
<tr>
<th>User Id</th>
<th>User Email</th>
<th>First Name</th>
<th>City</th>
<th>Zipcode</th>
<th>Phone</th>
<th>Address Line 1</th>
<th>Address Line 2</th>
</tr>
<tr *ngFor="let user of userList | async">
<td>{{user.userid}}</td>
<td>{{user.useremail}}</td>
<td>{{user.userfirstname}}</td>
<td>{{user.usercity}}</td>
<td>{{user.userzip}}</td>
<td>{{user.userphone}}</td>
<td>{{user.useraddress}}</td>
<td>{{user.useraddress2}}</td>
</tr>
</table>
</body>

25
Angular-UrbanBazaar/src/app/components/user-show/user-show.component.spec.ts

@ -1,25 +0,0 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { UserShowComponent } from './user-show.component';
describe('UserShowComponent', () => {
let component: UserShowComponent;
let fixture: ComponentFixture<UserShowComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ UserShowComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(UserShowComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

22
Angular-UrbanBazaar/src/app/components/user-show/user-show.component.ts

@ -1,22 +0,0 @@
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { User } from 'src/app/models/user';
import { UserService } from 'src/app/services/user.service';
@Component({
selector: 'app-user-show',
templateUrl: './user-show.component.html',
styleUrls: ['./user-show.component.css']
})
export class UserShowComponent implements OnInit {
userList : Observable<User[]>;
constructor(private _userService : UserService) {
this.userList = this._userService.showAllUsers();
}
ngOnInit(): void {
}
}

16
Angular-UrbanBazaar/src/app/models/cart.ts

@ -1,10 +1,10 @@
export class Cart {
public cartid : number;
public userid : number;
public orderid : number;
public productname : string;
public productprice : number;
public quantity : number;
constructor() {}
public cartid: number;
public userid: number;
public orderid: number;
public productname: string;
public productprice: number;
public quantity: number;
constructor() {}
}

8
Angular-UrbanBazaar/src/app/models/login.ts

@ -1,6 +1,6 @@
export class Login {
public userfirstname : string;
public userpassword : string;
constructor() {}
public userfirstname: string;
public userpassword: string;
constructor() {}
}

16
Angular-UrbanBazaar/src/app/models/member-user.ts

@ -1,10 +1,10 @@
export class MemberUser {
public userid : number;
public memberid : number;
public membername : string;
public totalitems : number;
public memberphone : string;
public membertotalamount : number;
public memberdoornumber: number;
constructor() {}
public userid: number;
public memberid: number;
public membername: string;
public totalitems: number;
public memberphone: string;
public membertotalamount: number;
public memberdoornumber: number;
constructor() {}
}

35
Angular-UrbanBazaar/src/app/models/orders.ts

@ -1,21 +1,20 @@
export class Orders {
public orderid: number;
public orderuserid: number;
public orderamount: number;
public ordershipaddress: string;
public ordershipaddress2: string;
public ordercity: string;
public orderzip: string;
public orderstate: string;
public ordercountry: string;
public orderphone: string;
public ordershippingcost: number;
public ordertax: number;
public orderemail: string;
public orderdate: Date;
public ordershipped: string;
public ordertrackingnumber: string;
public orderid : number;
public orderuserid : number;
public orderamount : number;
public ordershipaddress : string;
public ordershipaddress2 : string;
public ordercity : string;
public orderzip : string;
public orderstate : string;
public ordercountry : string;
public orderphone : string;
public ordershippingcost : number;
public ordertax : number;
public orderemail : string;
public orderdate : Date;
public ordershipped : string;
public ordertrackingnumber : string;
constructor() {}
constructor() {}
}

7
Angular-UrbanBazaar/src/app/models/product-category.ts

@ -1,7 +1,6 @@
export class ProductCategory {
public categoryid: number;
public categoryname: string;
public categoryid : number;
public categoryname : string;
constructor() {}
constructor() {}
}

19
Angular-UrbanBazaar/src/app/models/product.ts

@ -1,13 +1,12 @@
export class Product {
public productid: number;
public productname: string;
public productprice: number;
public productweight: number;
public productshortdesc: string;
public productlongdesc: string;
public productimage: string;
public productcategoryid: number;
public productid : number;
public productname : string;
public productprice : number;
public productweight : number;
public productshortdesc : string;
public productlongdesc : string;
public productimage : string;
public productcategoryid : number;
constructor() {}
constructor() {}
}

24
Angular-UrbanBazaar/src/app/models/user.ts

@ -1,15 +1,15 @@
export class User {
public userid : number;
public useremail : string;
public userpassword : string;
public userfirstname : string;
public userlastname : string;
public usercity: string;
public userstate : string;
public userzip : string;
public userphone : string;
public useraddress : string;
public useraddress2 : string;
public userid: number;
public useremail: string;
public userpassword: string;
public userfirstname: string;
public userlastname: string;
public usercity: string;
public userstate: string;
public userzip: string;
public userphone: string;
public useraddress: string;
public useraddress2: string;
constructor() {}
constructor() {}
}

73
Angular-UrbanBazaar/src/app/services/cart.service.ts

@ -5,74 +5,51 @@ import { BehaviorSubject, Observable } from 'rxjs';
import { Cart } from '../models/cart';
@Injectable({
providedIn: 'root'
providedIn: 'root',
})
export class CartService {
public cartListItem: any = [];
public productList = new BehaviorSubject<any>([]);
private _url : String = "http://localhost:4405/cart";
constructor(private _http : HttpClient) { }
private _url: String = 'http://localhost:4405/cart';
// public showAllOrder():Observable<Cart[]>
// {
// return this._http.get<Cart[]>(this._url+"/showCart");
// }
constructor(private _http: HttpClient) {}
public cartListItem: any=[]
public productList = new BehaviorSubject<any>([])
// public addOrder(cart:Cart)
// {
// this._http.post(this._url+"/addCart",cart)
// }
getProducts()
{
getProducts() {
return this.productList.asObservable();
}
setProduct(product:any)
{
setProduct(product: any) {
this.cartListItem.push(...product);
this.productList.next(product);
}
addtoCart(product:any)
{
this.cartListItem.push(product);
this.productList.next(this.cartListItem)
this.getTotalPrice();
// console.log(this.cartListItem);
addtoCart(product: any) {
this.cartListItem.push(product);
this.productList.next(this.cartListItem);
this.getTotalPrice();
// console.log(this.cartListItem);
}
getTotalPrice():number{
let grandTotal=0;
this.cartListItem.map((a:any)=>{
grandTotal+=a.productprice;
})
getTotalPrice(): number {
let grandTotal = 0;
this.cartListItem.map((a: any) => {
grandTotal += a.productprice;
});
return grandTotal;
}
removeCartItem(product:any)
{
this.cartListItem.map((a:any,index:any)=>{
if(product.productid === a.productid)
{
this.cartListItem.splice(index,1);
removeCartItem(product: any) {
this.cartListItem.map((a: any, index: any) => {
if (product.productid === a.productid) {
this.cartListItem.splice(index, 1);
}
})
this.productList.next(this.cartListItem);
});
this.productList.next(this.cartListItem);
}
removeAllCart()
{
this.cartListItem=[]
removeAllCart() {
this.cartListItem = [];
this.productList.next(this.cartListItem);
}
}

69
Angular-UrbanBazaar/src/app/services/member-user.service.ts

@ -2,64 +2,39 @@
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { MemberUser } from '../models/member-user';
import 'rxjs/add/operator/map';
import { Http ,Response} from '@angular/http';
import { HttpClient } from '@angular/common/http';
@Injectable({
providedIn: 'root'
providedIn: 'root',
})
export class MemberUserService {
private _url: String = 'http://localhost:8008/user/';
constructor(private _http: HttpClient) {}
private _url : String = "http://localhost:8008/user/";
constructor(private _http : HttpClient) { }
// public showMembersByUser(id : number) : Observable<MemberUser[]> {
// return this._http.get<MemberUser[]>(this._url+"/showUserMembers/"+id);
// }
// public addMemberToUser(member : MemberUser) {
// this._http.post(this._url+"/addMember", member);
// }
showAllMemberUsers() {
return this._http.get<MemberUser[]>(this._url+"showAllMembers")}
// .map((res : Response) => res.json()); }
// : Observable<MemberUser[]>
addMemberUser(member: MemberUser){
return this._http.post(this._url+"addMember/",member)}
// : Observable<any> .map((res: Response)=> null); }
searchMemberUser(memberid : number) {
return this._http.get<MemberUser>(this._url+"showAllMembers/" +memberid)}
// : Observable<MemberUser>.map((res : Response) => res.json()); }
searchMembersbyUser(userid : number){
return this._http.get<MemberUser[]>(this._url+"showUserMembers/" +userid)}
// : Observable<MemberUser[]> .map((res : Response) => res.json()); }
deleteMemberUser(memberid : number) {
return this._http.delete(this._url+"deleteMember/" +memberid)}
// .map((res : Response) => null); }: Observable<any>
updateMemberUser(member :MemberUser) {
return this._http.put(this._url+"updateMember/",member)
// : Observable<any>.map((res: Response)=> null); }
public showAllMemberUsers() {
return this._http.get<MemberUser[]>(this._url + 'showAllMembers');
}
public addMemberUser(member: MemberUser) {
return this._http.post(this._url + 'addMember/', member);
}
public searchMemberUser(memberid: number) {
return this._http.get<MemberUser>(this._url + 'showAllMembers/' + memberid);
}
// private _url : String = "http://localhost:8001/user";
// constructor(private _http : HttpClient) { }
// public showMembersByUser(id : number) : Observable<MemberUser[]> {
// return this._http.get<MemberUser[]>(this._url+"/showUserMembers/"+id);
// }
public searchMembersbyUser(userid: number) {
return this._http.get<MemberUser[]>(
this._url + 'showUserMembers/' + userid
);
}
// public addMemberToUser(member : MemberUser) {
// this._http.post(this._url+"/addMember", member);
// }
public deleteMemberUser(memberid: number) {
return this._http.delete(this._url + 'deleteMember/' + memberid);
}
public updateMemberUser(member: MemberUser) {
return this._http.put(this._url + 'updateMember/', member);
}
}

22
Angular-UrbanBazaar/src/app/services/orders.service.ts

@ -4,24 +4,22 @@ import { Observable } from 'rxjs';
import { Orders } from '../models/orders';
@Injectable({
providedIn: 'root'
providedIn: 'root',
})
export class OrdersService {
private _url: String = 'http://localhost:8009/orders';
private _url : String = "http://localhost:8009/orders";
constructor(private _http : HttpClient) { }
public addOrder(order : Orders) {
this._http.post(this._url+"/addOrder", order);
constructor(private _http: HttpClient) {}
public addOrder(order: Orders) {
this._http.post(this._url + '/addOrder', order);
}
public findOrder(id : number) : Observable<Orders> {
return this._http.get<Orders>(this._url+"/findOrder"+id);
public findOrder(id: number): Observable<Orders> {
return this._http.get<Orders>(this._url + '/findOrder' + id);
}
public findOrdersByUser(id : number) : Observable<Orders[]> {
return this._http.get<Orders[]>(this._url+"/findOrdersByUser"+id);
public findOrdersByUser(id: number): Observable<Orders[]> {
return this._http.get<Orders[]>(this._url + '/findOrdersByUser' + id);
}
}

13
Angular-UrbanBazaar/src/app/services/product-category.service.ts

@ -4,15 +4,16 @@ import { Observable } from 'rxjs';
import { ProductCategory } from '../models/product-category';
@Injectable({
providedIn: 'root'
providedIn: 'root',
})
export class ProductCategoryService {
private _url: String = 'http://localhost:8007/products';
private _url : String = "http://localhost:8007/products";
constructor(private _http : HttpClient) { }
constructor(private _http: HttpClient) {}
public showAllCategory() : Observable<ProductCategory[]> {
return this._http.get<ProductCategory[]>(this._url+"/showProductCategory");
public showAllCategory(): Observable<ProductCategory[]> {
return this._http.get<ProductCategory[]>(
this._url + '/showProductCategory'
);
}
}

23
Angular-UrbanBazaar/src/app/services/product.service.ts

@ -2,26 +2,21 @@ import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { Product } from '../models/product';
import {map} from 'rxjs/operators';
@Injectable({
providedIn: 'root'
providedIn: 'root',
})
export class ProductService {
private _url : String = "http://localhost:8007/products";
search : string;
constructor(private _http : HttpClient) { }
private _url: String = 'http://localhost:8007/products';
search: string;
public showAllProduct(){
return this._http.get<any>(this._url+"/showAllProducts")
.pipe(map((res:any)=>{
return res;
}))
}
constructor(private _http: HttpClient) {}
public searchProduct(name : string) : Observable<Product[]> {
return this._http.get<Product[]>(this._url+"/searchProduct/"+name);
public showAllProduct() : Observable<Product[]> {
return this._http.get<any>(this._url + '/showAllProducts');
}
public searchProduct(name: string): Observable<Product[]> {
return this._http.get<Product[]>(this._url + '/searchProduct/' + name);
}
}

89
Angular-UrbanBazaar/src/app/services/user.service.ts

@ -1,82 +1,39 @@
// import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Http,Response } from '@angular/http';
// import { Observable } from 'rxjs';
import { Login } from '../models/login';
import { User } from '../models/user';
import 'rxjs/add/operator/map';
import { Observable } from 'rxjs';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
@Injectable({
providedIn: 'root'
providedIn: 'root',
})
export class UserService {
currentUser: User;
private _url: string = 'http://localhost:8500/users/';
constructor(private _http: HttpClient) {}
// private _url : string = "http://localhost:9000";
constructor(private _http : HttpClient) { }
// public showAllUsers() : Observable<User[]> {
// return this._http.get<User[]>(this._url + "/showAllUsers");
// }
// public searchUser(id : number) : Observable<User> {
// return this._http.get<User>(this._url+"/findUserById/"+id);
// }
// public addUser(user : User) {
// this._http.post(this._url+"/addUser/", user);
currentUser:User
private _url:string ="http://localhost:8008/user/"
showAllUsers() {
return this._http.get<User[]>(this._url+"showAllUsers")}
// .map((res : Response) => res.json());}
addUser(user: User) {
return this._http.post(this._url+"addUser/",user)}
// .map((res: Response)=> null).pipe();}
// loginUser (user:User):Observable<any>{
// return this._http.post("http://localhost:8006/user/login/",user).map((res: Response)=>null);
// }
searchUser(userid : number) {
return this._http.get<User>(this._url+"findUserById/" +userid)}
// .map((res : Response) => res.json());}
updateUser(user : User) {
return this._http.put(this._url+"update/",user)}
// .map((res: Response)=> null);}
// findUserByUsername(name : string) : Observable<User> {
// return this._http.get("http://localhost:8006/user/findUserByName/"+name).map((res : Response) => res.json());
// }
public loginUser(user : Login) {
return this._http.post<string>(this._url+"login/",user)}
// .map((res: Response)=>null);}
public findUserByUsername(name : string) {
return this._http.get<User>(this._url+"findUserByName/"+name)}
//.map((res : Response) => res.json());}
// private _url : String = "http://localhost:8001/user";
// currentUser : User;
// constructor(private _http : HttpClient) { }
public showAllUsers(): Observable<User[]> {
return this._http.get<User[]>(this._url + 'showAllUsers');
}
// public showAllUsers() : Observable<User[]> {
// return this._http.get<User[]>(this._url + "/showAllUsers");
// }
public addUser(user: User) {
return this._http.post(this._url + 'addUser/', user);
}
// public searchUser(id : number) : Observable<User> {
// return this._http.get<User>(this._url+"/findUserById/"+id);
// }
public searchUser(userid: number) {
return this._http.get<User>(this._url + 'findUserById/' + userid);
}
// public addUser(user : User) {
// this._http.post(this._url+"/addUser", user);
// }
public updateUser(user: User) {
return this._http.put(this._url + 'update/', user);
}
public loginUser(user: Login) {
return this._http.post<string>(this._url + 'login/', user);
}
public findUserByUsername(name: string) {
return this._http.get<User>(this._url + 'findUserByName/' + name);
}
}

7
UB_UserServiceProxy/src/main/resources/application.properties

@ -1,9 +1,10 @@
server.port=8008
spring.datasource.url=jdbc:mysql://10.3.117.21:3306/grocery_db?createDatabaseIfNotExist=true
server.port=8500
spring.datasource.url=jdbc:mysql://10.3.117.22:3306/grocery_db?createDatabaseIfNotExist=true
spring.datasource.username=testuser
spring.datasource.password=Password123
server.servlet.context-path=/user
server.servlet.context-path=/users
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
spring.jpa.hibernate.ddl-auto=update

94
grocery_db_tables.sql

@ -5,16 +5,16 @@ use grocery_db;
-- Users Table Schema
CREATE TABLE `users` (
`UserID` int(11) NOT NULL AUTO_INCREMENT,
`UserFirstName` varchar(50) DEFAULT NULL,
`UserLastName` varchar(50) DEFAULT NULL,
`UserEmail` varchar(50) DEFAULT NULL,
`UserPassword` varchar(50) DEFAULT NULL,
`UserCity` varchar(50) DEFAULT NULL,
`UserFirstName` varchar(20) DEFAULT NULL,
`UserLastName` varchar(20) DEFAULT NULL,
`UserEmail` varchar(20) DEFAULT NULL,
`UserPassword` varchar(20) DEFAULT NULL,
`UserCity` varchar(30) DEFAULT NULL,
`UserState` varchar(20) DEFAULT NULL,
`UserZip` varchar(12) DEFAULT NULL,
`UserPhone` varchar(20) DEFAULT NULL,
`UserAddress` varchar(100) DEFAULT NULL,
`UserAddress2` varchar(50) DEFAULT NULL,
`UserZip` varchar(6) DEFAULT NULL,
`UserPhone` varchar(10) DEFAULT NULL,
`UserAddress` varchar(80) DEFAULT NULL,
`UserAddress2` varchar(80) DEFAULT NULL,
PRIMARY KEY (`UserID`)
);
@ -36,6 +36,9 @@ insert into users values(
);
select * from users;
-----------------------------------------------------------------------------------------
-- Product-Categories Table Schema
CREATE TABLE IF NOT EXISTS `productcategories` (
`CategoryID` int(11) NOT NULL AUTO_INCREMENT,
@ -53,6 +56,7 @@ INSERT INTO `productcategories` (`CategoryID`, `CategoryName`) VALUES
select * from productcategories;
-----------------------------------------------------------------------------------------
-- Product Table Schema
create table Product(
@ -109,88 +113,68 @@ insert into product values (1007, "Eggs - Regular (12)", 76, 0.150,
select * from product;
-----------------------------------------------------------------------------------------
-- Orders Table Schema
CREATE TABLE IF NOT EXISTS `orders` (
`OrderID` int(11) NOT NULL AUTO_INCREMENT,
`OrderUserID` int(11) NOT NULL,
`UserID` int(11) NOT NULL,
`OrderAmount` float NOT NULL,
`OrderShipAddress` varchar(100) NOT NULL,
`OrderShipAddress2` varchar(100) NOT NULL,
`OrderCity` varchar(50) NOT NULL,
`OrderState` varchar(50) NOT NULL,
`OrderZip` varchar(20) NOT NULL,
`OrderCountry` varchar(50) NOT NULL,
`OrderPhone` varchar(20) NOT NULL,
`OrderShippingCost` float NOT NULL,
`OrderTax` float NOT NULL,
`OrderEmail` varchar(100) NOT NULL,
`OrderDate` date not null,
`OrderShipped` varchar(100) not null,
`OrderShipped` bool not null default false,
`OrderTrackingNumber` varchar(80) DEFAULT NULL,
PRIMARY KEY (`OrderID`)
);
ALTER TABLE orders AUTO_INCREMENT = 1000;
insert into orders values(1000,1,12.5,'indra nagar','panchshill nagar','bhilai','c.g.','490025','india','7896545210',25.3,56.2,'g@gmail.com','2021-09-10','done','456');
insert into orders values(1001,1,12.5,'indra nagar','panchshill nagar','bhilai','c.g.','490025','india','7896545210',25.3,56.2,'g@gmail.com','2021-09-10','done','457');
SELECT * FROM orders;
-----------------------------------------------------------------------------------------
-- Members Table Schema
create table `members`(
`UserID` int(11) NOT NULL,
`MemberID` int(11) not null AUTO_INCREMENT,
`MemberID` int(11) not null AUTO_INCREMENT,
`UserID` int(11) NOT NULL,
`MemberName` varchar(20) not null,
`MemberDoorNumber` int(4) not null,
`TotalItems` int(3) not null default 0,
`MemberPhone` varchar(15) not null,
`MemberTotalAmount` float not null default 0,
`TotalItems` int(4) not null default 0,
`TotalPrice` int(6) not null default 0,
`MemberPhone` varchar(10) not null,
PRIMARY KEY (`MemberID`),
FOREIGN KEY (`UserID`) REFERENCES users(`UserID`)
);
<<<<<<< HEAD
INSERT INTO members VALUES(100, 1, "Abhishek", 501,0,"1234512345", 0);
INSERT INTO members VALUES(100, 2, "Meera", 502,5,"12345234567", 1200);
INSERT INTO members VALUES(100, 3, "Shyam", 503,10,"1234598745", 800);
=======
INSERT INTO members VALUES(100, 1, "Abhishek", 501, 0,"1234512345", 0);
INSERT INTO members VALUES(100, 2, "Meera", 502, 5,"12345234567", 1200);
INSERT INTO members VALUES(100, 3, "Shyam", 503, 10,"1234598745", 800);
>>>>>>> 62466d63e25d717c4d1930484f1053faf246ad32
INSERT INTO members VALUES(1, 100, "Abhis", 501, 0, 0, "1234512345");
INSERT INTO members VALUES(2, 100, "Meera", 502, 0, 0, "1234523456");
INSERT INTO members VALUES(3, 100, "Shyam", 503, 0, 0, "1234598745");
select * from members;
-----------------------------------------------------------------------------------------
-- Cart Table Schema
CREATE TABLE IF NOT EXISTS `cart` (
-- `CartID` int NOT NULL AUTO_INCREMENT,
-- `UserID` int NOT NULL,
-- `OrderID` int NOT NULL,
-- `ProductName` varchar(50) NOT NULL,
-- `ProductPrice` int(5) NOT NULL,
-- `Quantity` int NOT NULL,
-- PRIMARY KEY (`CartID`),
-- FOREIGN KEY (`UserID`) REFERENCES users(`UserID`)
`ProductID` int(12) NOT NULL AUTO_INCREMENT,
`CartID` int NOT NULL AUTO_INCREMENT,
`ProductID` int(12) NOT NULL,
`UserID` int NOT NULL,
`ProductName` varchar(100) NOT NULL,
`ProductPrice` float NOT NULL,
`ProductCategoryID` int(11) DEFAULT NULL,
PRIMARY KEY (`ProductID`),
FOREIGN KEY (`ProductCategoryID`) REFERENCES productcategories(`CategoryID`),
FOREIGN KEY (`UserID`) REFERENCES users(`UserID`)
`ProductCategoryID` int(11) NOT NULL,
PRIMARY KEY (`CartID`),
FOREIGN KEY (`ProductCategoryID`) REFERENCES productcategories(`CategoryID`),
FOREIGN KEY (`UserID`) REFERENCES users(`UserID`)
);
insert into cart values (1001,100,"Potato", 30,2);
select * from cart;
ALTER TABLE cart AUTO_INCREMENT = 1000;
insert into cart values (1001, 1002, 101, 2);
select * from cart;
-----------------------------------------------------------------------------------------
drop user if exists 'testuser';
CREATE USER 'testuser' IDENTIFIED BY 'Password123';
grant all privileges on grocery_db.* to 'testuser'@'%' with grant option;
Loading…
Cancel
Save