大赛管理功能

This commit is contained in:
tiger_zhou 2024-03-08 10:28:31 +08:00
parent c0ed50ccdc
commit 985c1de837
2 changed files with 31 additions and 26 deletions

View File

@ -1881,10 +1881,10 @@ public final class RaceScoringRule {
*分值
* </pre>
*
* <code>uint32 score = 2;</code>
* <code>float score = 2;</code>
* @return The score.
*/
int getScore();
float getScore();
/**
* <pre>
@ -2061,17 +2061,17 @@ public final class RaceScoringRule {
}
public static final int SCORE_FIELD_NUMBER = 2;
private int score_ = 0;
private float score_ = 0F;
/**
* <pre>
*分值
* </pre>
*
* <code>uint32 score = 2;</code>
* <code>float score = 2;</code>
* @return The score.
*/
@java.lang.Override
public int getScore() {
public float getScore() {
return score_;
}
@ -2247,8 +2247,8 @@ public final class RaceScoringRule {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
}
if (score_ != 0) {
output.writeUInt32(2, score_);
if (java.lang.Float.floatToRawIntBits(score_) != 0) {
output.writeFloat(2, score_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(criteria_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 4, criteria_);
@ -2271,9 +2271,9 @@ public final class RaceScoringRule {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
}
if (score_ != 0) {
if (java.lang.Float.floatToRawIntBits(score_) != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(2, score_);
.computeFloatSize(2, score_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(criteria_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, criteria_);
@ -2302,8 +2302,9 @@ public final class RaceScoringRule {
if (!getName()
.equals(other.getName())) return false;
if (getScore()
!= other.getScore()) return false;
if (java.lang.Float.floatToIntBits(getScore())
!= java.lang.Float.floatToIntBits(
other.getScore())) return false;
if (!getCriteria()
.equals(other.getCriteria())) return false;
if (!getChildrenList()
@ -2324,7 +2325,8 @@ public final class RaceScoringRule {
hash = (37 * hash) + NAME_FIELD_NUMBER;
hash = (53 * hash) + getName().hashCode();
hash = (37 * hash) + SCORE_FIELD_NUMBER;
hash = (53 * hash) + getScore();
hash = (53 * hash) + java.lang.Float.floatToIntBits(
getScore());
hash = (37 * hash) + CRITERIA_FIELD_NUMBER;
hash = (53 * hash) + getCriteria().hashCode();
if (getChildrenCount() > 0) {
@ -2469,7 +2471,7 @@ public final class RaceScoringRule {
super.clear();
bitField0_ = 0;
name_ = "";
score_ = 0;
score_ = 0F;
criteria_ = "";
if (childrenBuilder_ == null) {
children_ = java.util.Collections.emptyList();
@ -2556,7 +2558,7 @@ public final class RaceScoringRule {
bitField0_ |= 0x00000001;
onChanged();
}
if (other.getScore() != 0) {
if (other.getScore() != 0F) {
setScore(other.getScore());
}
if (!other.getCriteria().isEmpty()) {
@ -2626,11 +2628,11 @@ public final class RaceScoringRule {
bitField0_ |= 0x00000001;
break;
} // case 10
case 16: {
score_ = input.readUInt32();
case 21: {
score_ = input.readFloat();
bitField0_ |= 0x00000002;
break;
} // case 16
} // case 21
case 34: {
criteria_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000004;
@ -2763,17 +2765,17 @@ public final class RaceScoringRule {
return this;
}
private int score_ ;
private float score_ ;
/**
* <pre>
*分值
* </pre>
*
* <code>uint32 score = 2;</code>
* <code>float score = 2;</code>
* @return The score.
*/
@java.lang.Override
public int getScore() {
public float getScore() {
return score_;
}
/**
@ -2781,11 +2783,11 @@ public final class RaceScoringRule {
*分值
* </pre>
*
* <code>uint32 score = 2;</code>
* <code>float score = 2;</code>
* @param value The score to set.
* @return This builder for chaining.
*/
public Builder setScore(int value) {
public Builder setScore(float value) {
score_ = value;
bitField0_ |= 0x00000002;
@ -2797,12 +2799,12 @@ public final class RaceScoringRule {
*分值
* </pre>
*
* <code>uint32 score = 2;</code>
* <code>float score = 2;</code>
* @return This builder for chaining.
*/
public Builder clearScore() {
bitField0_ = (bitField0_ & ~0x00000002);
score_ = 0;
score_ = 0F;
onChanged();
return this;
}
@ -4089,7 +4091,7 @@ public final class RaceScoringRule {
"\n\002id\030\001 \001(\003\022\014\n\004name\030\002 \001(\t\022)\n\013modify_info\030" +
"\003 \001(\0132\024.common.ModifyInfoVO\"\214\001\n\004Rule\022\036\n\005" +
"units\030\001 \003(\0132\017.race.Rule.Unit\032d\n\004Unit\022\014\n\004" +
"name\030\001 \001(\t\022\r\n\005score\030\002 \001(\r\022\020\n\010criteria\030\004 " +
"name\030\001 \001(\t\022\r\n\005score\030\002 \001(\002\022\020\n\010criteria\030\004 " +
"\001(\t\022!\n\010children\030\005 \003(\0132\017.race.Rule.Unit\022\n" +
"\n\002id\030\006 \001(\tB\033\n\031club.joylink.rtss.vo.raceb" +
"\006proto3"

View File

@ -1,5 +1,7 @@
package club.joylink.rtss.services.race;
import club.joylink.rtss.util.JsonUtils;
import club.joylink.rtss.vo.race.RaceScoringRule.RaceScoringRuleVO;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@ -12,7 +14,8 @@ public class ScoreRuleServiceTest {
@Test
public void detail() {
this.ruleService.detail(2L);
RaceScoringRuleVO ruleVO = this.ruleService.detail(7L);
System.out.println(JsonUtils.writeValueAsString(ruleVO));
}
}