Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/main/generated/com/example/api/domain/QReview.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ public class QReview extends EntityPathBase<Review> {

public final QAccount employee;

public final QOfferEmployment offerEmployment;

public final StringPath reviewContent = createString("reviewContent");

public final NumberPath<Long> reviewId = createNumber("reviewId", Long.class);
Expand Down Expand Up @@ -64,7 +62,6 @@ public QReview(Class<? extends Review> type, PathMetadata metadata, PathInits in
super(type, metadata, inits);
this.contract = inits.isInitialized("contract") ? new QContract(forProperty("contract"), inits.get("contract")) : null;
this.employee = inits.isInitialized("employee") ? new QAccount(forProperty("employee")) : null;
this.offerEmployment = inits.isInitialized("offerEmployment") ? new QOfferEmployment(forProperty("offerEmployment"), inits.get("offerEmployment")) : null;
this.writer = inits.isInitialized("writer") ? new QBusiness(forProperty("writer"), inits.get("writer")) : null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public record SignUpEmployeeRequest(
@ValidEmail
String email,
@NotNull
Nationality nationality,
Nationality nationality ,
@NotNull
UserRole role,
@NotBlank
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/com/example/api/auth/entitiy/RefreshToken.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@
import java.time.LocalDateTime;

@Entity
@Table(name = "REFRESH_TOKEN")
public class RefreshToken {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "tokenId")
@Column(name = "TOKEN_ID")
private Long id;

@Column
@Column(name = "REFRESH_TOKEN")
private String refreshToken;

@Column
@Column(name = "IS_EXPIRED")
private boolean isExpired = false;

@Column
@Column(name = "RECENT_LOGIN")
private LocalDateTime recentLogin = LocalDateTime.now();

@ManyToOne(fetch = FetchType.LAZY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
@Entity
@Getter
@ToString
@Table(name = "BUSINESS_LOCATION")
public class BusinessLocation extends BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/com/example/api/contracts/ContractService.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
package com.example.api.contracts;

import com.example.api.board.dto.request.EmployeeIdRequest;
import com.example.api.chat.repository.ChatRoomRepository;
import com.example.api.contracts.dto.*;
import com.example.api.contracts.update.UpdateContractConditionManager;
import com.example.api.domain.ChatRoom;
import com.example.api.contracts.dto.AcceptSuggestCommand;
import com.example.api.contracts.dto.UpdateContractConditionCommand;
import com.example.api.contracts.dto.QueryAllSuggestsForMeCommand;
import com.example.api.domain.Contract;
import com.example.api.domain.OfferEmployment;

import java.time.LocalDate;

import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
Expand All @@ -24,6 +20,8 @@ public class ContractService {
private final ContractRepository contractRepository;
private final UpdateContractConditionManager updateContractConditionManager;



@Transactional
public void updateContract(@Validated final UpdateContractConditionCommand updateContractConditionCommand) {
final Contract contract = loadContract(updateContractConditionCommand.contractId());
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/example/api/domain/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class Account extends BaseEntity {
private Nationality nationality;
@ElementCollection(targetClass = UserRole.class)
@CollectionTable(name = "AUTHORITY", joinColumns = @JoinColumn(name = "ACCOUNT_UNIQUE_ID"), foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
@Column(name = "ROLE_NAME")
@Enumerated(EnumType.STRING)
private Collection<UserRole> roles;
@Column(name = "ACCOUNT_SEX")
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/com/example/api/domain/Announcement.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@
@EqualsAndHashCode(callSuper = false)
@Table(name = "ANNOUNCEMENT")
public class Announcement extends BaseEntity {
@NonNull
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ANNOUNCEMENT_ID")
private Long announcementId;
@Column(name = "ANNOUNCEMENT_TITLE")
private String announcementTitle;
@Column(name = "ANNOUNCEMENT_TYPE")
private String announcementType;
@Column(name = "ANNOUNCEMENT_CONTENT", columnDefinition = "TEXT")
private String announcementContent;

@Column(columnDefinition = "int DEFAULT 0")
@Column(name = "VIEW_COUNT", columnDefinition = "int DEFAULT 0")
private int viewCount;
}
2 changes: 2 additions & 0 deletions src/main/java/com/example/api/domain/Business.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
public class Business extends BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "BUSINESS_ID")
private Long businessId;

@ManyToOne(fetch = LAZY)
Expand All @@ -36,6 +37,7 @@ public class Business extends BaseEntity {
@JoinColumn(name = "BUSINESS_LOCATION", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
private BusinessLocation location;

@Column(name = "REPRESENTATION_NAME")
private String representationName;

@Column(name = "BUSINESS_OPEN_DATE")
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/example/api/domain/BusinessCategory.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class BusinessCategory extends BaseEntity{
private Business business;

@ManyToOne(fetch = LAZY)
@JoinColumn(name = "CATEGOREY_ID", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
@JoinColumn(name = "CATEGORY_ID", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
private Category category;

public BusinessCategory(Business business, Category category) {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/example/api/domain/ChatRoom.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
public class ChatRoom {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "CHAT_ROOM_ID")
private Long chatRoomId;

@OneToOne(fetch = LAZY)
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/example/api/domain/CityDistrict.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
@Entity
@Getter
@NoArgsConstructor
@Table(name = "CITY_DISTRICT")
public class CityDistrict extends BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/example/api/domain/Contract.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public class Contract extends BaseEntity {
@PrimaryKeyJoinColumn(name = "CONTRACT_ID", referencedColumnName = "SUGGEST_ID", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
private OfferEmployment offerEmployment;

@Column(name = "CONTRACT_START_TIME")
@Column(name = "CONTRACT_START_TIME", columnDefinition = "TIMESTAMP(0)")
private LocalDateTime contractStartTime;
@Column(name = "CONTRACT_END_TIME")
@Column(name = "CONTRACT_END_TIME", columnDefinition = "TIMESTAMP(0)")
private LocalDateTime contractEndTime;
@Column(name = "CONTRACT_HOURLY_PAY")
private int contractHourlyPay;
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/com/example/api/domain/ExternalCareer.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package com.example.api.domain;


import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.*;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import static jakarta.persistence.FetchType.*;

Expand All @@ -26,10 +24,11 @@ public class ExternalCareer extends BaseEntity{
private Account employee;

@ManyToOne(fetch = LAZY)
@JoinColumn(name = "CATEGPRY_ID", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
@JoinColumn(name = "CATEGORY_ID", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
@EqualsAndHashCode.Include
private Category category;

@Column(name = "WORK_COUNT")
private int workCount;

public ExternalCareer(Account employee, Category category, int workCount) {
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/example/api/domain/Inquiry.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,28 @@
public class Inquiry extends BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "INQUIRY_ID")
private Long inquiryId;

@ManyToOne(fetch = LAZY)
@JoinColumn(name = "ACCOUNT_UNIQUE_ID")
private Account createdBy;

@Column(name = "INQUIRY_TYPE")
private String inquiryType;

@Column(name = "SUB_INQUIRY_TYPE")
private String subInquiryType;

private String title;

private String content;

@Enumerated(EnumType.STRING)
@Column(name = "INQUIRY_STATUS")
private InquiryStatus inquiryStatus;

@Column(name = "ANSWER_DATE")
private LocalDateTime answerDate;
public enum InquiryStatus {
WAITING, COMPLETED
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/example/api/domain/OfferEmployment.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
public class OfferEmployment {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "SUGGEST_ID")
private Long suggestId;

@OneToOne(fetch = LAZY)
Expand All @@ -25,9 +26,9 @@ public class OfferEmployment {
private Account employee;
@OneToOne(mappedBy = "offerEmployment", cascade = CascadeType.ALL)
private Contract contract;
@Column(name = "SUGGEST_START_TIME")
@Column(name = "SUGGEST_START_TIME", columnDefinition = "TIMESTAMP(0)")
private LocalDateTime suggestStartTime;
@Column(name = "SUGGEST_END_TIME")
@Column(name = "SUGGEST_END_TIME", columnDefinition = "TIMESTAMP(0)")
private LocalDateTime suggestEndTime;
@Column(name = "SUGGEST_HOURLY_PAY")
private int suggestHourlyPay;
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/com/example/api/domain/PossibleBoard.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,22 @@
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@Table(name = "POSSIBLE_BOARD")
public class PossibleBoard extends BaseEntity{
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "POSSIBLE_ID")
private Long possibleId;

@ManyToOne(fetch = LAZY)
@JoinColumn(name = "EMPLOYEE_ID", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
private Account employee;

@Column(name = "POSSIBLE_START_TIME")
@Column(name = "POSSIBLE_START_TIME", columnDefinition = "TIMESTAMP(0)")
@EqualsAndHashCode.Include
private LocalDateTime startTime;

@Column(name = "POSSIBLE_END_TIME")
@Column(name = "POSSIBLE_END_TIME", columnDefinition = "TIMESTAMP(0)")
@EqualsAndHashCode.Include
private LocalDateTime endTime;

Expand Down
4 changes: 0 additions & 4 deletions src/main/java/com/example/api/domain/Review.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ public class Review extends BaseEntity {
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long reviewId;

@OneToOne(fetch = FetchType.LAZY)
@PrimaryKeyJoinColumn(name = "REVIEW_ID", referencedColumnName = "SUGGEST_ID", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
private OfferEmployment offerEmployment;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "REVIEW_WRITER_ID")
private Business writer;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/example/api/domain/ReviewReport.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
public class ReviewReport extends BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "REPORT_ID")
private Long reportId;

@OneToOne(fetch = FetchType.LAZY)
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/example/api/domain/Scrap.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import org.checkerframework.checker.units.qual.C;

import java.time.LocalDateTime;

Expand All @@ -14,6 +15,7 @@
public class Scrap extends BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "SCRAP_ID")
private Long scrapId;

@ManyToOne(fetch = FetchType.LAZY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
import com.example.api.auth.repository.TokenRepository;
import com.example.api.auth.service.JwtTokenProvider;
import com.example.api.domain.Account;
import com.example.api.global.exception.BusinessException;
import com.example.api.global.exception.ErrorCode;
import com.example.api.global.properties.JwtProperties;
import com.example.api.oauth2.entity.CookieUtils;
import com.example.api.oauth2.entity.HttpCookieOAuth2AuthorizationRequestRepository;
import com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.servlet.ServletException;
Expand All @@ -31,8 +28,6 @@
import java.net.URI;
import java.util.*;

import static com.example.api.oauth2.entity.HttpCookieOAuth2AuthorizationRequestRepository.REDIRECT_URI_PARAM_COOKIE_NAME;

@Component
@Slf4j
@RequiredArgsConstructor
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.data.mongodb.auto-index-creation=true

# JPA and Hibernate Configuration
spring.jpa.hibernate.ddl-auto=update
spring.jpa.hibernate.ddl-auto=validate
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect
spring.jpa.properties.hibernate.physical_naming_strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl

# Logging (Optional)
logging.level.org.hibernate.SQL=DEBUG
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/static/danpat.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
openapi: 3.0.1
info:
title: Spring API
description: 단팥 백엔드 API 명세서입123니다.
description: 단팥 백엔드 API 명세서입니다.
version: 1.0.0
servers:
- url: http://43.201.78.102:8080/api/v1
Expand Down
Loading