✨ Development SDK of Paperclip
✨ Support update usage by random id
This commit is contained in:
41
pkg/filekit/io.go
Normal file
41
pkg/filekit/io.go
Normal file
@ -0,0 +1,41 @@
|
||||
package filekit
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.solsynth.dev/hypernet/nexus/pkg/nex"
|
||||
"git.solsynth.dev/hypernet/paperclip/pkg/proto"
|
||||
)
|
||||
|
||||
func UpdateVisibility(c *nex.Conn, request *proto.UpdateVisibilityRequest) error {
|
||||
conn, err := c.GetClientGrpcConn("uc")
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
pc := proto.NewAttachmentServiceClient(conn)
|
||||
_, err = pc.UpdateVisibility(context.Background(), request)
|
||||
return err
|
||||
}
|
||||
|
||||
func DeleteAttachment(c *nex.Conn, request *proto.DeleteAttachmentRequest) error {
|
||||
conn, err := c.GetClientGrpcConn("uc")
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
pc := proto.NewAttachmentServiceClient(conn)
|
||||
_, err = pc.DeleteAttachment(context.Background(), request)
|
||||
return err
|
||||
}
|
||||
|
||||
func CountAttachmentUsage(c *nex.Conn, request *proto.UpdateUsageRequest) error {
|
||||
conn, err := c.GetClientGrpcConn("uc")
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
pc := proto.NewAttachmentServiceClient(conn)
|
||||
_, err = pc.UpdateUsage(context.Background(), request)
|
||||
return err
|
||||
}
|
Reference in New Issue
Block a user