Fix: Resolve Go and Flutter compilation errors
Go backend: - Fix WOPI models file (remove duplicate package declaration and syntax errors) - Add GetOrgMember method to database as alias for GetUserMembership - Add UpdateFileSize method to database - Remove unused net/url import from wopi_handlers.go - Fix field names in WOPI struct initializers (match JSON tags) Flutter frontend: - Remove webview_flutter import (use simpler placeholder for now) - Fix _createWOPISession to safely access SessionBloc state - Replace WebViewController usage with placeholder UI - Remove unused _generateRandomHex methods from login/signup forms - Add missing mimeType parameter to DocumentCapabilities in mock repository - Remove unused local variables in file_browser_bloc
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
package models
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
@@ -7,16 +6,70 @@ import "time"
|
||||
// Reference: https://docs.microsoft.com/en-us/openspecs/office_protocols/ms-wopi/4b8ffc3f-e8a6-4169-8c4e-34924ac6ae2f
|
||||
type WOPICheckFileInfoResponse struct {
|
||||
BaseFileName string `json:"BaseFileName"`
|
||||
Size int64 `json:"Size"`
|
||||
Version string `json:"Version"`
|
||||
OwnerId string `json:"OwnerId"`
|
||||
UserId string `json:"UserId"`
|
||||
UserFriendlyName string `json:"UserFriendlyName"`
|
||||
UserCanWrite bool `json:"UserCanWrite"`
|
||||
UserCanRename bool `json:"UserCanRename"`
|
||||
UserCanNotWriteRelative bool `json:"UserCanNotWriteRelative"`
|
||||
ReadOnly bool `json:"ReadOnly"`
|
||||
RestrictedWebViewOnly bool `json:"RestrictedWebViewOnly"`
|
||||
Size int64 `json:"Size"`
|
||||
Version string `json:"Version"`
|
||||
OwnerId string `json:"OwnerId"`
|
||||
UserId string `json:"UserId"`
|
||||
UserFriendlyName string `json:"UserFriendlyName"`
|
||||
UserCanWrite bool `json:"UserCanWrite"`
|
||||
UserCanRename bool `json:"UserCanRename"`
|
||||
UserCanNotWriteRelative bool `json:"UserCanNotWriteRelative"`
|
||||
ReadOnly bool `json:"ReadOnly"`
|
||||
RestrictedWebViewOnly bool `json:"RestrictedWebViewOnly"`
|
||||
UserCanCreateRelativeToFolder bool `json:"UserCanCreateRelativeToFolder"`
|
||||
EnableOwnerTermination bool `json:"EnableOwnerTermination"`
|
||||
SupportsUpdate bool `json:"SupportsUpdate"`
|
||||
SupportsCobalt bool `json:"SupportsCobalt"`
|
||||
SupportsLocks bool `json:"SupportsLocks"`
|
||||
SupportsExtendedLockLength bool `json:"SupportsExtendedLockLength"`
|
||||
SupportsGetLock bool `json:"SupportsGetLock"`
|
||||
SupportsDelete bool `json:"SupportsDelete"`
|
||||
SupportsRename bool `json:"SupportsRename"`
|
||||
SupportsRenameRelativeToFolder bool `json:"SupportsRenameRelativeToFolder"`
|
||||
SupportsFolders bool `json:"SupportsFolders"`
|
||||
SupportsScenarios []string `json:"SupportsScenarios"`
|
||||
LastModifiedTime string `json:"LastModifiedTime"`
|
||||
IsAnonymousUser bool `json:"IsAnonymousUser"`
|
||||
TimeZone string `json:"TimeZone"`
|
||||
CloseUrl string `json:"CloseUrl,omitempty"`
|
||||
EditUrl string `json:"EditUrl,omitempty"`
|
||||
ViewUrl string `json:"ViewUrl,omitempty"`
|
||||
FileSharingUrl string `json:"FileSharingUrl,omitempty"`
|
||||
DownloadUrl string `json:"DownloadUrl,omitempty"`
|
||||
}
|
||||
|
||||
// WOPIPutFileResponse represents the response to WOPI PutFile request
|
||||
type WOPIPutFileResponse struct {
|
||||
ItemVersion string `json:"ItemVersion"`
|
||||
}
|
||||
|
||||
// WOPILockInfo represents information about a file lock
|
||||
type WOPILockInfo struct {
|
||||
FileID string `json:"file_id"`
|
||||
UserID string `json:"user_id"`
|
||||
LockID string `json:"lock_id"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
ExpiresAt time.Time `json:"expires_at"`
|
||||
}
|
||||
|
||||
// WOPIAccessTokenRequest represents a request to get WOPI access token
|
||||
type WOPIAccessTokenRequest struct {
|
||||
FileID string `json:"file_id"`
|
||||
}
|
||||
|
||||
// WOPIAccessTokenResponse represents a response with WOPI access token
|
||||
type WOPIAccessTokenResponse struct {
|
||||
AccessToken string `json:"access_token"`
|
||||
AccessTokenTTL int64 `json:"access_token_ttl"`
|
||||
BootstrapperUrl string `json:"bootstrapper_url,omitempty"`
|
||||
ClosePostMessage bool `json:"close_post_message"`
|
||||
}
|
||||
|
||||
// WOPISessionResponse represents a response for creating a WOPI session
|
||||
type WOPISessionResponse struct {
|
||||
WOPISrc string `json:"wopi_src"`
|
||||
AccessToken string `json:"access_token"`
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user