Skip to content

Commit

Permalink
[Feat] 도메인 구현 및 연관관계 설정 (#30)
Browse files Browse the repository at this point in the history
* [Feat] 일부 도메인 구현 및 연관관계 설정

* [Feat] 도메인 추가 구현

* [Feat] 도메인 연관관계 수정

* [Feat] like 도메인을 heart로 수정

---------

Co-authored-by: jihyun <chiiclaro@gmail.com>
  • Loading branch information
iiqcov and JIHYUN2EE authored Sep 1, 2024
1 parent a199fad commit d0d2b34
Show file tree
Hide file tree
Showing 23 changed files with 586 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/main/java/appjjang/fitpet/domain/advertising/Advertising.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package appjjang.fitpet.domain.advertising;

import jakarta.persistence.*;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class Advertising {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "advertising_id")
private Long id;

private String imageUrl;
}
26 changes: 26 additions & 0 deletions src/main/java/appjjang/fitpet/domain/catprice/domain/CatPrice.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package appjjang.fitpet.domain.catprice.domain;

import jakarta.persistence.*;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class CatPrice {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "cat_price_id")
private Long id;

private int age;
private String updateCycle;
private String selfBurden;
private String priceRate;
private String oneDayReward;
private String code;
private int insuranceFee;
private String insuranceCompany;
}
28 changes: 28 additions & 0 deletions src/main/java/appjjang/fitpet/domain/catsave/domain/CatSave.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package appjjang.fitpet.domain.catsave.domain;

import appjjang.fitpet.domain.catprice.domain.CatPrice;
import appjjang.fitpet.domain.common.model.BaseTimeEntity;
import appjjang.fitpet.domain.pet.domain.Pet;
import jakarta.persistence.*;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)

public class CatSave extends BaseTimeEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "cat_save_id")
private Long id;

@ManyToOne
@JoinColumn(name = "pet_id")
private Pet pet;

@ManyToOne
@JoinColumn(name = "cat_price_id")
private CatPrice catPrice;
}
18 changes: 18 additions & 0 deletions src/main/java/appjjang/fitpet/domain/charge/domain/Agree.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package appjjang.fitpet.domain.charge.domain;

import jakarta.persistence.Embeddable;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@Embeddable
@NoArgsConstructor
public class Agree {
private Boolean essentialAgree;
private Boolean optionalAgree;

private Agree(boolean essentialAgree, boolean optionalAgree){
this.essentialAgree = essentialAgree;
this.optionalAgree = optionalAgree;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package appjjang.fitpet.domain.charge.domain;

import jakarta.persistence.Embeddable;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Embeddable
@Getter
@NoArgsConstructor
public class Authentication {
private String authenticationId;

private String receiptUrl;
private String medicalExpensesUrl;
private String etcUrl;

@Builder
public Authentication(String receiptUrl, String medicalExpensesUrl, String etcUrl){
this.receiptUrl = receiptUrl;
this.medicalExpensesUrl = medicalExpensesUrl;
this.etcUrl = etcUrl;
}
}
32 changes: 32 additions & 0 deletions src/main/java/appjjang/fitpet/domain/charge/domain/Charge.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package appjjang.fitpet.domain.charge.domain;

import appjjang.fitpet.domain.insurance.domain.Insurance;
import jakarta.persistence.*;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.time.LocalTime;

@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class Charge {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "charge_id")
private Long id;

private String type;
private LocalTime visitTime;
@Embedded private Authentication authentication;
private String accountHolder;
private String bank;
private String account;
@Embedded private Notice notice;
@Embedded private Agree agree;

@ManyToOne
@JoinColumn(name = "insurance_id")
private Insurance insurance;
}
25 changes: 25 additions & 0 deletions src/main/java/appjjang/fitpet/domain/charge/domain/Notice.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package appjjang.fitpet.domain.charge.domain;

import jakarta.persistence.Embeddable;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Embeddable
@Getter
@NoArgsConstructor
public class Notice {
private String noticeId;

private String message;
private String email;
private String phone;

@Builder
public Notice (String message, String email, String phone){
this.message = message;
this.email = email;
this.phone = phone;
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package appjjang.fitpet.domain.compensation.domain;

import appjjang.fitpet.domain.insurance.domain.Insurance;
import jakarta.persistence.*;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.time.LocalTime;

@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class Compensation {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "compensation_id")
private Long id;

private String type;
private LocalTime requestDate;
private String chargePerson;
private int receiveFee;

@ManyToOne
@JoinColumn(name = "insurance_id")
private Insurance insurance;
}
35 changes: 35 additions & 0 deletions src/main/java/appjjang/fitpet/domain/coverage/domain/Coverage.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package appjjang.fitpet.domain.coverage.domain;

import appjjang.fitpet.domain.compensation.domain.Compensation;
import appjjang.fitpet.domain.insurance.domain.Insurance;
import jakarta.persistence.*;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class Coverage {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "coverage_id")
private Long id;

private String dailyTreatLimit;
private String dailySurgeryCostLimit;
private String yearReward;
private String hipJointLimit;
private String skinDisease;
private String oralCoverage;
private String dentalCoverage;
private String inspectionCoverage;
private String foreignObjectRemoval;
private String selfBurden;
private String compensationLiability;
private String funeralAid;




}
39 changes: 39 additions & 0 deletions src/main/java/appjjang/fitpet/domain/doglist/domain/DogList.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package appjjang.fitpet.domain.doglist.domain;

import appjjang.fitpet.domain.dogprice.domain.DogPrice;
import jakarta.persistence.*;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.List;

@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class DogList {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "dog_list_id")
private Long id;

private String important;
private String breed;

private String petpermint;

private String samsung;

private String db;

private String hyundai;

private String kb;
private String danger;

private String reparationLimit;

@OneToMany(mappedBy = "dogList")
private List<DogPrice> dogPrices;
}
33 changes: 33 additions & 0 deletions src/main/java/appjjang/fitpet/domain/dogprice/domain/DogPrice.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package appjjang.fitpet.domain.dogprice.domain;

import appjjang.fitpet.domain.doglist.domain.DogList;
import jakarta.persistence.*;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class DogPrice {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "dog_price_id")
private Long id;

private int age;
private String updateCycle;
private String grade;
private String selfBurden;
private String priceRate;
private String oneDayReward;
private String code;
private int insuranceFee;

private String insuranceCompany;

@ManyToOne
@JoinColumn(name = "dog_list_id")
private DogList dogList;
}
27 changes: 27 additions & 0 deletions src/main/java/appjjang/fitpet/domain/dogsave/domain/DogSave.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package appjjang.fitpet.domain.dogsave.domain;

import appjjang.fitpet.domain.common.model.BaseTimeEntity;
import appjjang.fitpet.domain.dogprice.domain.DogPrice;
import appjjang.fitpet.domain.pet.domain.Pet;
import jakarta.persistence.*;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class DogSave extends BaseTimeEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "dog_save_id")
private Long id;

@ManyToOne
@JoinColumn(name = "pet_id")
private Pet pet;

@ManyToOne
@JoinColumn(name = "dog_price_id")
private DogPrice dogPrice;
}
26 changes: 26 additions & 0 deletions src/main/java/appjjang/fitpet/domain/heart/domain/Heart.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package appjjang.fitpet.domain.heart.domain;

import appjjang.fitpet.domain.knowledge.domain.Knowledge;
import appjjang.fitpet.domain.member.domain.Member;
import jakarta.persistence.*;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class Heart {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "like_id")
private Long id;

@ManyToOne
@JoinColumn(name = "member_id")
private Member member;

@ManyToOne
@JoinColumn(name = "knowledge_id")
private Knowledge knowledge;
}
Loading

0 comments on commit d0d2b34

Please sign in to comment.