├── AngularFront
├── src
│ ├── assets
│ │ ├── .gitkeep
│ │ └── images
│ │ │ └── placeholder.png
│ ├── app
│ │ ├── app.component.css
│ │ ├── app.component.html
│ │ ├── app.config.ts
│ │ ├── app.component.spec.ts
│ │ ├── app.component.ts
│ │ └── app.routes.ts
│ ├── components
│ │ ├── user-list
│ │ │ ├── user-list.component.css
│ │ │ ├── user-list.component.html
│ │ │ ├── user-list.component.spec.ts
│ │ │ └── user-list.component.ts
│ │ ├── change-user-info
│ │ │ ├── change-user-info.component.css
│ │ │ ├── change-user-info.component.spec.ts
│ │ │ ├── change-user-info.component.html
│ │ │ └── change-user-info.component.ts
│ │ ├── main-page
│ │ │ ├── main-page.component.html
│ │ │ ├── main-page.component.css
│ │ │ ├── main-page.component.spec.ts
│ │ │ └── main-page.component.ts
│ │ ├── header
│ │ │ ├── header.component.html
│ │ │ ├── header.component.css
│ │ │ ├── header.component.spec.ts
│ │ │ └── header.component.ts
│ │ ├── interest-profile
│ │ │ ├── interest-profile.component.html
│ │ │ ├── interest-profile.component.css
│ │ │ ├── interest-profile.component.spec.ts
│ │ │ └── interest-profile.component.ts
│ │ ├── user-info-for-list
│ │ │ ├── user-info-for-list.component.css
│ │ │ ├── user-info-for-list.component.html
│ │ │ ├── user-info-for-list.component.spec.ts
│ │ │ └── user-info-for-list.component.ts
│ │ ├── profile
│ │ │ ├── profile.component.html
│ │ │ ├── profile.component.spec.ts
│ │ │ ├── profile.component.css
│ │ │ └── profile.component.ts
│ │ ├── interests
│ │ │ ├── interests.component.spec.ts
│ │ │ ├── interests.component.html
│ │ │ ├── interests.component.css
│ │ │ └── interests.component.ts
│ │ ├── registration
│ │ │ ├── registration.component.spec.ts
│ │ │ ├── registration.component.css
│ │ │ ├── registration.component.html
│ │ │ └── registration.component.ts
│ │ ├── authorization
│ │ │ ├── authorization.component.html
│ │ │ ├── authorization.component.spec.ts
│ │ │ ├── authorization.component.css
│ │ │ └── authorization.component.ts
│ │ ├── post-user-info
│ │ │ ├── post-user-info.component.spec.ts
│ │ │ ├── post-user-info.component.css
│ │ │ ├── post-user-info.component.ts
│ │ │ └── post-user-info.component.html
│ │ └── welcome-information
│ │ │ ├── welcome-information.component.spec.ts
│ │ │ └── welcome-information.component.ts
│ ├── styles.css
│ ├── favicon.ico
│ ├── DTO
│ │ ├── InterestDTO.ts
│ │ └── UserInfoDTO.ts
│ ├── main.ts
│ ├── index.html
│ ├── services
│ │ ├── user-info
│ │ │ ├── user.service.spec.ts
│ │ │ └── user.service.ts
│ │ ├── interests
│ │ │ ├── interests.service.spec.ts
│ │ │ └── interests.service.ts
│ │ └── authorization
│ │ │ ├── authorization.service.spec.ts
│ │ │ └── authorization.service.ts
│ └── interceptors
│ │ └── jwt.interceptor.ts
├── tsconfig.app.json
├── tsconfig.spec.json
├── .editorconfig
├── tsconfig.json
├── README.md
├── package.json
└── angular.json
├── frontend
├── src
│ ├── components
│ │ ├── user-list
│ │ │ ├── user-list.css
│ │ │ └── user-list.js
│ │ ├── App.test.js
│ │ ├── user-info-for-list
│ │ │ ├── user-info-for-list.css
│ │ │ └── user-info-for-list.js
│ │ ├── main-page
│ │ │ ├── main-page.css
│ │ │ └── main-page.js
│ │ ├── header
│ │ │ ├── header.css
│ │ │ └── header.js
│ │ ├── App.css
│ │ ├── authorization
│ │ │ ├── authorization.css
│ │ │ └── authorization.js
│ │ ├── profile
│ │ │ ├── profile.css
│ │ │ └── profile.js
│ │ ├── registration
│ │ │ ├── registration.css
│ │ │ └── registration.js
│ │ ├── post-user-info
│ │ │ ├── post-user-info.css
│ │ │ └── post-user-info.js
│ │ ├── App.js
│ │ ├── interest-profile
│ │ │ └── interest-profile.js
│ │ └── interests
│ │ │ └── interests.css
│ ├── setupTests.js
│ ├── index.css
│ ├── reportWebVitals.js
│ ├── index.js
│ ├── services
│ │ ├── authorizationService.js
│ │ ├── userService.js
│ │ └── interestService.js
│ └── logo.svg
├── public
│ ├── robots.txt
│ ├── favicon.ico
│ ├── logo192.png
│ ├── logo512.png
│ ├── manifest.json
│ └── index.html
├── .gitignore
├── package.json
└── README.md
├── spring.png
├── JSP
├── .mvn
│ └── wrapper
│ │ ├── maven-wrapper.jar
│ │ └── maven-wrapper.properties
├── src
│ └── main
│ │ ├── webapp
│ │ ├── stylesheets
│ │ │ ├── userlist.css
│ │ │ └── common.css
│ │ ├── WEB-INF
│ │ │ └── web.xml
│ │ ├── addfriend.jsp
│ │ ├── index.jsp
│ │ ├── userlist.jsp
│ │ ├── friends.jsp
│ │ ├── sign_in.jsp
│ │ ├── registration.jsp
│ │ └── profile.jsp
│ │ └── resources
│ │ └── META-INF
│ │ ├── beans.xml
│ │ └── persistence.xml
└── pom.xml
├── dataAboutDB
├── DBForInternship.drawio.png
└── schema
├── JDBC
├── target
│ └── classes
│ │ ├── org
│ │ └── example
│ │ │ ├── Main.class
│ │ │ └── DBFunctions.class
│ │ └── log4j2.xml
├── src
│ └── main
│ │ ├── java
│ │ └── org
│ │ │ └── example
│ │ │ ├── Main.java
│ │ │ ├── data
│ │ │ ├── ContactType.java
│ │ │ ├── RelationType.java
│ │ │ ├── Contact.java
│ │ │ ├── Authorization.java
│ │ │ ├── Relation.java
│ │ │ └── Constants.java
│ │ │ ├── DBFunctions.java
│ │ │ └── Menu.java
│ │ └── resources
│ │ └── log4j2.xml
└── pom.xml
├── SpringHibernate
├── .mvn
│ └── wrapper
│ │ ├── maven-wrapper.jar
│ │ └── maven-wrapper.properties
├── src
│ ├── main
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── springhibernate
│ │ │ │ ├── service
│ │ │ │ ├── ContService.java
│ │ │ │ ├── RelService.java
│ │ │ │ ├── InterService.java
│ │ │ │ ├── UDService.java
│ │ │ │ └── impl
│ │ │ │ │ ├── ContactService.java
│ │ │ │ │ ├── UserService.java
│ │ │ │ │ └── AuthenticationService.java
│ │ │ │ ├── model
│ │ │ │ ├── Role.java
│ │ │ │ ├── RelationType.java
│ │ │ │ ├── Interest.java
│ │ │ │ ├── ContactType.java
│ │ │ │ ├── Contact.java
│ │ │ │ ├── Pair.java
│ │ │ │ ├── UserData.java
│ │ │ │ └── Authorization.java
│ │ │ │ ├── DTO
│ │ │ │ ├── ContactDTO.java
│ │ │ │ ├── RelationDTO.java
│ │ │ │ ├── InterestDTO.java
│ │ │ │ ├── UserDTO.java
│ │ │ │ ├── JwtAuthenticationResponse.java
│ │ │ │ ├── SignInRequest.java
│ │ │ │ └── SignUpRequest.java
│ │ │ │ ├── repository
│ │ │ │ ├── RelationTypeRepository.java
│ │ │ │ ├── InterestRepository.java
│ │ │ │ ├── ContactRepository.java
│ │ │ │ ├── UserDataRepository.java
│ │ │ │ ├── UserRepository.java
│ │ │ │ └── PairRepository.java
│ │ │ │ ├── SpringHibernateApplication.java
│ │ │ │ ├── controller
│ │ │ │ ├── RelationController.java
│ │ │ │ ├── AuthController.java
│ │ │ │ ├── UserDataController.java
│ │ │ │ ├── InterestController.java
│ │ │ │ └── ContactController.java
│ │ │ │ └── JwtAuthenticationFilter.java
│ │ └── resources
│ │ │ ├── static
│ │ │ └── index.html
│ │ │ └── application.yaml
│ └── test
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── springhibernate
│ │ └── SpringHibernateApplicationTests.java
└── .gitignore
├── .idea
├── vcs.xml
├── .gitignore
├── dataSources.xml
├── misc.xml
└── encodings.xml
├── .github
└── workflows
│ └── build.yml
├── .gitignore
├── README.md
└── pom.xml
/AngularFront/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/AngularFront/src/app/app.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/frontend/src/components/user-list/user-list.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/AngularFront/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
{{ interest.titleOfType }}
7 |No users found.
11 |We're thrilled to have you join our community!
11 |Start exploring and connecting with amazing people.
12 |{ user.description }
20 |Возраст: { user.age }
21 |Пол: { user.gender ? 'Мужской' : 'Женский' }
22 |No users found.
41 |{interest.titleOfType}
31 |{errorMessage}
} 46 |58 | * Нужен для Spring Security 59 | * 60 | * @return пользователь 61 | */ 62 | public UserDetailsService userDetailsService() { 63 | return this::getByUsername; 64 | } 65 | 66 | /** 67 | * Получение текущего пользователя 68 | * 69 | * @return текущий пользователь 70 | */ 71 | public Authorization getCurrentUser() { 72 | // Получение имени пользователя из контекста Spring Security 73 | var username = SecurityContextHolder.getContext().getAuthentication().getName(); 74 | return getByUsername(username); 75 | } 76 | 77 | 78 | /** 79 | * Выдача прав администратора текущему пользователю 80 | *
81 | * Нужен для демонстрации 82 | */ 83 | @Deprecated 84 | public void getAdmin() { 85 | var user = getCurrentUser(); 86 | user.setRole(Role.ADMIN_ROLE); 87 | save(user); 88 | } 89 | } -------------------------------------------------------------------------------- /JSP/src/main/webapp/profile.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="org.example.crud.CRUDContact" %> 2 | <%@page import="org.example.data.Contact" %> 3 | <%@page import="org.example.crud.CRUDAuthorization" %> 4 | <%@page import="org.example.data.Authorization" %> 5 | <%@page import="java.util.List" %> 6 | <%@ page import="org.example.data.ContactType" %> 7 | <%@ page import="org.example.DBFunctions" %> 8 | <%@ page import="java.sql.Connection" %> 9 | <%@ page import="java.sql.PreparedStatement" %> 10 | <%@ page import="java.sql.SQLException" %> 11 | <%@ page import="java.sql.ResultSet" %> 12 | <%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> 13 | 14 | 15 | 16 |
17 |{user.description}
55 |Age: {user.age}
56 |Gender: {user.gender ? 'male' : 'female'}
57 |