Skip to content
Snippets Groups Projects
Commit f7fc6df0 authored by migudel's avatar migudel :speech_balloon:
Browse files

Conflictos II

parent b0737484
No related branches found
No related tags found
2 merge requests!26Revert "Funciona register",!25Dev/angular microservicios
...@@ -5,41 +5,120 @@ import { HotelRegisterComponent } from './core/features/hotel/hotel-register/hot ...@@ -5,41 +5,120 @@ import { HotelRegisterComponent } from './core/features/hotel/hotel-register/hot
import { MainPageComponent } from './core/features/user/main-page/main-page.component'; import { MainPageComponent } from './core/features/user/main-page/main-page.component';
import { BookingListComponent } from './core/features/bookings/booking-list/booking-list.component'; import { BookingListComponent } from './core/features/bookings/booking-list/booking-list.component';
import { UserBookingListComponent } from './core/features/user/user-booking-list/user-booking-list.component'; import { UserBookingListComponent } from './core/features/user/user-booking-list/user-booking-list.component';
import { LoginComponent } from './core/features/auth/login/login.component'; import { LoginComponent } from './core/features/auth/login/login.component';
import { UserFormComponent } from './core/features/user/user-form/user-form.component';
export const routes: Routes = [ export const routes: Routes = [
{ {
path: '', // Ruta principal path: '', // Ruta principal
component: MainPageComponent, // Componente de la página principal component: MainPageComponent,
}, },
// auth
{ {
path: 'bookings/search', path: 'login',
component: BookingListComponent, component: LoginComponent,
}, },
{ {
path: 'bookings/new', path: 'register',
component: BookingComponent,
}, },
// Hoteles
{ {
path: 'users/:id/bookings', path: 'hotels', // Ruta para la lista de hoteles
component: UserBookingListComponent,
}, },
{ {
path: 'hotels', path: 'hotels/register', // Registrar nuevo hotel
component: HotelListComponent,
}, },
{ {
path: 'hotels/new', path: 'hotels/:id', // Hotel concreto
component: HotelRegisterComponent,
}, },
{ {
path: 'hotels/:id', path: 'hotels/:id/edit', // Modificar hotel
component: HotelRegisterComponent, },
// Usuario
{
path: 'me', // Main
},
{
path: 'me/edit', // Main
},
// Usuario HOTEL admin
{
path: 'me/hotels',
},
{
path: 'me/hotels/:id',
}, },
{ {
path: 'auth/login', path: 'auth/login',
component: LoginComponent,
}, },
{
path: 'me/hotels/:id/bookings',
},
{
path: 'me/hotels/:id/rooms',
},
{
path: 'me/hotels/:id/rooms/:id',
},
{
path: 'me/hotels/:id/rooms/:id/bookings',
},
// Usuario Cliente
{
path: 'me/bookings',
},
{
path: 'me/bookings/:id',
},
{
path: 'me/bookings/new',
},
// Administrador
{
path: 'admin', // Main
},
{
path: 'admin/users', // Main
},
{
path: 'admin/users/:id', // Main
},
// ! OTRO // NO MIRAR
// {
// path: 'bookings/search',
// component: BookingListComponent,
// },
// {
// path: 'bookings/new',
// component: BookingComponent,
// },
// {
// path: 'users/:id/bookings',
// component: UserBookingListComponent,
// },
// {
// path: 'hotels',
// component: HotelListComponent,
// },
// {
// path: 'hotels/new',
// component: HotelRegisterComponent,
// },
// {
// path: 'hotels/:id',
// component: HotelRegisterComponent,
// },
// {
// path: 'users/:id',
// component: UserFormComponent,
// },
// {
// path: 'register',
// component: UserFormComponent,
// },
{ {
path: '**', path: '**',
redirectTo: '', redirectTo: '',
......
package com.uva.authentication.models.remote;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.Basic;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Inheritance;
import jakarta.persistence.InheritanceType;
import jakarta.persistence.Table;
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "users")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(nullable = false)
private int id;
@Basic(optional = false)
@Column(nullable = false)
private String name;
@Basic(optional = false)
@Column(nullable = false, unique = true)
private String email;
@JsonIgnore
@Basic(optional = false)
@Column(nullable = false)
private String password;
@Basic(optional = false)
@Column(nullable = false)
@Enumerated(EnumType.STRING)
private UserRol rol = UserRol.CLIENT;
public User() {
}
public User(int id, String name, String email, String password, UserRol rol) {
setId(id);
setName(name);
setEmail(email);
setRol(rol);
}
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return this.email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String rawPassword) {
this.password = rawPassword;
}
public UserRol getRol() {
return this.rol;
}
public void setRol(UserRol rol) {
this.rol = rol;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment