This repository has been archived by the owner on Jun 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
246ce26
commit 22592fc
Showing
31 changed files
with
382 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
drop database flightmanagement; | ||
create database flightmanagement; | ||
USE `flightmanagement`; | ||
CREATE TABLE IF NOT EXISTS `user` ( | ||
`user_id` int(11) NULL AUTO_INCREMENT, | ||
`user_id` BIGINT NULL AUTO_INCREMENT, | ||
`username` varchar(50) NOT NULL, | ||
`password` varchar(255) NOT NULL, | ||
`email` varchar(100) NULL, | ||
|
@@ -24,4 +26,16 @@ VALUES ( | |
'admin', | ||
'[email protected]', | ||
15 | ||
); | ||
); | ||
CREATE TABLE IF NOT EXISTS `airline` ( | ||
`airline_id` BIGINT NULL AUTO_INCREMENT, | ||
`user_id` BIGINT NOT NULL, | ||
`airline_name` varchar(100) NOT NULL, | ||
`airline_country` varchar(100) NOT NULL, | ||
`airline_code` varchar(10) NOT NULL, | ||
`airline_description` varchar(255) NULL, | ||
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
PRIMARY KEY (`airline_id`), | ||
FOREIGN KEY (`user_id`) REFERENCES `user`(`user_id`) | ||
) ENGINE = InnoDB DEFAULT CHARSET = utf8; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
src/main/java/com/sakurapuare/flightmanagement/mapper/AirlineMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
package com.sakurapuare.flightmanagement.mapper; | ||
|
||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
import com.sakurapuare.flightmanagement.pojo.entity.Airline; | ||
import com.sakurapuare.flightmanagement.pojo.entity.user.Airline; | ||
import org.apache.ibatis.annotations.Mapper; | ||
|
||
@Mapper | ||
public interface AirlineMapper extends BaseMapper<Airline> { | ||
|
||
default Airline findAirlineByAirlineCode(String airlineCode) { | ||
return this.selectOne( | ||
new QueryWrapper<Airline>() | ||
.eq("airline_code", airlineCode)); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/main/java/com/sakurapuare/flightmanagement/mapper/MerchantMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/com/sakurapuare/flightmanagement/mapper/PassengerMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/com/sakurapuare/flightmanagement/mapper/StaffMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
src/main/java/com/sakurapuare/flightmanagement/pojo/dto/auth/login/UserLoginDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
package com.sakurapuare.flightmanagement.pojo.dto.auth.login; | ||
|
||
import jakarta.validation.constraints.NotBlank; | ||
import lombok.Data; | ||
|
||
@Data | ||
public class UserLoginDTO { | ||
@NotBlank(message = "Username is required") | ||
String username; | ||
@NotBlank(message = "Password is required") | ||
String password; | ||
} |
7 changes: 0 additions & 7 deletions
7
...main/java/com/sakurapuare/flightmanagement/pojo/dto/auth/register/AirlineRegisterDTO.java
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
...ain/java/com/sakurapuare/flightmanagement/pojo/dto/auth/register/BaseUserRegisterDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.sakurapuare.flightmanagement.pojo.dto.auth.register; | ||
|
||
import jakarta.validation.constraints.Email; | ||
import jakarta.validation.constraints.NotBlank; | ||
import lombok.Data; | ||
|
||
@Data | ||
public class BaseUserRegisterDTO { | ||
@NotBlank(message = "Username is required") | ||
public String username; | ||
|
||
@NotBlank(message = "Password is required") | ||
public String password; | ||
|
||
@Email(message = "Email is invalid") | ||
public String email; | ||
|
||
// @Size(min = 0, max = UserType.ALL, message = "Role is invalid") | ||
// public int role; | ||
} |
5 changes: 0 additions & 5 deletions
5
...ain/java/com/sakurapuare/flightmanagement/pojo/dto/auth/register/MerchantRegisterDTO.java
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
...in/java/com/sakurapuare/flightmanagement/pojo/dto/auth/register/PassengerRegisterDTO.java
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
src/main/java/com/sakurapuare/flightmanagement/pojo/dto/auth/register/StaffRegisterDTO.java
This file was deleted.
Oops, something went wrong.
17 changes: 4 additions & 13 deletions
17
src/main/java/com/sakurapuare/flightmanagement/pojo/dto/auth/register/UserRegisterDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,10 @@ | ||
package com.sakurapuare.flightmanagement.pojo.dto.auth.register; | ||
|
||
import com.sakurapuare.flightmanagement.constant.UserType; | ||
import jakarta.validation.constraints.Email; | ||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.Size; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.Data; | ||
|
||
@Data | ||
public class UserRegisterDTO { | ||
@NotBlank(message = "Username is required") | ||
public String username; | ||
@NotBlank(message = "Password is required") | ||
public String password; | ||
@Email(message = "Email is invalid") | ||
public String email; | ||
@Size(min = 0, max = UserType.ALL, message = "Role is invalid") | ||
public int role; | ||
public class UserRegisterDTO<T> extends BaseUserRegisterDTO { | ||
@NotNull(message = "Merchant info is required") | ||
T data; | ||
} |
16 changes: 0 additions & 16 deletions
16
src/main/java/com/sakurapuare/flightmanagement/pojo/entity/Airline.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.