@@ -5,16 +5,24 @@ import com.example.jhouse_server.domain.scrap.entity.Scrap
55import  com.example.jhouse_server.domain.user.entity.User 
66import  com.example.jhouse_server.global.entity.BaseEntity 
77import  javax.persistence.* 
8- @Table(name =  " house"  ,
9-     indexes =  [Index (name =  " idx__rental_type"  , columnList =  " rentalType, useYn, tmpYn, reported, applied"  ),
8+ 
9+ @Table(
10+     name =  " house"  ,
11+     indexes =  [Index (
12+         name =  " idx__rental_type"  ,
13+         columnList =  " rentalType, useYn, tmpYn, reported, applied" 
14+     ),
1015        Index (name =  " idx__title"  , columnList =  " title, useYn, tmpYn, reported, applied"  )
11-     ])
16+     ]
17+ )
1218@Entity
1319class  House (
1420
21+     var  agentDetail :  String? ,
22+ 
1523    @Enumerated(EnumType .STRING )
1624    @Column(name =  " house_type"  )
17-     var  houseType   :  HouseType , //  매물타입
25+     var  houseType :  HouseType , //  매물타입
1826
1927    @Convert(converter =  RentalTypeConverter ::class )
2028    @Column(length =  40 )
@@ -30,18 +38,18 @@ class House(
3038    var  purpose :  String? , //  용도 ( 예: 주택 )
3139
3240    @Column(nullable =  true )
33-     var  floorNum   :  Int , //  층수 ( 다가구인 경우에만 )
41+     var  floorNum :  Int , //  층수 ( 다가구인 경우에만 )
3442
3543    @Column(length =  13 )
36-     var  contact   :  String , //  바로 연락 가능한 연락처
44+     var  contact :  String , //  바로 연락 가능한 연락처
3745
3846    @Column(length =  5 )
39-     var  createdDate   :  String? , //  준공연도,
47+     var  createdDate :  String? , //  준공연도,
4048
4149    var  price :  Int , //  매물가격
4250
4351    @Column(nullable =  true )
44-     var  monthlyPrice   :  Double , //  월세의 경우,
52+     var  monthlyPrice :  Double , //  월세의 경우,
4553
4654    @Column(length =  20 )
4755    var  agentName :  String , //  공인중개사명
@@ -50,28 +58,28 @@ class House(
5058    var  title :  String , //  게시글 제목
5159
5260    @Column(length =  Int .MAX_VALUE )
53-     var  content   :  String , //  게시글 내용
61+     var  content :  String , //  게시글 내용
5462
5563    @Column(length =  Int .MAX_VALUE )
56-     var  code   :  String , //  게시글 코드
64+     var  code :  String , //  게시글 코드
5765
5866    @Column(length =  Int .MAX_VALUE )
5967    @Convert(converter =  BoardImageUrlConverter ::class ) //  이미지 url ","로 슬라이싱
60-     var  imageUrls   :  List <String >,
68+     var  imageUrls :  List <String >,
6169
6270    @ManyToOne(fetch =  FetchType .LAZY )
6371    @JoinColumn(name =  " user_id"  , nullable =  false )
64-     var  user   :  User ,
72+     var  user :  User ,
6573
66-     var  useYn   :  Boolean  = true , //  삭제여부 ( 미삭제 : true, 삭제 : false )
74+     var  useYn :  Boolean  = true , //  삭제여부 ( 미삭제 : true, 삭제 : false )
6775
68-     var  tmpYn   :  Boolean  = false , //  임시저장여부 ( 임시저장: true, 저장 : false )
76+     var  tmpYn :  Boolean  = false , //  임시저장여부 ( 임시저장: true, 저장 : false )
6977
70-     var  reported   :  Boolean  = false , //  신고여부 ( 신고: true, 미신고 : false )
78+     var  reported :  Boolean  = false , //  신고여부 ( 신고: true, 미신고 : false )
7179
7280    @Convert(converter =  HouseReviewStatusConverter ::class )
7381    @Column(length =  10 )
74-     var  applied   :  HouseReviewStatus ?  = null , //  신청여부
82+     var  applied :  HouseReviewStatus ?  = null , //  신청여부
7583
7684    @Column(nullable =  true , length =  200 )
7785    var  rejectReason :  String?  = null , //  관리자가 게시글을 반려한 이유
@@ -93,24 +101,26 @@ class House(
93101) : BaseEntity() {
94102
95103    @OneToOne
96-     lateinit  var  deal: Deal 
104+     lateinit  var  deal:   Deal 
97105
98106    fun  updateEntity (
107+         agentDetail :  String? ,
99108        houseType :  HouseType ,
100-          rentalType :  RentalType ,
101-          size :  String ,
102-          purpose :  String? ,
103-          floorNum :  Int ,
104-          contact :  String ,
105-          createdDate :  String? ,
106-          price :  Int ,
107-          monthlyPrice :  Double ,
108-          agentName  :  String ,
109-          title :  String ,
110-          content  :  String ,
111-          code :  String ,
112-          imageUrls :  List <String >
113-     ) : House  {
109+         rentalType :  RentalType ,
110+         size :  String ,
111+         purpose :  String? ,
112+         floorNum :  Int ,
113+         contact :  String ,
114+         createdDate :  String? ,
115+         price :  Int ,
116+         monthlyPrice :  Double ,
117+         agentName :  String ,
118+         title :  String ,
119+         content :  String ,
120+         code :  String ,
121+         imageUrls :  List <String >
122+     ): House  {
123+         this .agentDetail =  agentDetail
114124        this .houseType =  houseType
115125        this .rentalType =  rentalType
116126        this .size =  size
@@ -127,6 +137,7 @@ class House(
127137        this .imageUrls =  imageUrls
128138        return  this 
129139    }
140+ 
130141    fun  deleteEntity () {
131142        this .useYn =  false 
132143    }
@@ -150,7 +161,7 @@ class House(
150161        this .rejectReason =  rejectReason
151162    }
152163
153-     fun  addScrap (scrap :  Scrap )  : House  {
164+     fun  addScrap (scrap :  Scrap ): House  {
154165        this .scrap.add(scrap)
155166        return  this 
156167    }
@@ -172,7 +183,7 @@ class House(
172183        this .dealState =  DealState .COMPLETED 
173184    }
174185
175-     fun  addHouseTag (houseTag :  HouseTag )  : House  {
186+     fun  addHouseTag (houseTag :  HouseTag ): House  {
176187        this .houseTag.add(houseTag)
177188        return  this 
178189    }
0 commit comments