Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
da906c66
Commit
da906c66
authored
Jun 16, 2025
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: tweak workspace service
parent
3b0c8759
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
17 deletions
+28
-17
workspace_service.proto
proto/api/v1/workspace_service.proto
+9
-4
workspace_service.pb.go
proto/gen/api/v1/workspace_service.pb.go
+5
-3
workspace_service_grpc.pb.go
proto/gen/api/v1/workspace_service_grpc.pb.go
+2
-2
apidocs.swagger.yaml
proto/gen/apidocs.swagger.yaml
+5
-4
workspace_service.go
server/router/api/v1/workspace_service.go
+1
-0
workspace_service.ts
web/src/types/proto/api/v1/workspace_service.ts
+6
-4
No files found.
proto/api/v1/workspace_service.proto
View file @
da906c66
...
...
@@ -7,22 +7,27 @@ import "google/api/annotations.proto";
option
go_package
=
"gen/api/v1"
;
service
WorkspaceService
{
// Get
WorkspaceProfile return
s the workspace profile.
// Gets the workspace profile.
rpc
GetWorkspaceProfile
(
GetWorkspaceProfileRequest
)
returns
(
WorkspaceProfile
)
{
option
(
google.api.http
)
=
{
get
:
"/api/v1/workspace/profile"
};
}
}
// Workspace profile message containing basic workspace information.
message
WorkspaceProfile
{
// The name of instance owner.
// Format: users/{user}
string
owner
=
1
;
// version is the current version of instance
// Version is the current version of instance.
string
version
=
2
;
// mode is the instance mode (e.g. "prod", "dev" or "demo").
// Mode is the instance mode (e.g. "prod", "dev" or "demo").
string
mode
=
3
;
// instance_url is the URL of the instance.
// Instance URL is the URL of the instance.
string
instance_url
=
6
;
}
// Request for workspace profile.
message
GetWorkspaceProfileRequest
{}
proto/gen/api/v1/workspace_service.pb.go
View file @
da906c66
...
...
@@ -22,16 +22,17 @@ const (
_
=
protoimpl
.
EnforceVersion
(
protoimpl
.
MaxVersion
-
20
)
)
// Workspace profile message containing basic workspace information.
type
WorkspaceProfile
struct
{
state
protoimpl
.
MessageState
`protogen:"open.v1"`
// The name of instance owner.
// Format: users/{user}
Owner
string
`protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"`
//
version is the current version of instance
//
Version is the current version of instance.
Version
string
`protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
//
m
ode is the instance mode (e.g. "prod", "dev" or "demo").
//
M
ode is the instance mode (e.g. "prod", "dev" or "demo").
Mode
string
`protobuf:"bytes,3,opt,name=mode,proto3" json:"mode,omitempty"`
//
instance_url
is the URL of the instance.
//
Instance URL
is the URL of the instance.
InstanceUrl
string
`protobuf:"bytes,6,opt,name=instance_url,json=instanceUrl,proto3" json:"instance_url,omitempty"`
unknownFields
protoimpl
.
UnknownFields
sizeCache
protoimpl
.
SizeCache
...
...
@@ -95,6 +96,7 @@ func (x *WorkspaceProfile) GetInstanceUrl() string {
return
""
}
// Request for workspace profile.
type
GetWorkspaceProfileRequest
struct
{
state
protoimpl
.
MessageState
`protogen:"open.v1"`
unknownFields
protoimpl
.
UnknownFields
...
...
proto/gen/api/v1/workspace_service_grpc.pb.go
View file @
da906c66
...
...
@@ -26,7 +26,7 @@ const (
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type
WorkspaceServiceClient
interface
{
// Get
WorkspaceProfile return
s the workspace profile.
// Gets the workspace profile.
GetWorkspaceProfile
(
ctx
context
.
Context
,
in
*
GetWorkspaceProfileRequest
,
opts
...
grpc
.
CallOption
)
(
*
WorkspaceProfile
,
error
)
}
...
...
@@ -52,7 +52,7 @@ func (c *workspaceServiceClient) GetWorkspaceProfile(ctx context.Context, in *Ge
// All implementations must embed UnimplementedWorkspaceServiceServer
// for forward compatibility.
type
WorkspaceServiceServer
interface
{
// Get
WorkspaceProfile return
s the workspace profile.
// Gets the workspace profile.
GetWorkspaceProfile
(
context
.
Context
,
*
GetWorkspaceProfileRequest
)
(
*
WorkspaceProfile
,
error
)
mustEmbedUnimplementedWorkspaceServiceServer
()
}
...
...
proto/gen/apidocs.swagger.yaml
View file @
da906c66
...
...
@@ -694,7 +694,7 @@ paths:
-
WebhookService
/api/v1/workspace/profile
:
get
:
summary
:
Get
WorkspaceProfile return
s the workspace profile.
summary
:
Gets the workspace profile.
operationId
:
WorkspaceService_GetWorkspaceProfile
responses
:
"
200"
:
...
...
@@ -3690,10 +3690,11 @@ definitions:
Format: users/{user}
version
:
type
:
string
title
:
version is the current version of instance
description
:
Version is the current version of instance.
mode
:
type
:
string
description
:
m
ode is the instance mode (e.g. "prod", "dev" or "demo").
description
:
M
ode is the instance mode (e.g. "prod", "dev" or "demo").
instanceUrl
:
type
:
string
description
:
instance_url is the URL of the instance.
description
:
Instance URL is the URL of the instance.
description
:
Workspace profile message containing basic workspace information.
server/router/api/v1/workspace_service.go
View file @
da906c66
...
...
@@ -11,6 +11,7 @@ import (
"github.com/usememos/memos/store"
)
// GetWorkspaceProfile returns the workspace profile.
func
(
s
*
APIV1Service
)
GetWorkspaceProfile
(
ctx
context
.
Context
,
_
*
v1pb
.
GetWorkspaceProfileRequest
)
(
*
v1pb
.
WorkspaceProfile
,
error
)
{
workspaceProfile
:=
&
v1pb
.
WorkspaceProfile
{
Version
:
s
.
Profile
.
Version
,
...
...
web/src/types/proto/api/v1/workspace_service.ts
View file @
da906c66
...
...
@@ -9,20 +9,22 @@ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
export
const
protobufPackage
=
"memos.api.v1"
;
/** Workspace profile message containing basic workspace information. */
export
interface
WorkspaceProfile
{
/**
* The name of instance owner.
* Format: users/{user}
*/
owner
:
string
;
/**
version is the current version of instance
*/
/**
Version is the current version of instance.
*/
version
:
string
;
/**
m
ode is the instance mode (e.g. "prod", "dev" or "demo"). */
/**
M
ode is the instance mode (e.g. "prod", "dev" or "demo"). */
mode
:
string
;
/**
instance_url
is the URL of the instance. */
/**
Instance URL
is the URL of the instance. */
instanceUrl
:
string
;
}
/** Request for workspace profile. */
export
interface
GetWorkspaceProfileRequest
{
}
...
...
@@ -147,7 +149,7 @@ export const WorkspaceServiceDefinition = {
name
:
"WorkspaceService"
,
fullName
:
"memos.api.v1.WorkspaceService"
,
methods
:
{
/** Get
WorkspaceProfile return
s the workspace profile. */
/** Gets the workspace profile. */
getWorkspaceProfile
:
{
name
:
"GetWorkspaceProfile"
,
requestType
:
GetWorkspaceProfileRequest
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment