|
|
|
@ -53,38 +53,6 @@ func local_request_UserService_ListUsers_0(ctx context.Context, marshaler runtim
|
|
|
|
|
return msg, metadata, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var filter_UserService_SearchUsers_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
|
|
|
|
|
|
|
|
|
func request_UserService_SearchUsers_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
|
|
|
var (
|
|
|
|
|
protoReq SearchUsersRequest
|
|
|
|
|
metadata runtime.ServerMetadata
|
|
|
|
|
)
|
|
|
|
|
if err := req.ParseForm(); err != nil {
|
|
|
|
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
|
|
|
|
}
|
|
|
|
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_SearchUsers_0); err != nil {
|
|
|
|
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
|
|
|
|
}
|
|
|
|
|
msg, err := client.SearchUsers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
|
|
|
return msg, metadata, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func local_request_UserService_SearchUsers_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
|
|
|
var (
|
|
|
|
|
protoReq SearchUsersRequest
|
|
|
|
|
metadata runtime.ServerMetadata
|
|
|
|
|
)
|
|
|
|
|
if err := req.ParseForm(); err != nil {
|
|
|
|
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
|
|
|
|
}
|
|
|
|
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_SearchUsers_0); err != nil {
|
|
|
|
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
|
|
|
|
}
|
|
|
|
|
msg, err := server.SearchUsers(ctx, &protoReq)
|
|
|
|
|
return msg, metadata, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func request_UserService_GetUser_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
|
|
|
var (
|
|
|
|
|
protoReq GetUserRequest
|
|
|
|
@ -121,6 +89,38 @@ func local_request_UserService_GetUser_0(ctx context.Context, marshaler runtime.
|
|
|
|
|
return msg, metadata, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var filter_UserService_GetUserByUsername_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
|
|
|
|
|
|
|
|
|
func request_UserService_GetUserByUsername_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
|
|
|
var (
|
|
|
|
|
protoReq GetUserByUsernameRequest
|
|
|
|
|
metadata runtime.ServerMetadata
|
|
|
|
|
)
|
|
|
|
|
if err := req.ParseForm(); err != nil {
|
|
|
|
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
|
|
|
|
}
|
|
|
|
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_GetUserByUsername_0); err != nil {
|
|
|
|
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
|
|
|
|
}
|
|
|
|
|
msg, err := client.GetUserByUsername(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
|
|
|
return msg, metadata, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func local_request_UserService_GetUserByUsername_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
|
|
|
var (
|
|
|
|
|
protoReq GetUserByUsernameRequest
|
|
|
|
|
metadata runtime.ServerMetadata
|
|
|
|
|
)
|
|
|
|
|
if err := req.ParseForm(); err != nil {
|
|
|
|
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
|
|
|
|
}
|
|
|
|
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_GetUserByUsername_0); err != nil {
|
|
|
|
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
|
|
|
|
}
|
|
|
|
|
msg, err := server.GetUserByUsername(ctx, &protoReq)
|
|
|
|
|
return msg, metadata, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var filter_UserService_GetUserAvatarBinary_0 = &utilities.DoubleArray{Encoding: map[string]int{"name": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
|
|
|
|
|
|
|
|
|
|
func request_UserService_GetUserAvatarBinary_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
|
|
@ -633,45 +633,45 @@ func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux
|
|
|
|
|
}
|
|
|
|
|
forward_UserService_ListUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
|
})
|
|
|
|
|
mux.Handle(http.MethodGet, pattern_UserService_SearchUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
|
|
|
mux.Handle(http.MethodGet, pattern_UserService_GetUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
|
|
|
ctx, cancel := context.WithCancel(req.Context())
|
|
|
|
|
defer cancel()
|
|
|
|
|
var stream runtime.ServerTransportStream
|
|
|
|
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
|
|
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
|
|
|
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.UserService/SearchUsers", runtime.WithHTTPPathPattern("/api/v1/users:search"))
|
|
|
|
|
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.UserService/GetUser", runtime.WithHTTPPathPattern("/api/v1/{name=users/*}"))
|
|
|
|
|
if err != nil {
|
|
|
|
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
resp, md, err := local_request_UserService_SearchUsers_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
|
|
|
|
resp, md, err := local_request_UserService_GetUser_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
|
|
|
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
|
|
|
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
|
|
|
|
if err != nil {
|
|
|
|
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
forward_UserService_SearchUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
|
forward_UserService_GetUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
|
})
|
|
|
|
|
mux.Handle(http.MethodGet, pattern_UserService_GetUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
|
|
|
mux.Handle(http.MethodGet, pattern_UserService_GetUserByUsername_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
|
|
|
ctx, cancel := context.WithCancel(req.Context())
|
|
|
|
|
defer cancel()
|
|
|
|
|
var stream runtime.ServerTransportStream
|
|
|
|
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
|
|
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
|
|
|
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.UserService/GetUser", runtime.WithHTTPPathPattern("/api/v1/{name=users/*}"))
|
|
|
|
|
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.UserService/GetUserByUsername", runtime.WithHTTPPathPattern("/api/v1/users:username"))
|
|
|
|
|
if err != nil {
|
|
|
|
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
resp, md, err := local_request_UserService_GetUser_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
|
|
|
|
resp, md, err := local_request_UserService_GetUserByUsername_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
|
|
|
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
|
|
|
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
|
|
|
|
if err != nil {
|
|
|
|
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
forward_UserService_GetUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
|
forward_UserService_GetUserByUsername_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
|
})
|
|
|
|
|
mux.Handle(http.MethodGet, pattern_UserService_GetUserAvatarBinary_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
|
|
|
ctx, cancel := context.WithCancel(req.Context())
|
|
|
|
@ -950,39 +950,39 @@ func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux
|
|
|
|
|
}
|
|
|
|
|
forward_UserService_ListUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
|
})
|
|
|
|
|
mux.Handle(http.MethodGet, pattern_UserService_SearchUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
|
|
|
mux.Handle(http.MethodGet, pattern_UserService_GetUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
|
|
|
ctx, cancel := context.WithCancel(req.Context())
|
|
|
|
|
defer cancel()
|
|
|
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
|
|
|
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.UserService/SearchUsers", runtime.WithHTTPPathPattern("/api/v1/users:search"))
|
|
|
|
|
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.UserService/GetUser", runtime.WithHTTPPathPattern("/api/v1/{name=users/*}"))
|
|
|
|
|
if err != nil {
|
|
|
|
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
resp, md, err := request_UserService_SearchUsers_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
|
|
|
|
resp, md, err := request_UserService_GetUser_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
|
|
|
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
|
|
|
|
if err != nil {
|
|
|
|
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
forward_UserService_SearchUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
|
forward_UserService_GetUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
|
})
|
|
|
|
|
mux.Handle(http.MethodGet, pattern_UserService_GetUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
|
|
|
mux.Handle(http.MethodGet, pattern_UserService_GetUserByUsername_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
|
|
|
ctx, cancel := context.WithCancel(req.Context())
|
|
|
|
|
defer cancel()
|
|
|
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
|
|
|
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.UserService/GetUser", runtime.WithHTTPPathPattern("/api/v1/{name=users/*}"))
|
|
|
|
|
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.UserService/GetUserByUsername", runtime.WithHTTPPathPattern("/api/v1/users:username"))
|
|
|
|
|
if err != nil {
|
|
|
|
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
resp, md, err := request_UserService_GetUser_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
|
|
|
|
resp, md, err := request_UserService_GetUserByUsername_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
|
|
|
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
|
|
|
|
if err != nil {
|
|
|
|
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
forward_UserService_GetUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
|
forward_UserService_GetUserByUsername_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
|
})
|
|
|
|
|
mux.Handle(http.MethodGet, pattern_UserService_GetUserAvatarBinary_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
|
|
|
ctx, cancel := context.WithCancel(req.Context())
|
|
|
|
@ -1176,8 +1176,8 @@ func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
pattern_UserService_ListUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "users"}, ""))
|
|
|
|
|
pattern_UserService_SearchUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "users"}, "search"))
|
|
|
|
|
pattern_UserService_GetUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v1", "users", "name"}, ""))
|
|
|
|
|
pattern_UserService_GetUserByUsername_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "users"}, "username"))
|
|
|
|
|
pattern_UserService_GetUserAvatarBinary_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"file", "users", "name", "avatar"}, ""))
|
|
|
|
|
pattern_UserService_CreateUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "users"}, ""))
|
|
|
|
|
pattern_UserService_UpdateUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v1", "users", "user.name"}, ""))
|
|
|
|
@ -1193,8 +1193,8 @@ var (
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
forward_UserService_ListUsers_0 = runtime.ForwardResponseMessage
|
|
|
|
|
forward_UserService_SearchUsers_0 = runtime.ForwardResponseMessage
|
|
|
|
|
forward_UserService_GetUser_0 = runtime.ForwardResponseMessage
|
|
|
|
|
forward_UserService_GetUserByUsername_0 = runtime.ForwardResponseMessage
|
|
|
|
|
forward_UserService_GetUserAvatarBinary_0 = runtime.ForwardResponseMessage
|
|
|
|
|
forward_UserService_CreateUser_0 = runtime.ForwardResponseMessage
|
|
|
|
|
forward_UserService_UpdateUser_0 = runtime.ForwardResponseMessage
|
|
|
|
|