feat: Support translate_config for audio.rooms.create#118
feat: Support translate_config for audio.rooms.create#118chyroc merged 7 commits intocoze-dev:mainfrom
Conversation
|
xiangshicheng seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
Warning Rate limit exceeded@xiangshicheng has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 9 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
WalkthroughAdds two fields to RoomConfig: Changes
Sequence Diagram(s)The changes are schema additions only and do not alter control flow; no sequence diagram is necessary. Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
api/src/main/java/com/coze/openapi/client/audio/rooms/model/RoomConfig.java (1)
22-24: Use camelCase fields with explicit @JsonProperty and preserve Lombok builder defaults.
- Field names with underscores are against Java conventions and produce odd builder/accessor names.
- With Lombok, initializers are NOT applied when using the builder unless you mark them with
@Builder.Default. Without it,room_modewill benullwhen built viaRoomConfig.builder()...build()despite the= ""initializer.Refactor fields to camelCase and keep JSON as snake_case via
@JsonProperty. Preserve the default for builder use.- private String room_mode = ""; - - private TranslateConfig translate_config; + @JsonProperty("room_mode") + @lombok.Builder.Default + private String roomMode = ""; + + @JsonProperty("translate_config") + private TranslateConfig translateConfig;Notes:
- If
room_modehas a constrained set of values, prefer an enum (e.g.,RoomMode) and annotate with@JsonPropertyor a custom serializer to enforce valid inputs.- If empty strings should be omitted on the wire, consider
@JsonInclude(JsonInclude.Include.NON_EMPTY)at class level.Action to verify: Calls to
RoomConfig.of(codec)currently build via Lombok; confirm you expectroomModeto be""(with the change above) rather thannull.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
api/src/main/java/com/coze/openapi/client/audio/rooms/model/RoomConfig.java(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: test (Java 17 on Windows)
- GitHub Check: test (Java 8 on macOS)
- GitHub Check: test (Java 17 on macOS)
- GitHub Check: test (Java 11 on Windows)
🔇 Additional comments (1)
api/src/main/java/com/coze/openapi/client/audio/rooms/model/RoomConfig.java (1)
47-61: Drop manual accessors in favor of Lombok-generated methodsI ran a global search for the legacy snake_case getters/setters and found only their definitions in
RoomConfig.java—no external call sites referencegetRoom_mode(),setRoom_mode(),getTranslate_config(), orsetTranslate_config(). Removing them won’t break existing code.Next steps:
- Rename the fields from
room_mode→roomModeandtranslate_config→translateConfig.- Remove the manual getters/setters shown below.
- Rely on Lombok’s
@Data(or@Getter/@Setter) to generategetRoomMode(),setRoomMode(),getTranslateConfig(), andsetTranslateConfig().- Verify your JSON serialization still produces
room_mode/translate_config(e.g. via a class-level@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)or per-field@JsonProperty("room_mode")).- public String getRoom_mode() { - return room_mode; - } - - public void setRoom_mode(String room_mode) { - this.room_mode = room_mode; - } - - public TranslateConfig getTranslate_config() { - return translate_config; - } - - public void setTranslate_config(TranslateConfig translate_config) { - this.translate_config = translate_config; - }
api/src/main/java/com/coze/openapi/client/audio/rooms/model/RoomConfig.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
api/src/main/java/com/coze/openapi/client/audio/rooms/model/RoomConfig.java(1 hunks)
🧰 Additional context used
🪛 GitHub Actions: CI
api/src/main/java/com/coze/openapi/client/audio/rooms/model/RoomConfig.java
[error] 23-33: Spotless formatting check failed. The file has formatting violations (TranslateConfig inner class annotations and field formatting). Run 'mvn spotless:apply' to fix.
🔇 Additional comments (1)
api/src/main/java/com/coze/openapi/client/audio/rooms/model/RoomConfig.java (1)
35-49: Remove manual getters/setters in RoomConfig.javaLombok’s
@Dataon this class already generates proper camel-case accessors forroomModeandtranslateConfig. Since a project-wide search showed no references to the old snake_case methods (getRoom_mode,setRoom_mode,getTranslate_config,setTranslate_config) outside of their definitions inRoomConfig.java, you can safely delete those four methods. Lombok will supply the correctgetRoomMode(),setRoomMode(...),getTranslateConfig(), andsetTranslateConfig(...)at compile time.Apply:
--- a/api/src/main/java/com/coze/openapi/client/audio/rooms/model/RoomConfig.java +++ b/api/src/main/java/com/coze/openapi/client/audio/rooms/model/RoomConfig.java @@ -35,15 +35,7 @@ public class RoomConfig { - public String getRoom_mode() { - return room_mode; - } - - public void setRoom_mode(String room_mode) { - this.room_mode = room_mode; - } - - public TranslateConfig getTranslate_config() { - return translate_config; - } - - public void setTranslate_config(TranslateConfig translate_config) { - this.translate_config = translate_config; - } + // (removed) Lombok @Data now generates getters/setters for roomMode and translateConfig
RoomConfig内增加翻译语言类型属性