feat: consume generated Go SDK

This commit is contained in:
2026-08-17 11:46:40 +08:00
parent a6ef1da9bc
commit c7395c2fdb
28 changed files with 30 additions and 27 deletions
+2 -1
View File
@@ -4,6 +4,7 @@ go 1.24.1
require ( require (
connectrpc.com/connect v1.19.1 connectrpc.com/connect v1.19.1
git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go v0.1.0
github.com/bwmarrin/snowflake v0.3.0 github.com/bwmarrin/snowflake v0.3.0
github.com/bytedance/gg v1.1.0 github.com/bytedance/gg v1.1.0
github.com/bytedance/sonic v1.14.0 github.com/bytedance/sonic v1.14.0
@@ -18,7 +19,6 @@ require (
golang.org/x/net v0.48.0 golang.org/x/net v0.48.0
golang.org/x/sync v0.19.0 golang.org/x/sync v0.19.0
google.golang.org/grpc v1.79.2 google.golang.org/grpc v1.79.2
google.golang.org/protobuf v1.36.10
gorm.io/driver/postgres v1.6.0 gorm.io/driver/postgres v1.6.0
gorm.io/gorm v1.31.1 gorm.io/gorm v1.31.1
) )
@@ -70,5 +70,6 @@ require (
golang.org/x/sys v0.39.0 // indirect golang.org/x/sys v0.39.0 // indirect
golang.org/x/text v0.32.0 // indirect golang.org/x/text v0.32.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect
google.golang.org/protobuf v1.36.10 // indirect
nhooyr.io/websocket v1.8.6 // indirect nhooyr.io/websocket v1.8.6 // indirect
) )
+2
View File
@@ -3,6 +3,8 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT
connectrpc.com/connect v1.19.1 h1:R5M57z05+90EfEvCY1b7hBxDVOUl45PrtXtAV2fOC14= connectrpc.com/connect v1.19.1 h1:R5M57z05+90EfEvCY1b7hBxDVOUl45PrtXtAV2fOC14=
connectrpc.com/connect v1.19.1/go.mod h1:tN20fjdGlewnSFeZxLKb0xwIZ6ozc3OQs2hTXy4du9w= connectrpc.com/connect v1.19.1/go.mod h1:tN20fjdGlewnSFeZxLKb0xwIZ6ozc3OQs2hTXy4du9w=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go v0.1.0 h1:zX5Bx+8sQn2kVtlHbQaruq7olulSXDeNlNECzYsMF4o=
git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go v0.1.0/go.mod h1:G9rGGl2SwqLqNsJ2CAFD66k5xqhXh3JJJ1uGRPkynOg=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
@@ -3,7 +3,7 @@ package doc_container_mapper
import ( import (
"github.com/XingfenD/yoresee_doc/internal/dto" "github.com/XingfenD/yoresee_doc/internal/dto"
"github.com/XingfenD/yoresee_doc/internal/model" "github.com/XingfenD/yoresee_doc/internal/model"
pb "github.com/XingfenD/yoresee_doc/pkg/gen/yoresee_doc/v1" pb "git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go/yoresee_doc/v1"
) )
type knowledgeBaseAdapter struct{} type knowledgeBaseAdapter struct{}
+1 -1
View File
@@ -3,7 +3,7 @@ package doc_container_mapper
import ( import (
"github.com/XingfenD/yoresee_doc/internal/dto" "github.com/XingfenD/yoresee_doc/internal/dto"
"github.com/XingfenD/yoresee_doc/internal/model" "github.com/XingfenD/yoresee_doc/internal/model"
pb "github.com/XingfenD/yoresee_doc/pkg/gen/yoresee_doc/v1" pb "git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go/yoresee_doc/v1"
) )
type ownAdapter struct{} type ownAdapter struct{}
@@ -6,7 +6,7 @@ import (
"github.com/XingfenD/yoresee_doc/internal/dto" "github.com/XingfenD/yoresee_doc/internal/dto"
"github.com/XingfenD/yoresee_doc/internal/model" "github.com/XingfenD/yoresee_doc/internal/model"
pb "github.com/XingfenD/yoresee_doc/pkg/gen/yoresee_doc/v1" pb "git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go/yoresee_doc/v1"
) )
const defaultContainerName = "own" const defaultContainerName = "own"
+1 -1
View File
@@ -3,7 +3,7 @@ package doc_type_mapper
import ( import (
"github.com/XingfenD/yoresee_doc/internal/dto" "github.com/XingfenD/yoresee_doc/internal/dto"
"github.com/XingfenD/yoresee_doc/internal/model" "github.com/XingfenD/yoresee_doc/internal/model"
pb "github.com/XingfenD/yoresee_doc/pkg/gen/yoresee_doc/v1" pb "git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go/yoresee_doc/v1"
) )
type markdownAdapter struct{} type markdownAdapter struct{}
@@ -3,7 +3,7 @@ package doc_type_mapper
import ( import (
"github.com/XingfenD/yoresee_doc/internal/dto" "github.com/XingfenD/yoresee_doc/internal/dto"
"github.com/XingfenD/yoresee_doc/internal/model" "github.com/XingfenD/yoresee_doc/internal/model"
pb "github.com/XingfenD/yoresee_doc/pkg/gen/yoresee_doc/v1" pb "git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go/yoresee_doc/v1"
) )
type markdownSlideAdapter struct{} type markdownSlideAdapter struct{}
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"github.com/XingfenD/yoresee_doc/internal/dto" "github.com/XingfenD/yoresee_doc/internal/dto"
"github.com/XingfenD/yoresee_doc/internal/model" "github.com/XingfenD/yoresee_doc/internal/model"
pb "github.com/XingfenD/yoresee_doc/pkg/gen/yoresee_doc/v1" pb "git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go/yoresee_doc/v1"
) )
const defaultTypeName = "markdown" const defaultTypeName = "markdown"
+1 -1
View File
@@ -3,7 +3,7 @@ package doc_type_mapper
import ( import (
"github.com/XingfenD/yoresee_doc/internal/dto" "github.com/XingfenD/yoresee_doc/internal/dto"
"github.com/XingfenD/yoresee_doc/internal/model" "github.com/XingfenD/yoresee_doc/internal/model"
pb "github.com/XingfenD/yoresee_doc/pkg/gen/yoresee_doc/v1" pb "git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go/yoresee_doc/v1"
) )
type tableAdapter struct{} type tableAdapter struct{}
@@ -3,7 +3,7 @@ package doc_type_mapper
import ( import (
"github.com/XingfenD/yoresee_doc/internal/dto" "github.com/XingfenD/yoresee_doc/internal/dto"
"github.com/XingfenD/yoresee_doc/internal/model" "github.com/XingfenD/yoresee_doc/internal/model"
pb "github.com/XingfenD/yoresee_doc/pkg/gen/yoresee_doc/v1" pb "git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go/yoresee_doc/v1"
) )
type yoreseeRichTextAdapter struct{} type yoreseeRichTextAdapter struct{}
@@ -2,7 +2,7 @@ package template_container_mapper
import ( import (
"github.com/XingfenD/yoresee_doc/internal/dto" "github.com/XingfenD/yoresee_doc/internal/dto"
pb "github.com/XingfenD/yoresee_doc/pkg/gen/yoresee_doc/v1" pb "git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go/yoresee_doc/v1"
) )
type knowledgeBaseAdapter struct{} type knowledgeBaseAdapter struct{}
@@ -2,7 +2,7 @@ package template_container_mapper
import ( import (
"github.com/XingfenD/yoresee_doc/internal/dto" "github.com/XingfenD/yoresee_doc/internal/dto"
pb "github.com/XingfenD/yoresee_doc/pkg/gen/yoresee_doc/v1" pb "git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go/yoresee_doc/v1"
) )
type ownAdapter struct{} type ownAdapter struct{}
@@ -2,7 +2,7 @@ package template_container_mapper
import ( import (
"github.com/XingfenD/yoresee_doc/internal/dto" "github.com/XingfenD/yoresee_doc/internal/dto"
pb "github.com/XingfenD/yoresee_doc/pkg/gen/yoresee_doc/v1" pb "git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go/yoresee_doc/v1"
) )
type publicAdapter struct{} type publicAdapter struct{}
@@ -5,7 +5,7 @@ import (
"strings" "strings"
"github.com/XingfenD/yoresee_doc/internal/dto" "github.com/XingfenD/yoresee_doc/internal/dto"
pb "github.com/XingfenD/yoresee_doc/pkg/gen/yoresee_doc/v1" pb "git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go/yoresee_doc/v1"
) )
const defaultContainerName = "own" const defaultContainerName = "own"
+1 -1
View File
@@ -7,7 +7,7 @@ import (
"connectrpc.com/connect" "connectrpc.com/connect"
"github.com/XingfenD/yoresee_doc/internal/repository" "github.com/XingfenD/yoresee_doc/internal/repository"
"github.com/XingfenD/yoresee_doc/internal/transport/grpcserver" "github.com/XingfenD/yoresee_doc/internal/transport/grpcserver"
pb "github.com/XingfenD/yoresee_doc/pkg/gen/yoresee_doc/v1" pb "git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go/yoresee_doc/v1"
) )
func registerHandlers(mux *http.ServeMux, opts []connect.HandlerOption, repos *repository.Repositories) { func registerHandlers(mux *http.ServeMux, opts []connect.HandlerOption, repos *repository.Repositories) {
+1 -1
View File
@@ -9,7 +9,7 @@ import (
"connectrpc.com/connect" "connectrpc.com/connect"
"github.com/XingfenD/yoresee_doc/internal/repository" "github.com/XingfenD/yoresee_doc/internal/repository"
"github.com/redis/go-redis/v9" "github.com/redis/go-redis/v9"
pb "github.com/XingfenD/yoresee_doc/pkg/gen/yoresee_doc/v1" pb "git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go/yoresee_doc/v1"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"golang.org/x/net/http2" "golang.org/x/net/http2"
"golang.org/x/net/http2/h2c" "golang.org/x/net/http2/h2c"
@@ -6,7 +6,7 @@ import (
"github.com/XingfenD/yoresee_doc/internal/dto" "github.com/XingfenD/yoresee_doc/internal/dto"
"github.com/XingfenD/yoresee_doc/internal/service/auth_service" "github.com/XingfenD/yoresee_doc/internal/service/auth_service"
"github.com/XingfenD/yoresee_doc/internal/status" "github.com/XingfenD/yoresee_doc/internal/status"
pb "github.com/XingfenD/yoresee_doc/pkg/gen/yoresee_doc/v1" pb "git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go/yoresee_doc/v1"
) )
type AuthServiceServer struct { type AuthServiceServer struct {
@@ -12,7 +12,7 @@ import (
"github.com/XingfenD/yoresee_doc/internal/service/auth_service" "github.com/XingfenD/yoresee_doc/internal/service/auth_service"
"github.com/XingfenD/yoresee_doc/internal/service/comment_service" "github.com/XingfenD/yoresee_doc/internal/service/comment_service"
"github.com/XingfenD/yoresee_doc/internal/status" "github.com/XingfenD/yoresee_doc/internal/status"
pb "github.com/XingfenD/yoresee_doc/pkg/gen/yoresee_doc/v1" pb "git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go/yoresee_doc/v1"
) )
type CommentServiceServer struct { type CommentServiceServer struct {
+1 -1
View File
@@ -8,7 +8,7 @@ import (
"github.com/XingfenD/yoresee_doc/internal/media" "github.com/XingfenD/yoresee_doc/internal/media"
"github.com/XingfenD/yoresee_doc/internal/status" "github.com/XingfenD/yoresee_doc/internal/status"
"github.com/XingfenD/yoresee_doc/internal/utils" "github.com/XingfenD/yoresee_doc/internal/utils"
pb "github.com/XingfenD/yoresee_doc/pkg/gen/yoresee_doc/v1" pb "git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go/yoresee_doc/v1"
) )
func baseResponseFromErr(err error) *pb.BaseResponse { func baseResponseFromErr(err error) *pb.BaseResponse {
@@ -11,7 +11,7 @@ import (
"github.com/XingfenD/yoresee_doc/internal/service/document_service" "github.com/XingfenD/yoresee_doc/internal/service/document_service"
"github.com/XingfenD/yoresee_doc/internal/status" "github.com/XingfenD/yoresee_doc/internal/status"
"github.com/XingfenD/yoresee_doc/internal/utils" "github.com/XingfenD/yoresee_doc/internal/utils"
pb "github.com/XingfenD/yoresee_doc/pkg/gen/yoresee_doc/v1" pb "git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go/yoresee_doc/v1"
) )
type DocumentServiceServer struct { type DocumentServiceServer struct {
@@ -11,7 +11,7 @@ import (
"github.com/XingfenD/yoresee_doc/internal/service/invitation_service" "github.com/XingfenD/yoresee_doc/internal/service/invitation_service"
"github.com/XingfenD/yoresee_doc/internal/status" "github.com/XingfenD/yoresee_doc/internal/status"
"github.com/XingfenD/yoresee_doc/internal/utils" "github.com/XingfenD/yoresee_doc/internal/utils"
pb "github.com/XingfenD/yoresee_doc/pkg/gen/yoresee_doc/v1" pb "git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go/yoresee_doc/v1"
) )
type InvitationServiceServer struct { type InvitationServiceServer struct {
@@ -9,7 +9,7 @@ import (
"github.com/XingfenD/yoresee_doc/internal/service/knowledge_base_service" "github.com/XingfenD/yoresee_doc/internal/service/knowledge_base_service"
"github.com/XingfenD/yoresee_doc/internal/status" "github.com/XingfenD/yoresee_doc/internal/status"
"github.com/XingfenD/yoresee_doc/internal/utils" "github.com/XingfenD/yoresee_doc/internal/utils"
pb "github.com/XingfenD/yoresee_doc/pkg/gen/yoresee_doc/v1" pb "git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go/yoresee_doc/v1"
) )
type KnowledgeBaseServiceServer struct { type KnowledgeBaseServiceServer struct {
@@ -8,7 +8,7 @@ import (
"github.com/XingfenD/yoresee_doc/internal/service/auth_service" "github.com/XingfenD/yoresee_doc/internal/service/auth_service"
"github.com/XingfenD/yoresee_doc/internal/service/membership_service" "github.com/XingfenD/yoresee_doc/internal/service/membership_service"
"github.com/XingfenD/yoresee_doc/internal/status" "github.com/XingfenD/yoresee_doc/internal/status"
pb "github.com/XingfenD/yoresee_doc/pkg/gen/yoresee_doc/v1" pb "git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go/yoresee_doc/v1"
) )
type MembershipServiceServer struct { type MembershipServiceServer struct {
@@ -10,7 +10,7 @@ import (
"github.com/XingfenD/yoresee_doc/internal/service/auth_service" "github.com/XingfenD/yoresee_doc/internal/service/auth_service"
"github.com/XingfenD/yoresee_doc/internal/service/notification_service" "github.com/XingfenD/yoresee_doc/internal/service/notification_service"
"github.com/XingfenD/yoresee_doc/internal/status" "github.com/XingfenD/yoresee_doc/internal/status"
pb "github.com/XingfenD/yoresee_doc/pkg/gen/yoresee_doc/v1" pb "git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go/yoresee_doc/v1"
) )
type NotificationServiceServer struct { type NotificationServiceServer struct {
+1 -1
View File
@@ -11,7 +11,7 @@ import (
"github.com/XingfenD/yoresee_doc/internal/config" "github.com/XingfenD/yoresee_doc/internal/config"
"github.com/XingfenD/yoresee_doc/internal/repository" "github.com/XingfenD/yoresee_doc/internal/repository"
"github.com/XingfenD/yoresee_doc/internal/status" "github.com/XingfenD/yoresee_doc/internal/status"
pb "github.com/XingfenD/yoresee_doc/pkg/gen/yoresee_doc/v1" pb "git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go/yoresee_doc/v1"
"github.com/improbable-eng/grpc-web/go/grpcweb" "github.com/improbable-eng/grpc-web/go/grpcweb"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"google.golang.org/grpc" "google.golang.org/grpc"
@@ -7,7 +7,7 @@ import (
"github.com/XingfenD/yoresee_doc/internal/service/auth_service" "github.com/XingfenD/yoresee_doc/internal/service/auth_service"
"github.com/XingfenD/yoresee_doc/internal/service/setting_service" "github.com/XingfenD/yoresee_doc/internal/service/setting_service"
"github.com/XingfenD/yoresee_doc/internal/status" "github.com/XingfenD/yoresee_doc/internal/status"
pb "github.com/XingfenD/yoresee_doc/pkg/gen/yoresee_doc/v1" pb "git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go/yoresee_doc/v1"
) )
type SettingServiceServer struct { type SettingServiceServer struct {
@@ -6,7 +6,7 @@ import (
"github.com/XingfenD/yoresee_doc/internal/config" "github.com/XingfenD/yoresee_doc/internal/config"
"github.com/XingfenD/yoresee_doc/internal/service/config_service" "github.com/XingfenD/yoresee_doc/internal/service/config_service"
pb "github.com/XingfenD/yoresee_doc/pkg/gen/yoresee_doc/v1" pb "git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go/yoresee_doc/v1"
) )
type SystemServiceServer struct { type SystemServiceServer struct {
+1 -1
View File
@@ -3,7 +3,7 @@ package grpcserver
import ( import (
doc_container_mapper "github.com/XingfenD/yoresee_doc/internal/mapper/doc_container_mapper" doc_container_mapper "github.com/XingfenD/yoresee_doc/internal/mapper/doc_container_mapper"
"github.com/XingfenD/yoresee_doc/internal/status" "github.com/XingfenD/yoresee_doc/internal/status"
pb "github.com/XingfenD/yoresee_doc/pkg/gen/yoresee_doc/v1" pb "git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_go/yoresee_doc/v1"
) )
func validateUpdateDocumentRequest(req *pb.UpdateDocumentRequest) error { func validateUpdateDocumentRequest(req *pb.UpdateDocumentRequest) error {