176 lines
5.3 KiB
Java
176 lines
5.3 KiB
Java
package com.muse.dto;
|
||
|
||
import java.net.URI;
|
||
import java.util.Objects;
|
||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||
import com.muse.dto.ContentSourceSnapshot;
|
||
import org.springframework.lang.Nullable;
|
||
import java.io.Serializable;
|
||
import java.time.OffsetDateTime;
|
||
import jakarta.validation.Valid;
|
||
import jakarta.validation.constraints.*;
|
||
import io.swagger.v3.oas.annotations.media.Schema;
|
||
|
||
|
||
import java.util.*;
|
||
import jakarta.annotation.Generated;
|
||
|
||
/**
|
||
* 分割 Block 请求;服务端必须校验 work owner、blockId 从属关系、commandId 幂等、expectedRevision 和 sourceSnapshot。
|
||
*/
|
||
|
||
@Schema(name = "SplitBlockRequest", description = "分割 Block 请求;服务端必须校验 work owner、blockId 从属关系、commandId 幂等、expectedRevision 和 sourceSnapshot。")
|
||
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2026-05-24T16:47:40.290595+08:00[Asia/Shanghai]", comments = "Generator version: 7.22.0")
|
||
public class SplitBlockRequest implements Serializable {
|
||
|
||
private static final long serialVersionUID = 1L;
|
||
|
||
private String commandId;
|
||
|
||
private Integer splitPosition;
|
||
|
||
private Integer expectedRevision;
|
||
|
||
private ContentSourceSnapshot sourceSnapshot;
|
||
|
||
public SplitBlockRequest() {
|
||
super();
|
||
}
|
||
|
||
/**
|
||
* Constructor with only required parameters
|
||
*/
|
||
public SplitBlockRequest(String commandId, Integer splitPosition, Integer expectedRevision, ContentSourceSnapshot sourceSnapshot) {
|
||
this.commandId = commandId;
|
||
this.splitPosition = splitPosition;
|
||
this.expectedRevision = expectedRevision;
|
||
this.sourceSnapshot = sourceSnapshot;
|
||
}
|
||
|
||
public SplitBlockRequest commandId(String commandId) {
|
||
this.commandId = commandId;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 幂等键
|
||
* @return commandId
|
||
*/
|
||
@NotNull
|
||
@Schema(name = "commandId", description = "幂等键", requiredMode = Schema.RequiredMode.REQUIRED)
|
||
@JsonProperty("commandId")
|
||
public String getCommandId() {
|
||
return commandId;
|
||
}
|
||
|
||
@JsonProperty("commandId")
|
||
public void setCommandId(String commandId) {
|
||
this.commandId = commandId;
|
||
}
|
||
|
||
public SplitBlockRequest splitPosition(Integer splitPosition) {
|
||
this.splitPosition = splitPosition;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 分割位置(字符偏移量)
|
||
* @return splitPosition
|
||
*/
|
||
@NotNull
|
||
@Schema(name = "splitPosition", description = "分割位置(字符偏移量)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||
@JsonProperty("splitPosition")
|
||
public Integer getSplitPosition() {
|
||
return splitPosition;
|
||
}
|
||
|
||
@JsonProperty("splitPosition")
|
||
public void setSplitPosition(Integer splitPosition) {
|
||
this.splitPosition = splitPosition;
|
||
}
|
||
|
||
public SplitBlockRequest expectedRevision(Integer expectedRevision) {
|
||
this.expectedRevision = expectedRevision;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* Block 当前 revision(乐观锁)
|
||
* @return expectedRevision
|
||
*/
|
||
@NotNull
|
||
@Schema(name = "expectedRevision", description = "Block 当前 revision(乐观锁)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||
@JsonProperty("expectedRevision")
|
||
public Integer getExpectedRevision() {
|
||
return expectedRevision;
|
||
}
|
||
|
||
@JsonProperty("expectedRevision")
|
||
public void setExpectedRevision(Integer expectedRevision) {
|
||
this.expectedRevision = expectedRevision;
|
||
}
|
||
|
||
public SplitBlockRequest sourceSnapshot(ContentSourceSnapshot sourceSnapshot) {
|
||
this.sourceSnapshot = sourceSnapshot;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* Get sourceSnapshot
|
||
* @return sourceSnapshot
|
||
*/
|
||
@NotNull @Valid
|
||
@Schema(name = "sourceSnapshot", requiredMode = Schema.RequiredMode.REQUIRED)
|
||
@JsonProperty("sourceSnapshot")
|
||
public ContentSourceSnapshot getSourceSnapshot() {
|
||
return sourceSnapshot;
|
||
}
|
||
|
||
@JsonProperty("sourceSnapshot")
|
||
public void setSourceSnapshot(ContentSourceSnapshot sourceSnapshot) {
|
||
this.sourceSnapshot = sourceSnapshot;
|
||
}
|
||
|
||
@Override
|
||
public boolean equals(Object o) {
|
||
if (this == o) {
|
||
return true;
|
||
}
|
||
if (o == null || getClass() != o.getClass()) {
|
||
return false;
|
||
}
|
||
SplitBlockRequest splitBlockRequest = (SplitBlockRequest) o;
|
||
return Objects.equals(this.commandId, splitBlockRequest.commandId) &&
|
||
Objects.equals(this.splitPosition, splitBlockRequest.splitPosition) &&
|
||
Objects.equals(this.expectedRevision, splitBlockRequest.expectedRevision) &&
|
||
Objects.equals(this.sourceSnapshot, splitBlockRequest.sourceSnapshot);
|
||
}
|
||
|
||
@Override
|
||
public int hashCode() {
|
||
return Objects.hash(commandId, splitPosition, expectedRevision, sourceSnapshot);
|
||
}
|
||
|
||
@Override
|
||
public String toString() {
|
||
StringBuilder sb = new StringBuilder();
|
||
sb.append("class SplitBlockRequest {\n");
|
||
sb.append(" commandId: ").append(toIndentedString(commandId)).append("\n");
|
||
sb.append(" splitPosition: ").append(toIndentedString(splitPosition)).append("\n");
|
||
sb.append(" expectedRevision: ").append(toIndentedString(expectedRevision)).append("\n");
|
||
sb.append(" sourceSnapshot: ").append(toIndentedString(sourceSnapshot)).append("\n");
|
||
sb.append("}");
|
||
return sb.toString();
|
||
}
|
||
|
||
/**
|
||
* Convert the given object to string with each line indented by 4 spaces
|
||
* (except the first line).
|
||
*/
|
||
private String toIndentedString(@Nullable Object o) {
|
||
return o == null ? "null" : o.toString().replace("\n", "\n ");
|
||
}
|
||
}
|
||
|