JAP 설정및 로그인 테이블 연결
This commit is contained in:
parent
940a0320b3
commit
001bba7cb1
|
|
@ -2,6 +2,7 @@
|
|||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<annotationProcessing>
|
||||
<profile default="true" name="Default" enabled="true" />
|
||||
<profile name="Maven default annotation processors profile" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
|
|
|
|||
|
|
@ -1,13 +1,25 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
||||
<data-source source="LOCAL" name="profile@leejk0523.com" uuid="48fe1c90-2c8b-4422-ab16-143a998890c0">
|
||||
<data-source source="LOCAL" name="pub@127.0.0.1" uuid="48fe1c90-2c8b-4422-ab16-143a998890c0">
|
||||
<driver-ref>mariadb</driver-ref>
|
||||
<synchronize>true</synchronize>
|
||||
<imported>true</imported>
|
||||
<remarks>$PROJECT_DIR$/java/src/main/resources/application.properties</remarks>
|
||||
<jdbc-driver>org.mariadb.jdbc.Driver</jdbc-driver>
|
||||
<jdbc-url>jdbc:mariadb://leejk0523.com:3306/profile</jdbc-url>
|
||||
<jdbc-url>jdbc:mariadb://localhost:3306/pub</jdbc-url>
|
||||
<jdbc-additional-properties>
|
||||
<property name="com.intellij.clouds.kubernetes.db.host.port" />
|
||||
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
|
||||
<property name="com.intellij.clouds.kubernetes.db.container.port" />
|
||||
</jdbc-additional-properties>
|
||||
<working-dir>$ProjectFileDir$</working-dir>
|
||||
</data-source>
|
||||
<data-source source="LOCAL" name="pub@192.168.3.233" uuid="512e8006-8886-4e3d-8b8b-c94f7b42abc2">
|
||||
<driver-ref>mariadb</driver-ref>
|
||||
<synchronize>true</synchronize>
|
||||
<jdbc-driver>org.mariadb.jdbc.Driver</jdbc-driver>
|
||||
<jdbc-url>jdbc:mariadb://192.168.3.233:3306/pub</jdbc-url>
|
||||
<jdbc-additional-properties>
|
||||
<property name="com.intellij.clouds.kubernetes.db.host.port" />
|
||||
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
|
||||
|
|
|
|||
|
|
@ -2,5 +2,6 @@
|
|||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/java/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/java/target/generated-sources/java" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/java_vue.iml" filepath="$PROJECT_DIR$/.idea/java_vue.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/java/javavue.iml" filepath="$PROJECT_DIR$/java/javavue.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
62
java/pom.xml
62
java/pom.xml
|
|
@ -1,36 +1,27 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.3.5</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
|
||||
<groupId>com.leejk0523</groupId>
|
||||
<artifactId>javavue</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<packaging>war</packaging>
|
||||
<name>javavue</name>
|
||||
<description>javavue</description>
|
||||
<url/>
|
||||
<licenses>
|
||||
<license/>
|
||||
</licenses>
|
||||
<developers>
|
||||
<developer/>
|
||||
</developers>
|
||||
<scm>
|
||||
<connection/>
|
||||
<developerConnection/>
|
||||
<tag/>
|
||||
<url/>
|
||||
</scm>
|
||||
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!-- Spring Boot Dependencies -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||
|
|
@ -39,24 +30,48 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web-services</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mariadb.jdbc</groupId>
|
||||
<artifactId>mariadb-java-client</artifactId>
|
||||
<scope>runtime</scope>
|
||||
<!-- <version>3.1.2</version>-->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
<groupId>jakarta.validation</groupId>
|
||||
<artifactId>jakarta.validation-api</artifactId>
|
||||
<!-- <version>3.1.0</version>-->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<!-- <version>1.18.24</version>-->
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.querydsl</groupId>
|
||||
<artifactId>querydsl-jpa</artifactId>
|
||||
<version>5.0.0</version>
|
||||
<classifier>jakarta</classifier>
|
||||
</dependency>
|
||||
<!-- QueryDSL Annotation Processor -->
|
||||
<dependency>
|
||||
<groupId>com.querydsl</groupId>
|
||||
<artifactId>querydsl-apt</artifactId>
|
||||
<version>5.0.0</version>
|
||||
<classifier>jakarta</classifier>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<defaultGoal>package</defaultGoal>
|
||||
<directory>${basedir}/target</directory>
|
||||
<finalName>javavue</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
|
@ -64,5 +79,4 @@
|
|||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
@ -5,9 +5,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|||
|
||||
@SpringBootApplication
|
||||
public class JavavueApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(JavavueApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
package com.leejk0523.javavue.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
@Configuration
|
||||
public class WebConfig {
|
||||
// @Bean
|
||||
// public WebMvcConfigurer corsConfigurer() {
|
||||
// return new WebMvcConfigurer() {
|
||||
// @Override
|
||||
// public void addCorsMappings(@Nullable CorsRegistry registry) {
|
||||
// if (registry != null) {
|
||||
// registry.addMapping("/api/**")
|
||||
// .allowedOrigins("http://localhost:8080")
|
||||
// .allowedMethods("GET", "POST", "PUT", "DELETE")
|
||||
// .allowedHeaders("*")
|
||||
// .allowCredentials(true);
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
// }
|
||||
}
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
package com.leejk0523.javavue.controller;
|
||||
|
||||
import com.leejk0523.javavue.entity.UserProfile;
|
||||
import com.leejk0523.javavue.repository.UserProfileRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api")
|
||||
public class UserProfileController {
|
||||
|
||||
@Autowired
|
||||
private UserProfileRepository userProfileRepository;
|
||||
|
||||
@GetMapping("")
|
||||
public String test() {
|
||||
return "Hello World!";
|
||||
}
|
||||
|
||||
@GetMapping("/all")
|
||||
public List<UserProfile> getAllUsers() {
|
||||
|
||||
return userProfileRepository.findAll();
|
||||
}
|
||||
|
||||
// 특정 ID로 사용자 조회
|
||||
@GetMapping("/{id}")
|
||||
public UserProfile getUserById(@PathVariable String id) {
|
||||
|
||||
return userProfileRepository.findById(id)
|
||||
.orElseThrow(() -> new RuntimeException("사용자를 찾을 수 없습니다."));
|
||||
}
|
||||
|
||||
// 이름으로 사용자 조회
|
||||
@GetMapping("/name/{name}")
|
||||
public List<UserProfile> getUsersByName(@PathVariable String name) {
|
||||
|
||||
return userProfileRepository.findByName(name);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public UserProfile createUser(@RequestBody UserProfile user) {
|
||||
|
||||
return userProfileRepository.save(user);
|
||||
}
|
||||
|
||||
@PutMapping("/{id}")
|
||||
public UserProfile updateUser(@PathVariable String id, @RequestBody UserProfile userDetails) {
|
||||
UserProfile userProfile = userProfileRepository.findById(id).orElseThrow();
|
||||
userProfile.setName(userDetails.getName());
|
||||
userProfile.setPhone(userDetails.getPhone());
|
||||
userProfile.setAddress(userDetails.getAddress());
|
||||
|
||||
return userProfileRepository.save(userProfile);
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public void deleteUser(@PathVariable String id) {
|
||||
|
||||
userProfileRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
package com.leejk0523.javavue.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "UserProfile") // 테이블 이름을 명시적으로 설정
|
||||
public class UserProfile {
|
||||
@Id
|
||||
@Column(name = "id", length = 100)
|
||||
private String id;
|
||||
|
||||
@Column(name = "name", length = 100)
|
||||
private String name;
|
||||
|
||||
@Column(name = "phone", length = 100)
|
||||
private String phone;
|
||||
|
||||
@Column(name = "address", length = 100)
|
||||
private String address;
|
||||
|
||||
@Column(name = "filepath", length = 100)
|
||||
private String filepath;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getFilepath() {
|
||||
return filepath;
|
||||
}
|
||||
|
||||
public void setFilepath(String filepath) {
|
||||
this.filepath = filepath;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.leejk0523.javavue.login.controller;
|
||||
|
||||
import com.leejk0523.javavue.login.service.UserLoginService;
|
||||
import com.leejk0523.javavue.login.vo.In;
|
||||
import com.leejk0523.javavue.login.vo.Member;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
public class UserLoginController {
|
||||
private final UserLoginService userLoginService;
|
||||
|
||||
@PostMapping("/api/login")
|
||||
private ResponseEntity<Member> login(@RequestBody In in) {
|
||||
final var authorization = userLoginService.login(in);
|
||||
|
||||
if (Objects.isNull(authorization)) {
|
||||
return ResponseEntity.status(HttpStatus.UNAUTHORIZED).build();
|
||||
}
|
||||
|
||||
return ResponseEntity.ok(authorization);
|
||||
}
|
||||
|
||||
@GetMapping("/api/test")
|
||||
public String test() {
|
||||
return "Hello World!";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
package com.leejk0523.javavue.login.dao;
|
||||
|
||||
import com.leejk0523.javavue.login.vo.AdminMember;
|
||||
import com.leejk0523.javavue.login.vo.DefaultMember;
|
||||
import com.leejk0523.javavue.login.vo.In;
|
||||
import com.leejk0523.javavue.login.vo.Member;
|
||||
import com.leejk0523.javavue.model.AsaAdminMember;
|
||||
import com.leejk0523.javavue.model.QAsaAdminMember;
|
||||
import com.leejk0523.javavue.model.QIstInst;
|
||||
import com.querydsl.core.types.Projections;
|
||||
|
||||
import org.springframework.data.jpa.repository.support.QuerydslRepositorySupport;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
||||
@Component
|
||||
public class UserLoginDao extends QuerydslRepositorySupport {
|
||||
public UserLoginDao() {
|
||||
super(AsaAdminMember.class);
|
||||
}
|
||||
|
||||
public Member findByMemberId(In in) {
|
||||
QAsaAdminMember asaAdminMember = QAsaAdminMember.asaAdminMember;
|
||||
QIstInst inst = QIstInst.istInst;
|
||||
|
||||
return from(asaAdminMember)
|
||||
.innerJoin(inst).on(asaAdminMember.instNo.eq(inst.instNo))
|
||||
.select(Projections.bean(
|
||||
AdminMember.class,
|
||||
asaAdminMember.adminId.as("memberId"),
|
||||
asaAdminMember.adminName.as("memberName"),
|
||||
asaAdminMember.adminPassword.as("memberPassword"),
|
||||
asaAdminMember.useYn.as("memberEnabled"),
|
||||
asaAdminMember.adminLoginFailCount.as("memberFailureCount"),
|
||||
asaAdminMember.adminLock.as("memberLocked"),
|
||||
asaAdminMember.instNo.as("instNo"),
|
||||
asaAdminMember.adminDepartment.as("deptNm"),
|
||||
inst.instNm
|
||||
))
|
||||
.where(asaAdminMember.adminId.eq(in.getMemberId()))
|
||||
.fetchOne();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.leejk0523.javavue.login.service;
|
||||
|
||||
import ch.qos.logback.core.net.SyslogOutputStream;
|
||||
import com.leejk0523.javavue.login.dao.UserLoginDao;
|
||||
import com.leejk0523.javavue.login.vo.In;
|
||||
import com.leejk0523.javavue.login.vo.Member;
|
||||
import com.leejk0523.javavue.login.vo.Out;
|
||||
|
||||
public interface UserLoginService {
|
||||
Member login(In in);
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.leejk0523.javavue.login.service;
|
||||
|
||||
import com.leejk0523.javavue.login.dao.UserLoginDao;
|
||||
import com.leejk0523.javavue.login.vo.In;
|
||||
import com.leejk0523.javavue.login.vo.Member;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class UserLoginServiceImpl implements UserLoginService {
|
||||
private final UserLoginDao userLoginDAO;
|
||||
|
||||
@Override
|
||||
public Member login(In in) {
|
||||
return userLoginDAO.findByMemberId(in);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package com.leejk0523.javavue.login.vo;
|
||||
|
||||
import com.leejk0523.javavue.model.AsaAdminMember;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AdminMember implements Member {
|
||||
private AsaAdminMember member;
|
||||
private Long memberNo;
|
||||
private String memberId;
|
||||
private String memberName;
|
||||
private String memberPassword;
|
||||
private String instNo;
|
||||
private Type type;
|
||||
private Boolean memberEnabled;
|
||||
private Boolean memberLocked;
|
||||
private Integer memberFailureCount;
|
||||
private String plainPassword;
|
||||
private String deptNm;
|
||||
private Integer roleLvl;
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package com.leejk0523.javavue.login.vo;
|
||||
|
||||
import com.leejk0523.javavue.model.AsaUserMember;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DefaultMember implements Member {
|
||||
private AsaUserMember member;
|
||||
private Long memberNo;
|
||||
private String memberId;
|
||||
private String memberName;
|
||||
private String memberPassword;
|
||||
private String instNo;
|
||||
private Type type;
|
||||
private Boolean memberEnabled;
|
||||
private Boolean memberLocked;
|
||||
private Integer memberFailureCount;
|
||||
private String plainPassword;
|
||||
private String deptNm;
|
||||
private Integer roleLvl;
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.leejk0523.javavue.login.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class In implements Serializable {
|
||||
private String memberId;
|
||||
private String password;
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.leejk0523.javavue.login.vo;
|
||||
|
||||
public interface Member {
|
||||
String getMemberName();
|
||||
Long getMemberNo();
|
||||
String getMemberId();
|
||||
String getMemberPassword();
|
||||
Type getType();
|
||||
Boolean getMemberEnabled();
|
||||
Boolean getMemberLocked();
|
||||
Integer getMemberFailureCount();
|
||||
void setPlainPassword(String plainPassword);
|
||||
String getPlainPassword();
|
||||
String getInstNo();
|
||||
String getDeptNm();
|
||||
Integer getRoleLvl();
|
||||
|
||||
enum Type {
|
||||
USER,
|
||||
ADMIN
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
package com.leejk0523.javavue.login.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.leejk0523.javavue.model.AsaRole;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
public class Out implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@JsonIgnore
|
||||
private Long memberNo;
|
||||
|
||||
@JsonIgnore
|
||||
private String memberId;
|
||||
|
||||
@JsonIgnore
|
||||
private String instNo;
|
||||
|
||||
private String instNm;
|
||||
|
||||
@JsonIgnore
|
||||
private List<AsaRole> roles;
|
||||
|
||||
@JsonIgnore
|
||||
private List<String> orgList;
|
||||
|
||||
@JsonIgnore
|
||||
private String accessIpAddress;
|
||||
|
||||
@JsonIgnore
|
||||
private Integer roleLvl;
|
||||
|
||||
private String memberName;
|
||||
|
||||
private String deptNm;
|
||||
|
||||
private List<Menu> menuList;
|
||||
private List<PermitApi> permitApiList;
|
||||
|
||||
private boolean authenticated;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public static class Menu implements Serializable {
|
||||
private static final long serialVersionUID = -6699279565175110630L;
|
||||
|
||||
private String menuId;
|
||||
private String upMenuId;
|
||||
private Integer menuDepth;
|
||||
private String menuName;
|
||||
// private AsaMenu.Type menuType;
|
||||
private String menuUrl;
|
||||
private Integer bcId;
|
||||
private Integer contentId;
|
||||
|
||||
private List<Menu> children;
|
||||
}
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public static class PermitApi implements Serializable {
|
||||
private static final long serialVersionUID = 385854228342672220L;
|
||||
private String menuUrl;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,160 @@
|
|||
package com.leejk0523.javavue.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@Table(name = "ASA_ADMIN_MEMBER")
|
||||
public class AsaAdminMember {
|
||||
|
||||
@Id
|
||||
@GenericGenerator(name = "uuid", strategy = "org.hibernate.id.UUIDGenerator")
|
||||
@GeneratedValue(generator = "uuid")
|
||||
@Column(name = "ADMIN_NO", nullable = false)
|
||||
private String adminNo;
|
||||
|
||||
@Size(max = 50)
|
||||
@Column(name = "ADMIN_ID", nullable = false, length = 50)
|
||||
private String adminId;
|
||||
|
||||
@Size(max = 10)
|
||||
@Column(name = "INST_NO", length = 10)
|
||||
private String instNo;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "CERT_TYPE", length = 20)
|
||||
private CertType certType;
|
||||
|
||||
@Column(name = "CERT_VL", length = 100)
|
||||
private String certVl;
|
||||
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||
@Size(max = 200)
|
||||
@NotNull
|
||||
@Column(name = "ADMIN_PASSWORD", nullable = false, length = 200)
|
||||
private String adminPassword;
|
||||
|
||||
@Size(max = 200)
|
||||
@Column(name = "ADMIN_NAME", length = 200)
|
||||
private String adminName;
|
||||
|
||||
@Size(max = 10)
|
||||
@Column(name = "ADMIN_SEX", length = 10)
|
||||
private String adminSex;
|
||||
|
||||
@Size(max = 200)
|
||||
@Column(name = "ADMIN_EMAIL", length = 200)
|
||||
private String adminEmail;
|
||||
|
||||
@Size(max = 100)
|
||||
@Column(name = "ADMIN_TEL", length = 100)
|
||||
private String adminTel;
|
||||
|
||||
@Size(max = 100)
|
||||
@Column(name = "ADMIN_MOBILE", length = 100)
|
||||
private String adminMobile;
|
||||
|
||||
@Size(max = 50)
|
||||
@Column(name = "ADMIN_FAX", length = 50)
|
||||
private String adminFax;
|
||||
|
||||
@Size(max = 100)
|
||||
@Column(name = "ADMIN_ZIPCODE", length = 100)
|
||||
private String adminZipcode;
|
||||
|
||||
@Size(max = 200)
|
||||
@Column(name = "ADMIN_ADDRESS", length = 200)
|
||||
private String adminAddress;
|
||||
|
||||
@Size(max = 200)
|
||||
@Column(name = "ADMIN_ADDRESS_DETAIL", length = 200)
|
||||
private String adminAddressDetail;
|
||||
|
||||
@Column(name = "ADMIN_LOGIN_LAST_DATE")
|
||||
private LocalDateTime adminLoginLastDate;
|
||||
|
||||
@Column(name = "ADMIN_PW_LAST_UPDATE")
|
||||
private LocalDateTime adminPwLastUpdate;
|
||||
|
||||
@Size(max = 100)
|
||||
@Deprecated
|
||||
@Column(name = "ADMIN_DEPARTMENT", length = 100)
|
||||
private String adminDepartment;
|
||||
|
||||
@Column(name = "ADMIN_LOGIN_FAIL_COUNT")
|
||||
private Integer adminLoginFailCount;
|
||||
|
||||
@Column(name = "ADMIN_LOGIN_FAIL_DATE")
|
||||
private LocalDateTime adminLoginFailDate;
|
||||
|
||||
@Column(name = "ADMIN_LOCK")
|
||||
private Boolean adminLock;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "ADMIN_STATUS", length = 20, nullable = false)
|
||||
private AdminStatus adminStatus;
|
||||
|
||||
@Column(name = "APRV_DT")
|
||||
private LocalDateTime aprvDt;
|
||||
|
||||
@Column(name = "RJCT_DT")
|
||||
private LocalDateTime rjctDt;
|
||||
|
||||
@Column(name = "RJCT_RSN", length = 200)
|
||||
private String rjctRsn;
|
||||
|
||||
@Column(name = "USE_YN", length = 1, nullable = false)
|
||||
private Boolean useYn;
|
||||
|
||||
@Column(name = "DEL_YN", length = 1, nullable = false)
|
||||
private Boolean delYn;
|
||||
|
||||
@Column(name = "FRST_RGTR_ID", length = 50, nullable = false)
|
||||
private String frstRgtrId;
|
||||
|
||||
@Column(name = "FRST_REG_DT", nullable = false)
|
||||
private LocalDateTime frstRegDt;
|
||||
|
||||
@Column(name = "LAST_MDFR_ID", length = 50)
|
||||
private String lastMdfrId;
|
||||
|
||||
@Column(name = "LAST_MDFCN_DT")
|
||||
private LocalDateTime lastMdfcnDt;
|
||||
|
||||
@Transient
|
||||
private List<Role> roleList;
|
||||
|
||||
@Data
|
||||
public static class Role {
|
||||
private String adminId;
|
||||
private String roleCode;
|
||||
private String roleName;
|
||||
private Boolean roleJoin;
|
||||
}
|
||||
|
||||
public enum CertType {
|
||||
IPIN,
|
||||
PHONE
|
||||
}
|
||||
|
||||
public enum AdminStatus {
|
||||
NONE,
|
||||
APRV,
|
||||
RJCT
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package com.leejk0523.javavue.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@Entity
|
||||
@Table(name = "asa_role")
|
||||
public class AsaRole implements Serializable {
|
||||
private static final long serialVersionUID = 690922257948242364L;
|
||||
|
||||
@Id
|
||||
@Size(max = 100)
|
||||
@Column(name = "ROLE_CODE", nullable = false, length = 100)
|
||||
private String roleCode;
|
||||
|
||||
@Size(max = 20)
|
||||
@Column(name = "SITE_ID", nullable = false, length = 20)
|
||||
private String siteId;
|
||||
|
||||
@Size(max = 100)
|
||||
@Column(name = "ROLE_NAME", length = 100)
|
||||
private String roleName;
|
||||
|
||||
@Column(name = "ROLE_LVL", precision = 2)
|
||||
private Integer roleLvl;
|
||||
|
||||
@Size(max = 1000)
|
||||
@Column(name = "ROLE_DESCRIPTION", length = 1000)
|
||||
private String roleDescription;
|
||||
|
||||
@Column(name = "ROLE_JOIN")
|
||||
private Boolean roleJoin;
|
||||
|
||||
@Column(name = "USE_YN", length = 1, nullable = false)
|
||||
private Boolean useYn;
|
||||
|
||||
@Column(name = "DEL_YN", length = 1, nullable = false)
|
||||
private Boolean delYn;
|
||||
|
||||
@Column(name = "FRST_RGTR_ID", length = 50, nullable = false)
|
||||
private String frstRgtrId;
|
||||
|
||||
@Column(name = "FRST_REG_DT", nullable = false)
|
||||
private LocalDateTime frstRegDt;
|
||||
|
||||
@Column(name = "LAST_MDFR_ID", length = 50)
|
||||
private String lastMdfrId;
|
||||
|
||||
@Column(name = "LAST_MDFCN_DT")
|
||||
private LocalDateTime lastMdfcnDt;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,155 @@
|
|||
package com.leejk0523.javavue.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@Table(name = "ASA_USER_MEMBER")
|
||||
public class AsaUserMember {
|
||||
|
||||
@Id
|
||||
@GenericGenerator(name = "uuid", strategy = "org.hibernate.id.UUIDGenerator")
|
||||
@GeneratedValue(generator = "uuid")
|
||||
@Column(name = "USER_NO", nullable = false)
|
||||
private String userNo;
|
||||
|
||||
@Size(max = 50)
|
||||
@Column(name = "USER_ID", length = 50)
|
||||
private String userId;
|
||||
|
||||
@Size(max = 200)
|
||||
@NotNull
|
||||
@Column(name = "USER_PASSWORD", nullable = false, length = 200)
|
||||
private String userPassword;
|
||||
|
||||
@Size(max = 50)
|
||||
@Column(name = "USER_LOGIN_TYPE", length = 50)
|
||||
private String userLoginType;
|
||||
|
||||
@Size(max = 200)
|
||||
@Column(name = "USER_NAME", length = 200)
|
||||
private String userName;
|
||||
|
||||
@Size(max = 20)
|
||||
@Column(name = "USER_THUMBNAIL_IMAGE", length = 20)
|
||||
private String userThumbnailImage;
|
||||
|
||||
@Size(max = 100)
|
||||
@Column(name = "USER_TEL", length=100)
|
||||
private String userTel;
|
||||
|
||||
@Size(max = 100)
|
||||
@Column(name = "USER_MOBILE", length=100)
|
||||
private String userMobile;
|
||||
|
||||
@Size(max = 20)
|
||||
@Column(name = "USER_SEX", length = 20)
|
||||
private String userSex;
|
||||
|
||||
@Size(max = 200)
|
||||
@Column(name = "USER_EMAIL", length = 200)
|
||||
private String userEmail;
|
||||
|
||||
@Size(max = 100)
|
||||
@Column(name = "USER_ZIPCODE", length = 100)
|
||||
private String userZipcode;
|
||||
|
||||
@Size(max = 200)
|
||||
@Column(name = "USER_ADDRESS", length = 200)
|
||||
private String userAddress;
|
||||
|
||||
@Size(max = 200)
|
||||
@Column(name = "USER_ADDRESS_DETAIL", length = 200)
|
||||
private String userAddressDetail;
|
||||
|
||||
@Column(name = "USER_LOGIN_LAST_DATE")
|
||||
private LocalDateTime userLoginLastDate;
|
||||
|
||||
@Column(name = "USER_PW_LAST_UPDATED")
|
||||
private LocalDateTime userPwLastUpdated;
|
||||
|
||||
@Column(name = "USER_MAILING")
|
||||
private Boolean userMailing;
|
||||
|
||||
@Column(name = "USER_SMS")
|
||||
private Boolean userSms;
|
||||
|
||||
@Column(name = "PUSH_SEND")
|
||||
private Boolean pushSend;
|
||||
|
||||
@Column(name = "USE_TERMS_AGREE")
|
||||
private Boolean useTermsAgree;
|
||||
|
||||
@Column(name = "PRIVACY_TERMS_AGREE")
|
||||
private Boolean privacyTermsAgree;
|
||||
|
||||
@Column(name = "LOCATION_TERMS_AGREE")
|
||||
private Boolean locationTermsAgree;
|
||||
|
||||
@Column(name = "MARKETING_TERMS_AGREE")
|
||||
private Boolean marketingTermsAgree;
|
||||
|
||||
@Size(max = 100)
|
||||
@Column(name = "USER_SIGN_UP_KEY", length = 100)
|
||||
private String userSignUpKey;
|
||||
|
||||
@Size(max = 500)
|
||||
@Column(name = "USER_SIGN_UP_KEY_CHECKED", length = 500)
|
||||
private String userSignUpKeyChecked;
|
||||
|
||||
@Size(max = 20)
|
||||
@Column(name = "USER_SNS", length = 20)
|
||||
private String userSns;
|
||||
|
||||
@Size(max = 50)
|
||||
@Column(name = "USER_SNS_ID", length = 50)
|
||||
private String userSnsId;
|
||||
|
||||
@Size(max = 100)
|
||||
@Column(name = "USER_SNS_HOME", length = 100)
|
||||
private String userSnsHome;
|
||||
|
||||
@Column(name = "TERM_CHECK_DATE")
|
||||
private LocalDateTime termCheckDate;
|
||||
|
||||
@Column(name = "TERM_CHECK_EMAIL_SENDED")
|
||||
private Boolean termCheckEmailSended;
|
||||
|
||||
@Column(name = "USER_LOCK")
|
||||
private Boolean userLock;
|
||||
|
||||
@Column(name = "USER_LOGIN_FAIL_COUNT")
|
||||
private Integer userLoginFailCount;
|
||||
|
||||
@Column(name = "USER_LOGIN_FAIL_DATE")
|
||||
private LocalDateTime userLoginFailDate;
|
||||
|
||||
@Column(name = "USE_YN", length = 1, nullable = false)
|
||||
private Boolean useYn;
|
||||
|
||||
@Column(name = "DEL_YN", length = 1, nullable = false)
|
||||
private Boolean delYn;
|
||||
|
||||
@Column(name = "FRST_RGTR_ID", length = 50, nullable = false)
|
||||
private String frstRgtrId;
|
||||
|
||||
@Column(name = "FRST_REG_DT", nullable = false)
|
||||
private LocalDateTime frstRegDt;
|
||||
|
||||
@Column(name = "LAST_MDFR_ID", length = 50)
|
||||
private String lastMdfrId;
|
||||
|
||||
@Column(name = "LAST_MDFCN_DT")
|
||||
private LocalDateTime lastMdfcnDt;
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
package com.leejk0523.javavue.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import jakarta.persistence.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@Entity
|
||||
@Table(name = "IST_INST")
|
||||
public class IstInst {
|
||||
|
||||
@Id
|
||||
@Column(name = "INST_NO", length = 10, nullable = false)
|
||||
private String instNo;
|
||||
|
||||
@Column(name = "INST_CLSF_CD", length = 6, nullable = false)
|
||||
private String instClsfCd;
|
||||
|
||||
@Column(name = "INST_NM", length = 200, nullable = false)
|
||||
private String instNm;
|
||||
|
||||
@Column(name = "INST_ENG_NM", length = 100)
|
||||
private String instEngNm;
|
||||
|
||||
@Column(name = "INST_ABBR_NM", length = 300)
|
||||
private String instAbbrNm;
|
||||
|
||||
@Column(name = "INST_EML_ADDR", length = 320)
|
||||
private String instEmlAddr;
|
||||
|
||||
@Column(name = "INST_TELNO", length = 11)
|
||||
private String instTelno;
|
||||
|
||||
@Column(name = "INST_FXNO", length = 11)
|
||||
private String instFxno;
|
||||
|
||||
@Column(name = "INST_ZIP", length = 5)
|
||||
private String instZip;
|
||||
|
||||
@Column(name = "INST_ADDR", length = 200)
|
||||
private String instAddr;
|
||||
|
||||
@Column(name = "INST_DADDR", length = 200)
|
||||
private String instDaddr;
|
||||
|
||||
@Column(name = "INST_BRNO", length = 10)
|
||||
private String instBrno;
|
||||
|
||||
@Column(name = "INST_RPRSV_NM", length = 100)
|
||||
private String instRprsvNm;
|
||||
|
||||
@Column(name = "INST_EXPLN", length = 4000)
|
||||
private String instExpln;
|
||||
|
||||
@Column(name = "USE_YN", length = 1, nullable = false)
|
||||
private Boolean useYn;
|
||||
|
||||
@Column(name = "FRST_RGTR_ID", length = 50, nullable = false)
|
||||
private String frstRgtrId;
|
||||
|
||||
@Column(name = "FRST_REG_DT", nullable = false)
|
||||
private LocalDateTime frstRegDt;
|
||||
|
||||
@Column(name = "LAST_MDFR_ID", length = 50)
|
||||
private String lastMdfrId;
|
||||
|
||||
@Column(name = "LAST_MDFCN_DT")
|
||||
private LocalDateTime lastMdfcnDt;
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
package com.leejk0523.javavue.repository;
|
||||
|
||||
import com.leejk0523.javavue.entity.UserProfile;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface UserProfileRepository extends JpaRepository<UserProfile, String> {
|
||||
|
||||
// 이름으로 검색
|
||||
List<UserProfile> findByName(String name);
|
||||
|
||||
// 전화번호로 검색
|
||||
List<UserProfile> findByPhone(String phone);
|
||||
|
||||
// 주소에 특정 키워드가 포함된 사용자 검색
|
||||
List<UserProfile> findByAddressContaining(String keyword);
|
||||
|
||||
// 파일 경로가 특정 값과 일치하는 사용자 검색
|
||||
UserProfile findByFilepath(String filepath);
|
||||
}
|
||||
|
|
@ -1,28 +1,10 @@
|
|||
spring.application.name=javavue
|
||||
|
||||
spring.datasource.url=jdbc:mariadb://leejk0523.com:3306/profile
|
||||
spring.datasource.username=leejk0523
|
||||
spring.datasource.url=jdbc:mariadb://localhost:3306/pub
|
||||
spring.datasource.username=daniel
|
||||
spring.datasource.password=Ghtkssk0325
|
||||
|
||||
|
||||
# none: ???? ???? ??? (???? DB?? ?????)
|
||||
# create-drop: SessionFactory? ??? ? drop? ??? ????, SessionFactory? ??? ? drop? ???? (in-memory DB? ?? ?????)
|
||||
# create: SessionFactory? ??? ? ?????? drop? ???? ??? DDL? ????
|
||||
# update: ??? ???? ????
|
||||
# validate: ??? ???? ??? ???? ???? ??????? ????
|
||||
spring.jpa.hibernate.ddl-auto=none
|
||||
|
||||
# DB? ??? ?? ??? ????
|
||||
spring.jpa.hibernate.ddl-auto=update
|
||||
spring.jpa.properties.hibernate.show-sql=true
|
||||
|
||||
# ???? ??? ??? ??? ???
|
||||
spring.jpa.properties.hibernate.format_sql=true
|
||||
|
||||
# ?? ?? ???? ?? ????
|
||||
logging.level.org.hibernate.type.descriptor.sql=DEBUG
|
||||
|
||||
# ?? ?? ??
|
||||
logging.level.org.hibernate.SQL=DEBUG
|
||||
|
||||
#UserProfile? ???? ????? ???? ??? ??
|
||||
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
|
||||
Loading…
Reference in New Issue