-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from Oh-Lottery/store
판매처 추가
- Loading branch information
Showing
17 changed files
with
518 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
src/main/java/com/ohlottery/controller/LotteryAIController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package com.ohlottery.controller; | ||
|
||
import com.ohlottery.dto.Lottery645Dto; | ||
import com.ohlottery.dto.Lottery720Dto; | ||
import com.ohlottery.service.LotteryAIService; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/lottery/ai") | ||
public class LotteryAIController { | ||
|
||
private final LotteryAIService lotteryAIService; | ||
|
||
@GetMapping("/predict/645/{round}") | ||
public ResponseEntity<Lottery645Dto> get645Predict( | ||
@PathVariable long round | ||
) { | ||
return null; | ||
} | ||
|
||
@GetMapping("/statistic/645") | ||
public ResponseEntity<?> get645Statistic() { | ||
return ResponseEntity.ok(null); | ||
} | ||
|
||
@GetMapping("/trend/645") | ||
public ResponseEntity<?> get645Trend() { | ||
return ResponseEntity.ok(null); | ||
} | ||
|
||
@GetMapping("/predict/720/{round}") | ||
public ResponseEntity<Lottery720Dto> get720Predict( | ||
@PathVariable long round | ||
) { | ||
return null; | ||
} | ||
|
||
@GetMapping("/statistic/720") | ||
public ResponseEntity<?> get720Statistic() { | ||
return ResponseEntity.ok(null); | ||
} | ||
|
||
@GetMapping("/trend/720") | ||
public ResponseEntity<?> get720Trend() { | ||
return ResponseEntity.ok(null); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.ohlottery.dto; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@Schema(description = "로또 판매점 정보") | ||
public class LotteryStoreDto { | ||
|
||
@Schema(description = "판매처 ID", example = "1") | ||
private long storeId; | ||
|
||
@Schema(description = "판매처 이름", example = "1148") | ||
private String storeName; | ||
|
||
@Schema(description = "판매처 주소", example = "서울특별시 서초구 남부순환로 2423") | ||
private String storeAddress; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/main/java/com/ohlottery/entity/Lottery645WinningEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.ohlottery.entity; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Entity | ||
@Getter | ||
@NoArgsConstructor | ||
public class Lottery645WinningEntity extends LotteryWinningEntity { | ||
|
||
@Enumerated(EnumType.STRING) | ||
private WinningType type; | ||
|
||
public Lottery645WinningEntity(WinningType type) { | ||
this.type = type; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/main/java/com/ohlottery/entity/LotteryStoreEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.ohlottery.entity; | ||
|
||
import com.ohlottery.entity.middle.Lottery645EntityStore; | ||
import com.ohlottery.entity.middle.Lottery720EntityStore; | ||
import jakarta.persistence.*; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Entity | ||
@Getter | ||
@NoArgsConstructor | ||
public class LotteryStoreEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
private String storeName; | ||
private String storeAddress; | ||
|
||
@OneToMany(mappedBy = "storeEntity", cascade = CascadeType.ALL, orphanRemoval = true) | ||
private final List<Lottery645EntityStore> entity645List = new ArrayList<>(); | ||
|
||
@OneToMany(mappedBy = "storeEntity", cascade = CascadeType.ALL, orphanRemoval = true) | ||
private final List<Lottery720EntityStore> entity720List = new ArrayList<>(); | ||
|
||
@OneToMany(mappedBy = "store", cascade = CascadeType.ALL, orphanRemoval = true) | ||
private final List<LotteryWinningEntity> winningList = new ArrayList<>(); | ||
|
||
public LotteryStoreEntity(String storeName, String storeAddress) { | ||
this.storeName = storeName; | ||
this.storeAddress = storeAddress; | ||
} | ||
} | ||
|
23 changes: 23 additions & 0 deletions
23
src/main/java/com/ohlottery/entity/LotteryWinningEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.ohlottery.entity; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
@Entity | ||
@Getter | ||
@NoArgsConstructor | ||
@Inheritance(strategy = InheritanceType.JOINED) | ||
@DiscriminatorColumn | ||
public class LotteryWinningEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "store_id") | ||
@Setter | ||
private LotteryStoreEntity store; | ||
} |
Oops, something went wrong.