회원 쿼리 메소드 작
This commit is contained in:
		
							parent
							
								
									f32e6bd3e8
								
							
						
					
					
						commit
						4bf0676b2d
					
				@ -29,26 +29,30 @@ public class User implements Serializable {
 | 
			
		||||
  private Long id;
 | 
			
		||||
 | 
			
		||||
  @Basic
 | 
			
		||||
  @Column(name = "name", nullable = false, length = 255)
 | 
			
		||||
  private String name;
 | 
			
		||||
 | 
			
		||||
  @Basic
 | 
			
		||||
  @Column(name = "username", nullable = false, length = 150)
 | 
			
		||||
  @Column(name = "username", unique = true, nullable = false, length = 150)
 | 
			
		||||
  private String username;
 | 
			
		||||
 | 
			
		||||
  @Basic
 | 
			
		||||
  @Column(name = "email", nullable = false, length = 100)
 | 
			
		||||
  private String email;
 | 
			
		||||
 | 
			
		||||
  @Basic
 | 
			
		||||
  @Column(name = "password", nullable = false, length = 100)
 | 
			
		||||
  @JsonIgnore
 | 
			
		||||
  private String password;
 | 
			
		||||
 | 
			
		||||
  @Basic
 | 
			
		||||
  @Column(name = "name", nullable = false, length = 255)
 | 
			
		||||
  private String nickname;
 | 
			
		||||
 | 
			
		||||
  @Basic
 | 
			
		||||
  @Column(name = "email", nullable = false, length = 100)
 | 
			
		||||
  private String email;
 | 
			
		||||
 | 
			
		||||
  @Basic
 | 
			
		||||
  @Column(name = "block", nullable = false, columnDefinition = "bool default false")
 | 
			
		||||
  private Boolean block;
 | 
			
		||||
 | 
			
		||||
  @Basic
 | 
			
		||||
  @Column(name = "is_admin", nullable = false, columnDefinition = "bool default false")
 | 
			
		||||
  private Boolean isAdmin;
 | 
			
		||||
 | 
			
		||||
  @Basic
 | 
			
		||||
  @Column(name = "send_email", nullable = true, columnDefinition = "bool default false")
 | 
			
		||||
  private Boolean sendEmail;
 | 
			
		||||
@ -86,3 +90,37 @@ public class User implements Serializable {
 | 
			
		||||
  private Boolean requireReset;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 아이디
 | 
			
		||||
// 로그인 아이디
 | 
			
		||||
// 로그인 패스워드
 | 
			
		||||
// 로그인 패스워드 문자
 | 
			
		||||
// 이메일
 | 
			
		||||
// 닉네임
 | 
			
		||||
// 은행명
 | 
			
		||||
// 계좌번호
 | 
			
		||||
// 예금주
 | 
			
		||||
// 추천인
 | 
			
		||||
// 추천수
 | 
			
		||||
// 게시판 제한 여부
 | 
			
		||||
// 쿠폰
 | 
			
		||||
// 충전방식
 | 
			
		||||
// 비고
 | 
			
		||||
// 종목별 베팅제한
 | 
			
		||||
// 상태표기
 | 
			
		||||
// 휴대폰번호
 | 
			
		||||
// 추천권한 여부
 | 
			
		||||
// 가입상태
 | 
			
		||||
// 소속
 | 
			
		||||
// 레벨
 | 
			
		||||
// 보유머니
 | 
			
		||||
// 포인트
 | 
			
		||||
// 회원상태
 | 
			
		||||
// 룰렛개수
 | 
			
		||||
// 계좌순번
 | 
			
		||||
// 가입날짜
 | 
			
		||||
// 최근접속 날짜
 | 
			
		||||
// 가입 아이피
 | 
			
		||||
// 최근 접속 아이피
 | 
			
		||||
// 베팅 알림
 | 
			
		||||
// API 연결
 | 
			
		||||
 | 
			
		||||
@ -2,7 +2,41 @@ package com.totopia.server.user.repository;
 | 
			
		||||
 | 
			
		||||
import com.totopia.server.user.model.User;
 | 
			
		||||
 | 
			
		||||
import org.springframework.data.domain.Page;
 | 
			
		||||
import org.springframework.data.domain.Pageable;
 | 
			
		||||
import org.springframework.data.jpa.repository.JpaRepository;
 | 
			
		||||
import org.springframework.stereotype.Repository;
 | 
			
		||||
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
 | 
			
		||||
@Repository
 | 
			
		||||
public interface UserRepository extends JpaRepository<User, Long> {
 | 
			
		||||
    // 회원 아이디로 조회
 | 
			
		||||
    User findByUsername(String userName) throws Exception;
 | 
			
		||||
    User findByEmail(String email) throws Exception;
 | 
			
		||||
 | 
			
		||||
    Page<User> findAllByNickname(String nickName, Pageable pageable) throws Exception;
 | 
			
		||||
 | 
			
		||||
    // 접속 제한 상태 유저 리스트
 | 
			
		||||
    Page<User>  findAllByBlockTrue(Pageable pageable) throws Exception;
 | 
			
		||||
    // 접속 제한 상태가 아닌 유저 리스트
 | 
			
		||||
    Page<User>  findAllByBlockFalse(Pageable pageable) throws Exception;
 | 
			
		||||
    // 어드민 유저 리스
 | 
			
		||||
    Page<User>  findAllByIsAdminTrue(Pageable pageable) throws Exception;
 | 
			
		||||
    // 패스워드 리셋이 트루인 유저 리스
 | 
			
		||||
    Page<User>  findAllByRequireResetTrue(Pageable pageable) throws Exception;
 | 
			
		||||
    // 어드민이 펄스이며, 활동중인 현재 회원 리스트
 | 
			
		||||
    Page<User>  findAllByIsAdminFalseAndActivationEquals(String activation, Pageable pageable) throws Exception;
 | 
			
		||||
    // 날짜 검색
 | 
			
		||||
    Page<User>  findAllByRegisterDateBetween(Date starDate, Date endDate, Pageable pageable) throws Exception;
 | 
			
		||||
    Page<User>  findAllByLastvisitDateBetween(Date starDate, Date endDate, Pageable pageable) throws Exception;
 | 
			
		||||
    Page<User>  findAllByLastResetTimeBetween(Date starDate, Date endDate, Pageable pageable) throws Exception;
 | 
			
		||||
 | 
			
		||||
    // 현재 날짜 이후 가입된 회원의 총 수 리턴
 | 
			
		||||
    Long countByRegisterDateGreaterThanEqual(Date date) throws Exception;
 | 
			
		||||
 | 
			
		||||
    // 유저 그룹별 회원 리스트
 | 
			
		||||
 | 
			
		||||
    // 유저 소속별 회원 리스트
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,9 @@
 | 
			
		||||
package com.totopia.server.user.service;
 | 
			
		||||
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
 | 
			
		||||
@Service
 | 
			
		||||
public class UserService {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
# Spring Boot configuration
 | 
			
		||||
spring:
 | 
			
		||||
 application:
 | 
			
		||||
  name: totopia-server
 | 
			
		||||
@ -5,10 +6,49 @@ spring:
 | 
			
		||||
  console:
 | 
			
		||||
   enabled: true
 | 
			
		||||
   path: /h2-console
 | 
			
		||||
 datasource:
 | 
			
		||||
   driver-class-name: org.postgresql.Driver
 | 
			
		||||
   url: jdbc:postgresql://localhost:15432/postgres
 | 
			
		||||
   data-username: postgres
 | 
			
		||||
   password: qwer5795
 | 
			
		||||
 # JPA properties
 | 
			
		||||
 jpa:
 | 
			
		||||
  hibernate:
 | 
			
		||||
   ddl-auto: update
 | 
			
		||||
  database: postgresql
 | 
			
		||||
  show-sql: true
 | 
			
		||||
  database-platform: org.hibernate.dialect.PostgreSQLDialect
 | 
			
		||||
 | 
			
		||||
# Logger configuration
 | 
			
		||||
logging:
 | 
			
		||||
 pattern:
 | 
			
		||||
  console: "%d %-5level %logger : %msg%n"
 | 
			
		||||
 level:
 | 
			
		||||
  org.springframework: INFO
 | 
			
		||||
  org.hibernate: DEBUG
 | 
			
		||||
 | 
			
		||||
# Server configuration
 | 
			
		||||
server:
 | 
			
		||||
 port: 8088
 | 
			
		||||
 servlet:
 | 
			
		||||
  context-path: /api
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# spring.datasource.url=jdbc:postgresql://localhost:54320/postgres
 | 
			
		||||
# spring.datasource.username=postgres
 | 
			
		||||
# spring.datasource.password=root
 | 
			
		||||
# spring.jpa.show-sql=true
 | 
			
		||||
#
 | 
			
		||||
#  ## Hibernate Properties
 | 
			
		||||
#  # The SQL dialect makes Hibernate generate better SQL for the chosen database
 | 
			
		||||
# spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
 | 
			
		||||
# spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false
 | 
			
		||||
#
 | 
			
		||||
#  # Hibernate ddl auto (create, create-drop, validate, update)
 | 
			
		||||
# spring.jpa.hibernate.ddl-auto=update
 | 
			
		||||
# spring.jpa.database=postgresql
 | 
			
		||||
#
 | 
			
		||||
# logging.level.root=info
 | 
			
		||||
# logging.pattern.console=%d{dd-MM-yyyy HH:mm:ss.SSS} %magenta([%thread]) %highlight(%-5level) %logger.%M - %msg%n
 | 
			
		||||
#
 | 
			
		||||
# server.port=8282
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user