Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

chore: tweak workspace service

Stevenda906c665c18
diff --git a/proto/api/v1/workspace_service.proto b/proto/api/v1/workspace_service.proto
index 091f4c027..20e71c4d1 100644
--- a/proto/api/v1/workspace_service.proto
+++ b/proto/api/v1/workspace_service.proto
@@ -7,22 +7,27 @@ import "google/api/annotations.proto";
option go_package = "gen/api/v1";
service WorkspaceService {
- // GetWorkspaceProfile returns 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 {}
diff --git a/proto/gen/api/v1/workspace_service.pb.go b/proto/gen/api/v1/workspace_service.pb.go
index 72aa63810..05beb12fc 100644
--- a/proto/gen/api/v1/workspace_service.pb.go
+++ b/proto/gen/api/v1/workspace_service.pb.go
@@ -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"`
- // mode is the instance mode (e.g. "prod", "dev" or "demo").
+ // Mode 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
diff --git a/proto/gen/api/v1/workspace_service_grpc.pb.go b/proto/gen/api/v1/workspace_service_grpc.pb.go
index 36ca9fbb6..70c55e556 100644
--- a/proto/gen/api/v1/workspace_service_grpc.pb.go
+++ b/proto/gen/api/v1/workspace_service_grpc.pb.go
@@ -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 {
- // GetWorkspaceProfile returns 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 {
- // GetWorkspaceProfile returns the workspace profile.
+ // Gets the workspace profile.
GetWorkspaceProfile(context.Context, *GetWorkspaceProfileRequest) (*WorkspaceProfile, error)
mustEmbedUnimplementedWorkspaceServiceServer()
}
diff --git a/proto/gen/apidocs.swagger.yaml b/proto/gen/apidocs.swagger.yaml
index a36a53cdc..222cc740c 100644
--- a/proto/gen/apidocs.swagger.yaml
+++ b/proto/gen/apidocs.swagger.yaml
@@ -694,7 +694,7 @@ paths:
- WebhookService
/api/v1/workspace/profile:
get:
- summary: GetWorkspaceProfile returns 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: mode is the instance mode (e.g. "prod", "dev" or "demo").
+ description: Mode 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.
diff --git a/server/router/api/v1/workspace_service.go b/server/router/api/v1/workspace_service.go
index 46f327072..c518123ca 100644
--- a/server/router/api/v1/workspace_service.go
+++ b/server/router/api/v1/workspace_service.go
@@ -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,
diff --git a/web/src/types/proto/api/v1/workspace_service.ts b/web/src/types/proto/api/v1/workspace_service.ts
index 3f3dfbaeb..4833c9d17 100644
--- a/web/src/types/proto/api/v1/workspace_service.ts
+++ b/web/src/types/proto/api/v1/workspace_service.ts
@@ -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;
- /** mode is the instance mode (e.g. "prod", "dev" or "demo"). */
+ /** Mode 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: {
- /** GetWorkspaceProfile returns the workspace profile. */
+ /** Gets the workspace profile. */
getWorkspaceProfile: {
name: "GetWorkspaceProfile",
requestType: GetWorkspaceProfileRequest,