Refactor and improve code consistency across multiple files
- Enhanced SQL queries in `session.go` and `share.go` for clarity and consistency. - Updated comments for better understanding and maintenance. - Ensured consistent error handling and return statements across various methods.
This commit is contained in:
@@ -14,28 +14,26 @@ const (
|
||||
)
|
||||
|
||||
type Document struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Type DocumentType `json:"type"`
|
||||
YjsState []byte `json:"-"`
|
||||
OwnerID *uuid.UUID `json:"owner_id"` // NEW
|
||||
Is_Public bool `json:"is_public"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
ID uuid.UUID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Type DocumentType `json:"type"`
|
||||
YjsState []byte `json:"-"`
|
||||
OwnerID *uuid.UUID `json:"owner_id"` // NEW
|
||||
Is_Public bool `json:"is_public"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
|
||||
type CreateDocumentRequest struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
Type DocumentType `json:"type" binding:"required"`
|
||||
}
|
||||
Name string `json:"name" binding:"required"`
|
||||
Type DocumentType `json:"type" binding:"required"`
|
||||
}
|
||||
|
||||
type UpdateStateRequest struct {
|
||||
State []byte `json:"state" binding:"required"`
|
||||
}
|
||||
|
||||
type DocumentListResponse struct {
|
||||
Documents []Document `json:"documents"`
|
||||
Total int `json:"total"`
|
||||
}
|
||||
type UpdateStateRequest struct {
|
||||
State []byte `json:"state" binding:"required"`
|
||||
}
|
||||
|
||||
type DocumentListResponse struct {
|
||||
Documents []Document `json:"documents"`
|
||||
Total int `json:"total"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user