Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Back end #10

Open
wants to merge 77 commits into
base: front-end
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
cce6945
BE 4:35
minhkycho18 Apr 22, 2022
1331ef2
23/4/2022 commit BE
minhkycho18 Apr 23, 2022
8040d93
complete registerAPI 24/4/2022
minhkycho18 Apr 24, 2022
0c866cc
update DB SQL code
minhkycho18 Apr 24, 2022
c29a005
create loginAPI 25/4/2022
minhkycho18 Apr 25, 2022
307e967
update loginapi 25/4
minhkycho18 Apr 25, 2022
f883c61
123
minhkycho18 Apr 25, 2022
5c235aa
backend folder
h-vien Apr 26, 2022
de389d1
commit 28/4
minhkycho18 Apr 28, 2022
cfea109
update roleid user while register hotel
minhkycho18 Apr 28, 2022
e04dc81
update Model, fix createdate login
minhkycho18 May 6, 2022
43cc7ea
update Search Hotel, Database, pom.xml, ...
minhkycho18 May 11, 2022
214d340
update database 11/05
minhkycho18 May 11, 2022
cc38d5c
fix register member
h-vien May 11, 2022
8e9faab
fix registermember
h-vien May 12, 2022
701cb42
12/5 fix session manager
minhkycho18 May 12, 2022
b0de5e3
Resolve Conflict
minhkycho18 May 12, 2022
153d135
Update pom.properties
minhkycho18 May 12, 2022
d83e1a9
123
minhkycho18 May 12, 2022
6eebe78
fix 12/5/2022
minhkycho18 May 12, 2022
15fd3ae
update insert_db
nguyenhai02 May 12, 2022
ed469d1
fix: get response login
h-vien May 12, 2022
c4f3d0a
update 13/05/2022
minhkycho18 May 13, 2022
aed50f2
feat: get room by hotel_id & search avaiable room
h-vien May 16, 2022
8d4e5d7
fix pagination & clean code
h-vien May 16, 2022
416f8cc
git ignore
h-vien May 16, 2022
9008df4
git ignore
h-vien May 16, 2022
c56f004
Merge branch 'back-end' of https://github.com/N3iV/PBL3 into back-end
h-vien May 16, 2022
1734895
123
minhkycho18 May 16, 2022
c1c655d
update insert_db
nguyenhai02 May 17, 2022
eb06c47
fix: pagination
h-vien May 17, 2022
95a18eb
fix pagination
h-vien May 17, 2022
c30c659
create order room, fix pagination
minhkycho18 May 17, 2022
e1ca560
Delete fail
nguyenhai02 May 18, 2022
2c71973
Delete fail
nguyenhai02 May 18, 2022
1c3017b
18/5 : fix delete,update room, create api booking
minhkycho18 May 18, 2022
6afa44d
18/5 fix json(1)
minhkycho18 May 18, 2022
0cd0dfd
delete by query id
h-vien May 18, 2022
81dcbd5
Merge pull request #5 from N3iV/front-end
h-vien May 18, 2022
8cff780
resolve conflict
h-vien May 18, 2022
f851ccd
resolve conflict
h-vien May 18, 2022
601b3da
feat/ update profile user
h-vien May 19, 2022
09554d3
Delete hotel-booking-FE directory
minhkycho18 May 19, 2022
7e18378
update shortJson, fix update room,user
minhkycho18 May 19, 2022
e832a75
update history booking, duplicate email while register
minhkycho18 May 19, 2022
7eafa63
fix response register
minhkycho18 May 20, 2022
a257587
.
h-vien May 20, 2022
2c4c55b
Merge branch 'back-end' of https://github.com/N3iV/PBL3 into back-end
h-vien May 20, 2022
0517a33
fix birthday
minhkycho18 May 20, 2022
b1050e5
update status when search hotel, fix output json history booking, add…
minhkycho18 May 23, 2022
7bbbb33
Merge branch 'back-end' of https://github.com/N3iV/PBL3 into back-end
h-vien May 23, 2022
83b9500
update validate Status Booking
minhkycho18 May 25, 2022
a4fe611
Merge branch 'back-end' of https://github.com/N3iV/PBL3 into back-end
h-vien May 25, 2022
15e730d
update total price in booking, remove table receipt, API GET info hot…
minhkycho18 May 25, 2022
1f1e36f
update api change password
minhkycho18 May 25, 2022
80f3c66
set response change password
minhkycho18 May 25, 2022
13b5346
update insertDB
nguyenhai02 May 25, 2022
f6039c5
Merge branch 'back-end' of https://github.com/N3iV/PBL3 into back-end
h-vien May 25, 2022
d7f6e6b
update insertDB, add image hotel, info booking
nguyenhai02 May 25, 2022
d623429
update search booking by status, update add param status in changesta…
minhkycho18 May 26, 2022
cfc7583
Merge branch 'back-end' of https://github.com/N3iV/PBL3 into back-end
h-vien May 29, 2022
22818fc
update insertDB, add more booking
nguyenhai02 May 30, 2022
8cc014d
create GET revenueHotel, update modifiedDate
minhkycho18 May 30, 2022
4852a68
update tickets booked , paid, unpaid in GET revenue
minhkycho18 May 30, 2022
110b489
Merge branch 'back-end' of https://github.com/N3iV/PBL3 into back-end
h-vien May 31, 2022
d3ad529
fix: update status by passing data throughbody
h-vien May 31, 2022
90418e4
fix: Update status by passing data through body
h-vien May 31, 2022
0f22131
fix: Update status by passing data through body
h-vien May 31, 2022
cd989e2
fix tickets
minhkycho18 Jun 1, 2022
a5f60f8
Update insertDB, add booking
nguyenhai02 Jun 2, 2022
20f144a
update hotel
minhkycho18 Jun 9, 2022
6ccf26b
fix remove roomQuantity in PUT updateHotel
minhkycho18 Jun 9, 2022
4655813
add feature sort in searchBookingbyHotelId API + fix updateHotel API
minhkycho18 Jun 10, 2022
dafe8e7
add deadline_date
nguyenhai02 Jun 25, 2022
ee0a3cc
delete province
minhkycho18 Jun 25, 2022
a2e36b8
Merge branch 'back-end' of https://github.com/N3iV/PBL3 into back-end
minhkycho18 Jun 25, 2022
44d9380
update db
minhkycho18 Jul 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.metadata/
/.recommenders/
/Servers
11 changes: 11 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>PBL3</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
28 changes: 28 additions & 0 deletions HotelBookingBE/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
1 change: 1 addition & 0 deletions HotelBookingBE/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target/
37 changes: 37 additions & 0 deletions HotelBookingBE/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>HotelBookingBE</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>
13 changes: 13 additions & 0 deletions HotelBookingBE/.settings/.jsdtscope
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/webapp"/>
<classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="target/m2e-wtp/web-resources"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
<attributes>
<attribute name="hide" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/>
</classpath>
6 changes: 6 additions & 0 deletions HotelBookingBE/.settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
eclipse.preferences.version=1
encoding//database/insert_db.sql=UTF-8
encoding//src/main/java/com/HotelBookingBE/controller/api/BookingApi.java=UTF-8
encoding//src/main/java/com/HotelBookingBE/controller/api/HotelApi.java=UTF-8
encoding//src/main/java/com/HotelBookingBE/controller/api/HotelRoomApi.java=UTF-8
encoding//src/main/java/com/HotelBookingBE/controller/api/UserApi.java=UTF-8
9 changes: 9 additions & 0 deletions HotelBookingBE/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
4 changes: 4 additions & 0 deletions HotelBookingBE/.settings/org.eclipse.m2e.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
10 changes: 10 additions & 0 deletions HotelBookingBE/.settings/org.eclipse.wst.common.component
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="HotelBookingBE-1.0">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<property name="context-root" value="HotelBookingBE"/>
<property name="java-output-path" value="/HotelBookingBE/target/classes"/>
</wb-module>
</project-modules>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="wst.jsdt.web"/>
<installed facet="wst.jsdt.web" version="1.0"/>
<installed facet="java" version="1.8"/>
<installed facet="jst.web" version="3.0"/>
</faceted-project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.eclipse.wst.jsdt.launching.baseBrowserLibrary
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Window
2 changes: 2 additions & 0 deletions HotelBookingBE/.settings/org.eclipse.wst.validation.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
disabled=06target
eclipse.preferences.version=1
97 changes: 97 additions & 0 deletions HotelBookingBE/database/create_db.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
use hotelbookingdb;
CREATE TABLE role(
id bigint NOT NULL PRIMARY KEY auto_increment,
name VARCHAR(100) NOT NULL
);
CREATE TABLE user(
id bigint NOT NULL PRIMARY KEY auto_increment,
username VARCHAR(150) NULL,
password VARCHAR(150) NOT NULL,
firstname VARCHAR(150) NOT NULL,
lastname VARCHAR(150) NOT NULL,
birthday timestamp null,
image TEXT NULL,
gender bool NULL,
phonenumber VARCHAR(100) NULL,
email VARCHAR(200) NOT NULL,
roleid bigint NOT NULL,
createddate TIMESTAMP NULL,
modifieddate TIMESTAMP NULL
);
CREATE TABLE hotel(
id bigint NOT NULL PRIMARY KEY auto_increment,
user_id bigint NOT NULL,
province_id bigint not null,
hotel_name VARCHAR(200) NOT NULL,
hotel_desc TEXT NULL,
hotel_address VARCHAR(200) NOT NULL,
hotel_phone VARCHAR(50) NULL,
hotel_email varchar(150) NULL,
room_quantity bigint NOT NULL,
image TEXT NULL,
createddate TIMESTAMP NULL,
modifieddate TIMESTAMP NULL
);
CREATE TABLE typeroom(
id bigint NOT NULL PRIMARY KEY auto_increment,
name VARCHAR(100) NOT NULL

);
CREATE TABLE hotelroom(
id bigint NOT NULL PRIMARY KEY auto_increment,
hotel_id bigint NOT NULL,
type_id bigint NOT NULL,
name varchar(255) NOT NULL,
bed_quantity bigint not null,
price bigint NOT NULL,
description TEXT NULL,
image TEXT NULL,
createddate TIMESTAMP NULL,
modifieddate TIMESTAMP NULL
);
CREATE TABLE booking(
id bigint NOT NULL PRIMARY KEY auto_increment,
room_id bigint NOT NULL,
user_id bigint NOT NULL,
hotel_id bigint NOT NULL,
fullName varchar(200) NULL,
phonenumber varchar(50) null,
cccd varchar(50) null,
email varchar(100) null,
birthday timestamp null,
status int null,
totalprice bigint NULL,
checkin_date TIMESTAMP NULL,
checkout_date TIMESTAMP NULL,
deadline_date TIMESTAMP NULL,
createddate TIMESTAMP NULL,
modifieddate TIMESTAMP NULL
);
CREATE TABLE province (
id bigint primary key not null auto_increment,
name varchar(100)
);

ALTER TABLE user ADD CONSTRAINT fk_user_role FOREIGN KEY (roleid) REFERENCES role(id);


ALTER TABLE hotel ADD CONSTRAINT fk_hotel_user FOREIGN KEY (user_id) REFERENCES user(id);
ALTER TABLE hotel ADD CONSTRAINT fk_hotel_province FOREIGN KEY (province_id) REFERENCES province(id);


ALTER TABLE hotelroom ADD CONSTRAINT fk_hotelroom_hotel FOREIGN KEY (hotel_id) REFERENCES hotel(id);
ALTER TABLE hotelroom ADD CONSTRAINT fk_hotelroom_typeroom FOREIGN KEY (type_id) REFERENCES typeroom(id);


ALTER TABLE booking ADD CONSTRAINT fk_booking_hotelroom FOREIGN KEY (room_id) REFERENCES hotelroom(id);
ALTER TABLE booking ADD CONSTRAINT fk_booking_user FOREIGN KEY (user_id) REFERENCES user(id);
ALTER TABLE booking ADD CONSTRAINT fk_booking_hotel FOREIGN KEY (hotel_id) REFERENCES hotel(id);









Loading