File tree 3 files changed +11
-11
lines changed
telegram-bot/src/main/kotlin/by/jprof/coding/problems/bot
3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -15,25 +15,25 @@ enum class Messenger(val messenger: String) {
15
15
}
16
16
17
17
@Table
18
- data class Problem (
19
- @Id @JvmField var id : String ,
20
- val link : String ,
21
- val title : String ,
18
+ class Problem (
19
+ @Id @JvmField var id : String? ,
20
+ val link : String? ,
21
+ val title : String? ,
22
22
val acceptance : String? ,
23
- val difficulty : String ,
24
- val platform : String = Platform .LEETCODE .platform
23
+ val difficulty : String? ,
24
+ val platform : String? = Platform .LEETCODE .platform
25
25
) : Persistable<String> {
26
- override fun getId (): String = id
26
+ override fun getId (): String ? = id
27
27
28
28
override fun isNew (): Boolean {
29
- val new = id.isEmpty()
29
+ val new = id? .isEmpty() ? : true
30
30
id = if (new) UUID .randomUUID().toString() else id
31
31
return new
32
32
}
33
33
34
34
}
35
35
36
- data class Chat (
36
+ class Chat (
37
37
val id : String ,
38
38
val messenger : String = Messenger .TELEGRAM .messenger
39
39
)
Original file line number Diff line number Diff line change 1
1
package by.jprof.coding.problems.bot.projection
2
2
3
3
interface ProblemLink {
4
- fun getLink () : String
4
+ val link : String
5
5
}
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ class PoolLeetcodeProblem(
29
29
fun runPool () = runBlocking {
30
30
txOperator.executeAndAwait {
31
31
log.info(" getting saved leetcode problems" )
32
- val links = problemRepository.findAllProjectedBy().map { it.getLink() }.toSet()
32
+ val links = problemRepository.findAllProjectedBy().map { it.link }.toSet()
33
33
log.info(" scraping all leetcode the problems" )
34
34
val scrapedProblems = leetCodeProblemsScraper.scrapeAllLeetCodeProblems()
35
35
scrapedProblems.forEach {log.info(it.difficulty)}
You canβt perform that action at this time.
0 commit comments