-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/poll #195
base: main
Are you sure you want to change the base?
Feat/poll #195
Conversation
ffa3621
to
1dd8487
Compare
SonarCloud Quality Gate failed. 0 Bugs 0.0% Coverage Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review done.
add(it) | ||
val emojiIndex = EMOJI_UNICODES.indexOf(vote.emoji.name) | ||
if (emojiIndex >= 0) { | ||
val optionIndex = voterIdToVotedOptionIndex[vote.userId] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
這也要是複數
@@ -33,6 +34,8 @@ private const val OPTION_QUESTION = "question" | |||
|
|||
private const val OPTION_OPTIONS = "options" | |||
|
|||
private const val OPTION_VOTE_LIMIT = "vote-limit" | |||
|
|||
private val EMOJI_UNICODES: Array<String> = arrayOf("0️⃣", "1️⃣", "2️⃣", "3️⃣", "4️⃣", "5️⃣", "6️⃣", "7️⃣", "8️⃣", "9️⃣", "\uD83D\uDD1F") | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改用 enum class
.addRequiredOption(OptionType.INTEGER, OPTION_TIME, "The duration of the poll session") | ||
.addRequiredOption(OptionType.STRING, OPTION_TIMEUNIT, "(Day | Minute | Second)") | ||
.addRequiredOption(OptionType.STRING, OPTION_TIMEUNIT, "(Days | Minutes | Seconds)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
使用 addChoice(),新增 Days、Minutes、Seconds 三個參數。
@@ -158,41 +171,58 @@ data class PollingSetting(val time: Long, val timeUnit: TimeUnit, val question: | |||
} | |||
|
|||
data class Vote(val userId: String, val emoji: EmojiUnion) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
emoji 改成用 Int,存數字
Why need this change? / Root cause:
Changes made:
Test Scope / Change impact: