Module project, commit, submission
All checks were successful
Build and Release / release (push) Successful in 1m15s
All checks were successful
Build and Release / release (push) Successful in 1m15s
This commit is contained in:
12
internal/dtos/request/commit.go
Normal file
12
internal/dtos/request/commit.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package request
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
type CreateCommitDto struct {
|
||||
SnapshotJson json.RawMessage `json:"snapshot_json" validate:"required"`
|
||||
EditSummary string `json:"edit_summary" validate:"required,max=500"`
|
||||
}
|
||||
|
||||
type RestoreCommitDto struct {
|
||||
CommitID string `json:"commit_id" validate:"required,uuid"`
|
||||
}
|
||||
14
internal/dtos/request/project_member.go
Normal file
14
internal/dtos/request/project_member.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package request
|
||||
|
||||
type AddProjectMemberDto struct {
|
||||
UserID string `json:"user_id" validate:"required,uuid"`
|
||||
Role string `json:"role" validate:"required,oneof=EDITOR VIEWER"`
|
||||
}
|
||||
|
||||
type UpdateProjectMemberDto struct {
|
||||
Role string `json:"role" validate:"required,oneof=EDITOR VIEWER"`
|
||||
}
|
||||
|
||||
type ChangeOwnerDto struct {
|
||||
NewOwnerID string `json:"new_owner_id" validate:"required,uuid"`
|
||||
}
|
||||
26
internal/dtos/request/submissionRequest.go
Normal file
26
internal/dtos/request/submissionRequest.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package request
|
||||
|
||||
import "time"
|
||||
|
||||
type CreateSubmissionDto struct {
|
||||
ProjectID string `json:"project_id" validate:"required"`
|
||||
CommitID string `json:"commit_id" validate:"required"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
type UpdateSubmissionStatusDto struct {
|
||||
Status string `json:"status" validate:"required"`
|
||||
ReviewNote string `json:"review_note" validate:"required,min=10"`
|
||||
}
|
||||
|
||||
type SearchSubmissionDto struct {
|
||||
PaginationDto
|
||||
ProjectID string `json:"project_id" query:"project_id" validate:"omitempty,uuid"`
|
||||
Sort string `json:"sort" query:"sort" validate:"omitempty,oneof=id created_at reviewed_at status"`
|
||||
Search string `json:"search" query:"search" validate:"omitempty,min=2,max=200"`
|
||||
UserIDs []string `json:"user_ids" query:"user_ids" validate:"omitempty,dive,uuid"`
|
||||
Statuses []string `json:"statuses" query:"statuses" validate:"omitempty,dive,oneof=PENDING APPROVED REJECTED"`
|
||||
ReviewedBy *string `json:"reviewed_by" query:"reviewed_by" validate:"omitempty,uuid"`
|
||||
CreatedFrom *time.Time `json:"created_from" query:"created_from"`
|
||||
CreatedTo *time.Time `json:"created_to" query:"created_to"`
|
||||
}
|
||||
17
internal/dtos/response/commit.go
Normal file
17
internal/dtos/response/commit.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package response
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"time"
|
||||
)
|
||||
|
||||
type CommitResponse struct {
|
||||
ID string `json:"id"`
|
||||
ProjectID string `json:"project_id"`
|
||||
SnapshotJson json.RawMessage `json:"snapshot_json"`
|
||||
SnapshotHash string `json:"snapshot_hash"`
|
||||
UserID string `json:"user_id"`
|
||||
EditSummary string `json:"edit_summary"`
|
||||
CreatedAt *time.Time `json:"created_at"`
|
||||
User *UserSimpleResponse `json:"user,omitempty"`
|
||||
}
|
||||
@@ -2,19 +2,31 @@ package response
|
||||
|
||||
import "time"
|
||||
|
||||
type ProjectResponse struct {
|
||||
ID string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
LatestRevisionID *string `json:"latest_revision_id,omitempty"`
|
||||
VersionCount int32 `json:"version_count"`
|
||||
ProjectStatus string `json:"project_status"`
|
||||
LockedBy *string `json:"locked_by,omitempty"`
|
||||
IsDeleted bool `json:"is_deleted"`
|
||||
UserID string `json:"user_id"`
|
||||
CreatedAt *time.Time `json:"created_at"`
|
||||
UpdatedAt *time.Time `json:"updated_at"`
|
||||
User *UserSimpleResponse `json:"user,omitempty"`
|
||||
CommitIds []string `json:"commit_ids"`
|
||||
SubmissionIds []string `json:"submission_ids"`
|
||||
type CommitSimpleResponse struct {
|
||||
ID string `json:"id"`
|
||||
EditSummary string `json:"edit_summary"`
|
||||
}
|
||||
|
||||
type MemberSimpleResponse struct {
|
||||
UserID string `json:"user_id"`
|
||||
Role string `json:"role"`
|
||||
DisplayName string `json:"display_name"`
|
||||
AvatarUrl string `json:"avatar_url"`
|
||||
}
|
||||
|
||||
type ProjectResponse struct {
|
||||
ID string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
LatestCommitID *string `json:"latest_commit_id,omitempty"`
|
||||
ProjectStatus string `json:"project_status"`
|
||||
LockedBy *string `json:"locked_by,omitempty"`
|
||||
IsDeleted bool `json:"is_deleted"`
|
||||
UserID string `json:"user_id"`
|
||||
CreatedAt *time.Time `json:"created_at"`
|
||||
UpdatedAt *time.Time `json:"updated_at"`
|
||||
User *UserSimpleResponse `json:"user,omitempty"`
|
||||
Commits []CommitSimpleResponse `json:"commits"`
|
||||
SubmissionIds []string `json:"submission_ids"`
|
||||
Members []MemberSimpleResponse `json:"members"`
|
||||
}
|
||||
|
||||
18
internal/dtos/response/submissionResponse.go
Normal file
18
internal/dtos/response/submissionResponse.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package response
|
||||
|
||||
import "time"
|
||||
|
||||
type SubmissionResponse struct {
|
||||
ID string `json:"id"`
|
||||
ProjectID string `json:"project_id"`
|
||||
CommitID string `json:"commit_id"`
|
||||
UserID string `json:"user_id"`
|
||||
CreatedAt *time.Time `json:"created_at"`
|
||||
Status string `json:"status"`
|
||||
ReviewedBy *string `json:"reviewed_by,omitempty"`
|
||||
ReviewedAt *time.Time `json:"reviewed_at,omitempty"`
|
||||
ReviewNote *string `json:"review_note,omitempty"`
|
||||
Content *string `json:"content,omitempty"`
|
||||
User *UserSimpleResponse `json:"user"`
|
||||
Reviewer *UserSimpleResponse `json:"reviewer,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user