Merge branch 'master' into kd-live

This commit is contained in:
2023-06-27 18:51:12 +09:00

View File

@ -26,7 +26,7 @@ import (
"go.mongodb.org/mongo-driver/mongo/options" "go.mongodb.org/mongo-driver/mongo/options"
) )
type fileDocumentDesc struct { type FileDocumentDesc struct {
Service string `bson:"service" json:"service"` Service string `bson:"service" json:"service"`
Key string `bson:"key" json:"key"` Key string `bson:"key" json:"key"`
Src string `bson:"src" json:"src"` Src string `bson:"src" json:"src"`
@ -37,7 +37,7 @@ type fileDocumentDesc struct {
Contents []byte `bson:"contents,omitempty" json:"contents,omitempty"` Contents []byte `bson:"contents,omitempty" json:"contents,omitempty"`
} }
func (fd *fileDocumentDesc) save() error { func (fd *FileDocumentDesc) save() error {
// 새 파일 올라옴 // 새 파일 올라옴
if len(fd.Contents) == 0 { if len(fd.Contents) == 0 {
return nil return nil
@ -180,7 +180,7 @@ func (caller apiCaller) uploadAPI(w http.ResponseWriter, r *http.Request) error
link = path.Join("static", subfolder, rf, header.Filename) link = path.Join("static", subfolder, rf, header.Filename)
} }
newdoc := fileDocumentDesc{ newdoc := FileDocumentDesc{
Contents: contents, Contents: contents,
Src: header.Filename, Src: header.Filename,
Timestamp: time.Now().UTC().Unix(), Timestamp: time.Now().UTC().Unix(),