✨ Update usage grpc call
This commit is contained in:
parent
69be460e13
commit
e3ca50c4ae
@ -5,6 +5,7 @@ import (
|
|||||||
|
|
||||||
"git.solsynth.dev/hypernet/paperclip/pkg/internal/database"
|
"git.solsynth.dev/hypernet/paperclip/pkg/internal/database"
|
||||||
"git.solsynth.dev/hypernet/paperclip/pkg/internal/models"
|
"git.solsynth.dev/hypernet/paperclip/pkg/internal/models"
|
||||||
|
"git.solsynth.dev/hypernet/paperclip/pkg/internal/services"
|
||||||
"git.solsynth.dev/hypernet/paperclip/pkg/proto"
|
"git.solsynth.dev/hypernet/paperclip/pkg/proto"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/samber/lo"
|
"github.com/samber/lo"
|
||||||
@ -91,6 +92,19 @@ func (v *Server) UpdateVisibility(ctx context.Context, request *proto.UpdateVisi
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (v *Server) UpdateUsage(ctx context.Context, request *proto.UpdateUsageRequest) (*proto.UpdateUsageResponse, error) {
|
||||||
|
id := lo.Map(request.GetId(), func(item uint64, _ int) uint {
|
||||||
|
return uint(item)
|
||||||
|
})
|
||||||
|
if rows, err := services.CountAttachmentUsage(id, int(request.GetDelta())); err != nil {
|
||||||
|
return nil, status.Error(codes.Internal, err.Error())
|
||||||
|
} else {
|
||||||
|
return &proto.UpdateUsageResponse{
|
||||||
|
Count: int32(rows),
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (v *Server) DeleteAttachment(ctx context.Context, request *proto.DeleteAttachmentRequest) (*proto.DeleteAttachmentResponse, error) {
|
func (v *Server) DeleteAttachment(ctx context.Context, request *proto.DeleteAttachmentRequest) (*proto.DeleteAttachmentResponse, error) {
|
||||||
tx := database.C
|
tx := database.C
|
||||||
if len(request.Id) == 0 && len(request.Rid) == 0 {
|
if len(request.Id) == 0 && len(request.Rid) == 0 {
|
||||||
|
@ -3,10 +3,11 @@ package models
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"git.solsynth.dev/hypernet/paperclip/pkg/proto"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"git.solsynth.dev/hypernet/paperclip/pkg/proto"
|
||||||
|
|
||||||
"git.solsynth.dev/hypernet/nexus/pkg/nex/cruda"
|
"git.solsynth.dev/hypernet/nexus/pkg/nex/cruda"
|
||||||
"github.com/eko/gocache/lib/v4/cache"
|
"github.com/eko/gocache/lib/v4/cache"
|
||||||
"github.com/eko/gocache/lib/v4/marshaler"
|
"github.com/eko/gocache/lib/v4/marshaler"
|
||||||
@ -56,6 +57,8 @@ type Attachment struct {
|
|||||||
IsSelfRef bool `json:"is_self_ref"`
|
IsSelfRef bool `json:"is_self_ref"`
|
||||||
IsIndexable bool `json:"is_indexable"` // Show this attachment in the public directory api or not
|
IsIndexable bool `json:"is_indexable"` // Show this attachment in the public directory api or not
|
||||||
|
|
||||||
|
// Count the usage of this attachment across all services
|
||||||
|
// If this number remain 0, it will be deleted during the maintenance
|
||||||
UsedCount int `json:"used_count"`
|
UsedCount int `json:"used_count"`
|
||||||
|
|
||||||
Thumbnail *Attachment `json:"thumbnail"`
|
Thumbnail *Attachment `json:"thumbnail"`
|
||||||
|
@ -238,3 +238,13 @@ func DeleteAttachment(item models.Attachment, txs ...*gorm.DB) error {
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func CountAttachmentUsage(id []uint, delta int) (int64, error) {
|
||||||
|
if tx := database.C.Model(&models.Attachment{}).
|
||||||
|
Where("id IN ?", id).
|
||||||
|
Update("used_count", gorm.Expr("used_count + ?", delta)); tx.Error != nil {
|
||||||
|
return tx.RowsAffected, tx.Error
|
||||||
|
} else {
|
||||||
|
return tx.RowsAffected, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -447,6 +447,104 @@ func (x *UpdateVisibilityResponse) GetCount() int32 {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type UpdateUsageRequest struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Id []uint64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"`
|
||||||
|
Delta int64 `protobuf:"varint,2,opt,name=delta,proto3" json:"delta,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdateUsageRequest) Reset() {
|
||||||
|
*x = UpdateUsageRequest{}
|
||||||
|
mi := &file_attachment_proto_msgTypes[7]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdateUsageRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*UpdateUsageRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *UpdateUsageRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_attachment_proto_msgTypes[7]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use UpdateUsageRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*UpdateUsageRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_attachment_proto_rawDescGZIP(), []int{7}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdateUsageRequest) GetId() []uint64 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdateUsageRequest) GetDelta() int64 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Delta
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
type UpdateUsageResponse struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Count int32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdateUsageResponse) Reset() {
|
||||||
|
*x = UpdateUsageResponse{}
|
||||||
|
mi := &file_attachment_proto_msgTypes[8]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdateUsageResponse) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*UpdateUsageResponse) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *UpdateUsageResponse) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_attachment_proto_msgTypes[8]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use UpdateUsageResponse.ProtoReflect.Descriptor instead.
|
||||||
|
func (*UpdateUsageResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return file_attachment_proto_rawDescGZIP(), []int{8}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdateUsageResponse) GetCount() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Count
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
type DeleteAttachmentRequest struct {
|
type DeleteAttachmentRequest struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
@ -459,7 +557,7 @@ type DeleteAttachmentRequest struct {
|
|||||||
|
|
||||||
func (x *DeleteAttachmentRequest) Reset() {
|
func (x *DeleteAttachmentRequest) Reset() {
|
||||||
*x = DeleteAttachmentRequest{}
|
*x = DeleteAttachmentRequest{}
|
||||||
mi := &file_attachment_proto_msgTypes[7]
|
mi := &file_attachment_proto_msgTypes[9]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -471,7 +569,7 @@ func (x *DeleteAttachmentRequest) String() string {
|
|||||||
func (*DeleteAttachmentRequest) ProtoMessage() {}
|
func (*DeleteAttachmentRequest) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *DeleteAttachmentRequest) ProtoReflect() protoreflect.Message {
|
func (x *DeleteAttachmentRequest) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_attachment_proto_msgTypes[7]
|
mi := &file_attachment_proto_msgTypes[9]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -484,7 +582,7 @@ func (x *DeleteAttachmentRequest) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use DeleteAttachmentRequest.ProtoReflect.Descriptor instead.
|
// Deprecated: Use DeleteAttachmentRequest.ProtoReflect.Descriptor instead.
|
||||||
func (*DeleteAttachmentRequest) Descriptor() ([]byte, []int) {
|
func (*DeleteAttachmentRequest) Descriptor() ([]byte, []int) {
|
||||||
return file_attachment_proto_rawDescGZIP(), []int{7}
|
return file_attachment_proto_rawDescGZIP(), []int{9}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DeleteAttachmentRequest) GetId() []uint64 {
|
func (x *DeleteAttachmentRequest) GetId() []uint64 {
|
||||||
@ -518,7 +616,7 @@ type DeleteAttachmentResponse struct {
|
|||||||
|
|
||||||
func (x *DeleteAttachmentResponse) Reset() {
|
func (x *DeleteAttachmentResponse) Reset() {
|
||||||
*x = DeleteAttachmentResponse{}
|
*x = DeleteAttachmentResponse{}
|
||||||
mi := &file_attachment_proto_msgTypes[8]
|
mi := &file_attachment_proto_msgTypes[10]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -530,7 +628,7 @@ func (x *DeleteAttachmentResponse) String() string {
|
|||||||
func (*DeleteAttachmentResponse) ProtoMessage() {}
|
func (*DeleteAttachmentResponse) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *DeleteAttachmentResponse) ProtoReflect() protoreflect.Message {
|
func (x *DeleteAttachmentResponse) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_attachment_proto_msgTypes[8]
|
mi := &file_attachment_proto_msgTypes[10]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -543,7 +641,7 @@ func (x *DeleteAttachmentResponse) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use DeleteAttachmentResponse.ProtoReflect.Descriptor instead.
|
// Deprecated: Use DeleteAttachmentResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*DeleteAttachmentResponse) Descriptor() ([]byte, []int) {
|
func (*DeleteAttachmentResponse) Descriptor() ([]byte, []int) {
|
||||||
return file_attachment_proto_rawDescGZIP(), []int{8}
|
return file_attachment_proto_rawDescGZIP(), []int{10}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DeleteAttachmentResponse) GetCount() int32 {
|
func (x *DeleteAttachmentResponse) GetCount() int32 {
|
||||||
@ -606,40 +704,51 @@ var file_attachment_proto_rawDesc = []byte{
|
|||||||
0x08, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x22, 0x30, 0x0a, 0x18, 0x55, 0x70, 0x64,
|
0x08, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x22, 0x30, 0x0a, 0x18, 0x55, 0x70, 0x64,
|
||||||
0x61, 0x74, 0x65, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73,
|
0x61, 0x74, 0x65, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73,
|
||||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01,
|
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01,
|
||||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x65, 0x0a, 0x17, 0x44,
|
0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x3a, 0x0a, 0x12, 0x55,
|
||||||
0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52,
|
0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03,
|
0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x52, 0x02, 0x69,
|
||||||
0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x69, 0x64, 0x18, 0x02, 0x20,
|
0x64, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03,
|
||||||
0x03, 0x28, 0x09, 0x52, 0x03, 0x72, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72,
|
0x52, 0x05, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x22, 0x2b, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74,
|
||||||
0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x06, 0x75, 0x73, 0x65,
|
0x65, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14,
|
||||||
0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f,
|
|
||||||
0x69, 0x64, 0x22, 0x30, 0x0a, 0x18, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x74, 0x74, 0x61,
|
|
||||||
0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14,
|
|
||||||
0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63,
|
0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63,
|
||||||
0x6f, 0x75, 0x6e, 0x74, 0x32, 0xe0, 0x02, 0x0a, 0x11, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d,
|
0x6f, 0x75, 0x6e, 0x74, 0x22, 0x65, 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x74,
|
||||||
0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4c, 0x0a, 0x0d, 0x47, 0x65,
|
0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
|
||||||
0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x2e, 0x70, 0x72,
|
0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12,
|
||||||
0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e,
|
0x10, 0x0a, 0x03, 0x72, 0x69, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x72, 0x69,
|
||||||
0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
0x64, 0x12, 0x1c, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01,
|
||||||
0x2e, 0x47, 0x65, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65,
|
0x28, 0x04, 0x48, 0x00, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42,
|
||||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74,
|
0x0a, 0x0a, 0x08, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x22, 0x30, 0x0a, 0x18, 0x44,
|
||||||
0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f,
|
0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52,
|
||||||
0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e,
|
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74,
|
||||||
0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0xa8, 0x03,
|
||||||
0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52,
|
0x0a, 0x11, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76,
|
||||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x10, 0x55, 0x70, 0x64,
|
0x69, 0x63, 0x65, 0x12, 0x4c, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68,
|
||||||
0x61, 0x74, 0x65, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1e, 0x2e,
|
0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74,
|
||||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x69, 0x73, 0x69,
|
0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||||
0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e,
|
0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x74, 0x74,
|
||||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x69, 0x73, 0x69,
|
0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
|
||||||
0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
|
0x00, 0x12, 0x4f, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d,
|
||||||
0x12, 0x55, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68,
|
0x65, 0x6e, 0x74, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74,
|
||||||
0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x65, 0x6c,
|
0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||||
0x65, 0x74, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71,
|
0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x74,
|
||||||
0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x65, 0x6c,
|
0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||||
0x65, 0x74, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73,
|
0x22, 0x00, 0x12, 0x55, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x69, 0x73, 0x69,
|
||||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x3b, 0x70, 0x72, 0x6f,
|
0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55,
|
||||||
0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52,
|
||||||
|
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55,
|
||||||
|
0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52,
|
||||||
|
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x0b, 0x55, 0x70, 0x64,
|
||||||
|
0x61, 0x74, 0x65, 0x55, 0x73, 0x61, 0x67, 0x65, 0x12, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
|
0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75,
|
||||||
|
0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x70, 0x64, 0x61,
|
||||||
|
0x74, 0x65, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
|
||||||
|
0x00, 0x12, 0x55, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63,
|
||||||
|
0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x65,
|
||||||
|
0x6c, 0x65, 0x74, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65,
|
||||||
|
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x65,
|
||||||
|
0x6c, 0x65, 0x74, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65,
|
||||||
|
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x3b, 0x70, 0x72,
|
||||||
|
0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -654,7 +763,7 @@ func file_attachment_proto_rawDescGZIP() []byte {
|
|||||||
return file_attachment_proto_rawDescData
|
return file_attachment_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_attachment_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
|
var file_attachment_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
|
||||||
var file_attachment_proto_goTypes = []any{
|
var file_attachment_proto_goTypes = []any{
|
||||||
(*AttachmentInfo)(nil), // 0: proto.AttachmentInfo
|
(*AttachmentInfo)(nil), // 0: proto.AttachmentInfo
|
||||||
(*GetAttachmentRequest)(nil), // 1: proto.GetAttachmentRequest
|
(*GetAttachmentRequest)(nil), // 1: proto.GetAttachmentRequest
|
||||||
@ -663,25 +772,29 @@ var file_attachment_proto_goTypes = []any{
|
|||||||
(*ListAttachmentResponse)(nil), // 4: proto.ListAttachmentResponse
|
(*ListAttachmentResponse)(nil), // 4: proto.ListAttachmentResponse
|
||||||
(*UpdateVisibilityRequest)(nil), // 5: proto.UpdateVisibilityRequest
|
(*UpdateVisibilityRequest)(nil), // 5: proto.UpdateVisibilityRequest
|
||||||
(*UpdateVisibilityResponse)(nil), // 6: proto.UpdateVisibilityResponse
|
(*UpdateVisibilityResponse)(nil), // 6: proto.UpdateVisibilityResponse
|
||||||
(*DeleteAttachmentRequest)(nil), // 7: proto.DeleteAttachmentRequest
|
(*UpdateUsageRequest)(nil), // 7: proto.UpdateUsageRequest
|
||||||
(*DeleteAttachmentResponse)(nil), // 8: proto.DeleteAttachmentResponse
|
(*UpdateUsageResponse)(nil), // 8: proto.UpdateUsageResponse
|
||||||
|
(*DeleteAttachmentRequest)(nil), // 9: proto.DeleteAttachmentRequest
|
||||||
|
(*DeleteAttachmentResponse)(nil), // 10: proto.DeleteAttachmentResponse
|
||||||
}
|
}
|
||||||
var file_attachment_proto_depIdxs = []int32{
|
var file_attachment_proto_depIdxs = []int32{
|
||||||
0, // 0: proto.GetAttachmentResponse.attachment:type_name -> proto.AttachmentInfo
|
0, // 0: proto.GetAttachmentResponse.attachment:type_name -> proto.AttachmentInfo
|
||||||
0, // 1: proto.ListAttachmentResponse.attachments:type_name -> proto.AttachmentInfo
|
0, // 1: proto.ListAttachmentResponse.attachments:type_name -> proto.AttachmentInfo
|
||||||
1, // 2: proto.AttachmentService.GetAttachment:input_type -> proto.GetAttachmentRequest
|
1, // 2: proto.AttachmentService.GetAttachment:input_type -> proto.GetAttachmentRequest
|
||||||
3, // 3: proto.AttachmentService.ListAttachment:input_type -> proto.ListAttachmentRequest
|
3, // 3: proto.AttachmentService.ListAttachment:input_type -> proto.ListAttachmentRequest
|
||||||
5, // 4: proto.AttachmentService.UpdateVisibility:input_type -> proto.UpdateVisibilityRequest
|
5, // 4: proto.AttachmentService.UpdateVisibility:input_type -> proto.UpdateVisibilityRequest
|
||||||
7, // 5: proto.AttachmentService.DeleteAttachment:input_type -> proto.DeleteAttachmentRequest
|
7, // 5: proto.AttachmentService.UpdateUsage:input_type -> proto.UpdateUsageRequest
|
||||||
2, // 6: proto.AttachmentService.GetAttachment:output_type -> proto.GetAttachmentResponse
|
9, // 6: proto.AttachmentService.DeleteAttachment:input_type -> proto.DeleteAttachmentRequest
|
||||||
4, // 7: proto.AttachmentService.ListAttachment:output_type -> proto.ListAttachmentResponse
|
2, // 7: proto.AttachmentService.GetAttachment:output_type -> proto.GetAttachmentResponse
|
||||||
6, // 8: proto.AttachmentService.UpdateVisibility:output_type -> proto.UpdateVisibilityResponse
|
4, // 8: proto.AttachmentService.ListAttachment:output_type -> proto.ListAttachmentResponse
|
||||||
8, // 9: proto.AttachmentService.DeleteAttachment:output_type -> proto.DeleteAttachmentResponse
|
6, // 9: proto.AttachmentService.UpdateVisibility:output_type -> proto.UpdateVisibilityResponse
|
||||||
6, // [6:10] is the sub-list for method output_type
|
8, // 10: proto.AttachmentService.UpdateUsage:output_type -> proto.UpdateUsageResponse
|
||||||
2, // [2:6] is the sub-list for method input_type
|
10, // 11: proto.AttachmentService.DeleteAttachment:output_type -> proto.DeleteAttachmentResponse
|
||||||
2, // [2:2] is the sub-list for extension type_name
|
7, // [7:12] is the sub-list for method output_type
|
||||||
2, // [2:2] is the sub-list for extension extendee
|
2, // [2:7] is the sub-list for method input_type
|
||||||
0, // [0:2] is the sub-list for field type_name
|
2, // [2:2] is the sub-list for extension type_name
|
||||||
|
2, // [2:2] is the sub-list for extension extendee
|
||||||
|
0, // [0:2] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_attachment_proto_init() }
|
func init() { file_attachment_proto_init() }
|
||||||
@ -693,14 +806,14 @@ func file_attachment_proto_init() {
|
|||||||
file_attachment_proto_msgTypes[2].OneofWrappers = []any{}
|
file_attachment_proto_msgTypes[2].OneofWrappers = []any{}
|
||||||
file_attachment_proto_msgTypes[3].OneofWrappers = []any{}
|
file_attachment_proto_msgTypes[3].OneofWrappers = []any{}
|
||||||
file_attachment_proto_msgTypes[5].OneofWrappers = []any{}
|
file_attachment_proto_msgTypes[5].OneofWrappers = []any{}
|
||||||
file_attachment_proto_msgTypes[7].OneofWrappers = []any{}
|
file_attachment_proto_msgTypes[9].OneofWrappers = []any{}
|
||||||
type x struct{}
|
type x struct{}
|
||||||
out := protoimpl.TypeBuilder{
|
out := protoimpl.TypeBuilder{
|
||||||
File: protoimpl.DescBuilder{
|
File: protoimpl.DescBuilder{
|
||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_attachment_proto_rawDesc,
|
RawDescriptor: file_attachment_proto_rawDesc,
|
||||||
NumEnums: 0,
|
NumEnums: 0,
|
||||||
NumMessages: 9,
|
NumMessages: 11,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 1,
|
NumServices: 1,
|
||||||
},
|
},
|
||||||
|
@ -8,6 +8,7 @@ service AttachmentService {
|
|||||||
rpc GetAttachment(GetAttachmentRequest) returns (GetAttachmentResponse) {}
|
rpc GetAttachment(GetAttachmentRequest) returns (GetAttachmentResponse) {}
|
||||||
rpc ListAttachment(ListAttachmentRequest) returns (ListAttachmentResponse) {}
|
rpc ListAttachment(ListAttachmentRequest) returns (ListAttachmentResponse) {}
|
||||||
rpc UpdateVisibility(UpdateVisibilityRequest) returns (UpdateVisibilityResponse) {}
|
rpc UpdateVisibility(UpdateVisibilityRequest) returns (UpdateVisibilityResponse) {}
|
||||||
|
rpc UpdateUsage(UpdateUsageRequest) returns (UpdateUsageResponse) {}
|
||||||
rpc DeleteAttachment(DeleteAttachmentRequest) returns (DeleteAttachmentResponse) {}
|
rpc DeleteAttachment(DeleteAttachmentRequest) returns (DeleteAttachmentResponse) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,6 +54,15 @@ message UpdateVisibilityResponse {
|
|||||||
int32 count = 1;
|
int32 count = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message UpdateUsageRequest {
|
||||||
|
repeated uint64 id = 1;
|
||||||
|
int64 delta = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message UpdateUsageResponse {
|
||||||
|
int32 count = 1;
|
||||||
|
}
|
||||||
|
|
||||||
message DeleteAttachmentRequest {
|
message DeleteAttachmentRequest {
|
||||||
repeated uint64 id = 1;
|
repeated uint64 id = 1;
|
||||||
repeated string rid = 2;
|
repeated string rid = 2;
|
||||||
|
@ -22,6 +22,7 @@ const (
|
|||||||
AttachmentService_GetAttachment_FullMethodName = "/proto.AttachmentService/GetAttachment"
|
AttachmentService_GetAttachment_FullMethodName = "/proto.AttachmentService/GetAttachment"
|
||||||
AttachmentService_ListAttachment_FullMethodName = "/proto.AttachmentService/ListAttachment"
|
AttachmentService_ListAttachment_FullMethodName = "/proto.AttachmentService/ListAttachment"
|
||||||
AttachmentService_UpdateVisibility_FullMethodName = "/proto.AttachmentService/UpdateVisibility"
|
AttachmentService_UpdateVisibility_FullMethodName = "/proto.AttachmentService/UpdateVisibility"
|
||||||
|
AttachmentService_UpdateUsage_FullMethodName = "/proto.AttachmentService/UpdateUsage"
|
||||||
AttachmentService_DeleteAttachment_FullMethodName = "/proto.AttachmentService/DeleteAttachment"
|
AttachmentService_DeleteAttachment_FullMethodName = "/proto.AttachmentService/DeleteAttachment"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -32,6 +33,7 @@ type AttachmentServiceClient interface {
|
|||||||
GetAttachment(ctx context.Context, in *GetAttachmentRequest, opts ...grpc.CallOption) (*GetAttachmentResponse, error)
|
GetAttachment(ctx context.Context, in *GetAttachmentRequest, opts ...grpc.CallOption) (*GetAttachmentResponse, error)
|
||||||
ListAttachment(ctx context.Context, in *ListAttachmentRequest, opts ...grpc.CallOption) (*ListAttachmentResponse, error)
|
ListAttachment(ctx context.Context, in *ListAttachmentRequest, opts ...grpc.CallOption) (*ListAttachmentResponse, error)
|
||||||
UpdateVisibility(ctx context.Context, in *UpdateVisibilityRequest, opts ...grpc.CallOption) (*UpdateVisibilityResponse, error)
|
UpdateVisibility(ctx context.Context, in *UpdateVisibilityRequest, opts ...grpc.CallOption) (*UpdateVisibilityResponse, error)
|
||||||
|
UpdateUsage(ctx context.Context, in *UpdateUsageRequest, opts ...grpc.CallOption) (*UpdateUsageResponse, error)
|
||||||
DeleteAttachment(ctx context.Context, in *DeleteAttachmentRequest, opts ...grpc.CallOption) (*DeleteAttachmentResponse, error)
|
DeleteAttachment(ctx context.Context, in *DeleteAttachmentRequest, opts ...grpc.CallOption) (*DeleteAttachmentResponse, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,6 +75,16 @@ func (c *attachmentServiceClient) UpdateVisibility(ctx context.Context, in *Upda
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *attachmentServiceClient) UpdateUsage(ctx context.Context, in *UpdateUsageRequest, opts ...grpc.CallOption) (*UpdateUsageResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
|
out := new(UpdateUsageResponse)
|
||||||
|
err := c.cc.Invoke(ctx, AttachmentService_UpdateUsage_FullMethodName, in, out, cOpts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (c *attachmentServiceClient) DeleteAttachment(ctx context.Context, in *DeleteAttachmentRequest, opts ...grpc.CallOption) (*DeleteAttachmentResponse, error) {
|
func (c *attachmentServiceClient) DeleteAttachment(ctx context.Context, in *DeleteAttachmentRequest, opts ...grpc.CallOption) (*DeleteAttachmentResponse, error) {
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(DeleteAttachmentResponse)
|
out := new(DeleteAttachmentResponse)
|
||||||
@ -90,6 +102,7 @@ type AttachmentServiceServer interface {
|
|||||||
GetAttachment(context.Context, *GetAttachmentRequest) (*GetAttachmentResponse, error)
|
GetAttachment(context.Context, *GetAttachmentRequest) (*GetAttachmentResponse, error)
|
||||||
ListAttachment(context.Context, *ListAttachmentRequest) (*ListAttachmentResponse, error)
|
ListAttachment(context.Context, *ListAttachmentRequest) (*ListAttachmentResponse, error)
|
||||||
UpdateVisibility(context.Context, *UpdateVisibilityRequest) (*UpdateVisibilityResponse, error)
|
UpdateVisibility(context.Context, *UpdateVisibilityRequest) (*UpdateVisibilityResponse, error)
|
||||||
|
UpdateUsage(context.Context, *UpdateUsageRequest) (*UpdateUsageResponse, error)
|
||||||
DeleteAttachment(context.Context, *DeleteAttachmentRequest) (*DeleteAttachmentResponse, error)
|
DeleteAttachment(context.Context, *DeleteAttachmentRequest) (*DeleteAttachmentResponse, error)
|
||||||
mustEmbedUnimplementedAttachmentServiceServer()
|
mustEmbedUnimplementedAttachmentServiceServer()
|
||||||
}
|
}
|
||||||
@ -110,6 +123,9 @@ func (UnimplementedAttachmentServiceServer) ListAttachment(context.Context, *Lis
|
|||||||
func (UnimplementedAttachmentServiceServer) UpdateVisibility(context.Context, *UpdateVisibilityRequest) (*UpdateVisibilityResponse, error) {
|
func (UnimplementedAttachmentServiceServer) UpdateVisibility(context.Context, *UpdateVisibilityRequest) (*UpdateVisibilityResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateVisibility not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateVisibility not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedAttachmentServiceServer) UpdateUsage(context.Context, *UpdateUsageRequest) (*UpdateUsageResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateUsage not implemented")
|
||||||
|
}
|
||||||
func (UnimplementedAttachmentServiceServer) DeleteAttachment(context.Context, *DeleteAttachmentRequest) (*DeleteAttachmentResponse, error) {
|
func (UnimplementedAttachmentServiceServer) DeleteAttachment(context.Context, *DeleteAttachmentRequest) (*DeleteAttachmentResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteAttachment not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method DeleteAttachment not implemented")
|
||||||
}
|
}
|
||||||
@ -188,6 +204,24 @@ func _AttachmentService_UpdateVisibility_Handler(srv interface{}, ctx context.Co
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _AttachmentService_UpdateUsage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(UpdateUsageRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(AttachmentServiceServer).UpdateUsage(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: AttachmentService_UpdateUsage_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(AttachmentServiceServer).UpdateUsage(ctx, req.(*UpdateUsageRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
func _AttachmentService_DeleteAttachment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _AttachmentService_DeleteAttachment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(DeleteAttachmentRequest)
|
in := new(DeleteAttachmentRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@ -225,6 +259,10 @@ var AttachmentService_ServiceDesc = grpc.ServiceDesc{
|
|||||||
MethodName: "UpdateVisibility",
|
MethodName: "UpdateVisibility",
|
||||||
Handler: _AttachmentService_UpdateVisibility_Handler,
|
Handler: _AttachmentService_UpdateVisibility_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "UpdateUsage",
|
||||||
|
Handler: _AttachmentService_UpdateUsage_Handler,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
MethodName: "DeleteAttachment",
|
MethodName: "DeleteAttachment",
|
||||||
Handler: _AttachmentService_DeleteAttachment_Handler,
|
Handler: _AttachmentService_DeleteAttachment_Handler,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user