git clone功能
网站登录 → 创建项目 Git Token → clone → 本地修改、commit → push main → 网站工作区刷新后显示最新内容 → 网站手动发布到社区
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
package com.linkerbot.vibemake.bean;
|
||||
|
||||
import jakarta.validation.constraints.Max;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public final class GitContracts {
|
||||
private GitContracts() {}
|
||||
|
||||
public enum Scope {
|
||||
READ_ONLY,
|
||||
READ_WRITE
|
||||
}
|
||||
|
||||
public record TokenInput(
|
||||
@NotBlank @Size(max = 64) String name,
|
||||
@NotNull Scope scope,
|
||||
@Min(1) @Max(365) Integer expiresInDays) {}
|
||||
|
||||
public record TokenView(
|
||||
String tokenCode,
|
||||
String name,
|
||||
Scope scope,
|
||||
String status,
|
||||
LocalDateTime createdAt,
|
||||
LocalDateTime expiresAt,
|
||||
LocalDateTime revokedAt,
|
||||
LocalDateTime lastUsedAt) {}
|
||||
|
||||
public record IssuedToken(TokenView credential, String token) {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "IssuedToken[credential=" + credential + ", token=[redacted]]";
|
||||
}
|
||||
}
|
||||
|
||||
public record ConnectionView(
|
||||
String cloneUrl,
|
||||
String username,
|
||||
String defaultBranch,
|
||||
String headCommitSha,
|
||||
String publishedCommitSha,
|
||||
String writeStatus,
|
||||
boolean canPush) {}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.linkerbot.vibemake.bean.entity;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class ProjectGitToken extends BaseEntity {
|
||||
private String tokenCode;
|
||||
private String projectCode;
|
||||
private Long ownerUserId;
|
||||
private String tokenName;
|
||||
private String tokenHash;
|
||||
private String permission;
|
||||
private Long sessionVersion;
|
||||
private LocalDateTime expiresAt;
|
||||
private LocalDateTime revokedAt;
|
||||
private LocalDateTime lastUsedAt;
|
||||
}
|
||||
+4
@@ -12,6 +12,10 @@ import java.time.LocalDateTime;
|
||||
public class RepositoryWriteOperation {
|
||||
@TableId(type = IdType.INPUT)
|
||||
private String operationCode;
|
||||
private String operationKind;
|
||||
private String targetCommitSha;
|
||||
private String actorUserCode;
|
||||
private String gitTokenCode;
|
||||
private String projectCode;
|
||||
private Long repositoryId;
|
||||
private String repositoryOwner;
|
||||
|
||||
Reference in New Issue
Block a user