-
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
f4af5d0
commit a0fd9e1
Showing
10 changed files
with
81 additions
and
34 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
12 changes: 4 additions & 8 deletions
12
src/main/java/com/example/springbootbookshop/dto/UserDto.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,12 +1,8 @@ | ||
package com.example.springbootbookshop.dto; | ||
|
||
import com.example.springbootbookshop.entity.Role; | ||
import java.util.Set; | ||
|
||
public record UserDto(Long id, | ||
String email, | ||
String firstName, | ||
String lastName, | ||
String shippingAddress, | ||
Set<Role> roles) { | ||
String email, | ||
String firstName, | ||
String lastName, | ||
String shippingAddress) { | ||
} |
5 changes: 4 additions & 1 deletion
5
src/main/java/com/example/springbootbookshop/dto/UserRegisterResponseDto.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,5 +1,8 @@ | ||
package com.example.springbootbookshop.dto; | ||
|
||
public record UserRegisterResponseDto(Long id, | ||
String email) { | ||
String email, | ||
String firstName, | ||
String lastName, | ||
String shippingAddress) { | ||
} |
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
4 changes: 2 additions & 2 deletions
4
src/main/java/com/example/springbootbookshop/service/UserService.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,10 @@ | ||
package com.example.springbootbookshop.service; | ||
|
||
import com.example.springbootbookshop.dto.UserRegisterResponseDto; | ||
import com.example.springbootbookshop.dto.UserDto; | ||
import com.example.springbootbookshop.dto.UserRegistrationRequestDto; | ||
import com.example.springbootbookshop.exception.RegistrationException; | ||
|
||
public interface UserService { | ||
UserRegisterResponseDto register(UserRegistrationRequestDto requestDto) | ||
UserDto register(UserRegistrationRequestDto requestDto) | ||
throws RegistrationException; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,4 @@ databaseChangeLog: | |
name: shipping_address | ||
type: VARCHAR(255) | ||
constraints: | ||
nullable: true | ||
nullable: true |
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
38 changes: 38 additions & 0 deletions
38
src/main/resources/db/changelog/changes/04-create-users-roles.yaml
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,38 @@ | ||
databaseChangeLog: | ||
- changeSet: | ||
id: create-roles-users-junction-table | ||
author: your-author-name | ||
changes: | ||
- createTable: | ||
tableName: users_roles | ||
columns: | ||
- column: | ||
name: user_role_id | ||
type: BIGINT | ||
autoIncrement: true | ||
constraints: | ||
primaryKey: true | ||
- column: | ||
name: role_id | ||
type: BIGINT | ||
constraints: | ||
foreignKeyName: FK_role_id | ||
- column: | ||
name: user_id | ||
type: BIGINT | ||
constraints: | ||
foreignKeyName: FK_user_id | ||
|
||
- addForeignKeyConstraint: | ||
baseTableName: users_roles | ||
baseColumnNames: user_id | ||
referencedTableName: roles | ||
referencedColumnNames: id | ||
constraintName: FK_role_id | ||
|
||
- addForeignKeyConstraint: | ||
baseTableName: users_roles | ||
baseColumnNames: user_id | ||
referencedTableName: users | ||
referencedColumnNames: id | ||
constraintName: FK_user_id |
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