更新实体类对象

This commit is contained in:
YuCheng Hu 2022-10-02 08:31:49 -04:00
parent 8a3bb74af5
commit 965d8830d8
8 changed files with 22 additions and 8 deletions

View File

@ -8,7 +8,7 @@ import java.util.stream.Collectors;
import javax.validation.Valid;
import com.ossez.spring.security.models.ERole;
import com.ossez.spring.security.models.Role;
import com.ossez.spring.security.models.entity.Role;
import com.ossez.spring.security.payload.request.LoginRequest;
import com.ossez.spring.security.payload.request.SignupRequest;
import com.ossez.spring.security.payload.response.JwtResponse;
@ -28,7 +28,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ossez.spring.security.models.User;
import com.ossez.spring.security.models.entity.User;
import com.ossez.spring.security.repository.RoleRepository;
import com.ossez.spring.security.repository.UserRepository;

View File

@ -1,4 +1,6 @@
package com.ossez.spring.security.models;
package com.ossez.spring.security.models.entity;
import com.ossez.spring.security.models.ERole;
import javax.persistence.*;

View File

@ -1,4 +1,4 @@
package com.ossez.spring.security.models;
package com.ossez.spring.security.models.entity;
import java.util.HashSet;
import java.util.Set;

View File

@ -3,7 +3,7 @@ package com.ossez.spring.security.repository;
import java.util.Optional;
import com.ossez.spring.security.models.ERole;
import com.ossez.spring.security.models.Role;
import com.ossez.spring.security.models.entity.Role;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

View File

@ -5,7 +5,7 @@ import java.util.Optional;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.ossez.spring.security.models.User;
import com.ossez.spring.security.models.entity.User;
@Repository
public interface UserRepository extends JpaRepository<User, Long> {

View File

@ -9,7 +9,7 @@ import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import com.ossez.spring.security.models.User;
import com.ossez.spring.security.models.entity.User;
import com.fasterxml.jackson.annotation.JsonIgnore;
public class UserDetailsImpl implements UserDetails {

View File

@ -7,7 +7,7 @@ import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ossez.spring.security.models.User;
import com.ossez.spring.security.models.entity.User;
import com.ossez.spring.security.repository.UserRepository;
@Service

View File

@ -0,0 +1,12 @@
DROP ALL OBJECTS;
CREATE SCHEMA IF NOT EXISTS iOssez;
CREATE TABLE IF NOT EXISTS iOssez.users
(
id INT NOT NULL,
user_name varchar(11) NOT NULL,
user_password varchar(2) NOT NULL,
user_email varchar(2) NOT NULL,
is_email_verified INT NOT NULL
);