안쓰는 인덱스 제거

This commit is contained in:
2023-08-21 11:01:21 +09:00
parent a8df7d54bd
commit e8832f329a
2 changed files with 5 additions and 20 deletions

View File

@ -27,7 +27,6 @@ import (
)
type FileDocumentDesc struct {
Service string `bson:"service" json:"service"`
Key string `bson:"key" json:"key"`
Src string `bson:"src" json:"src"`
Link string `bson:"link" json:"link"`
@ -110,9 +109,8 @@ var seq = uint32(0)
func (caller apiCaller) uploadAPI(w http.ResponseWriter, r *http.Request) error {
if r.Method == "PUT" {
servicename := r.FormValue("service")
hasher := md5.New()
hasher.Write([]byte(servicename))
hasher.Write(caller.mg.service().serviceCodeBytes)
subfolder := hex.EncodeToString(hasher.Sum(nil))[:8]
infile, header, err := r.FormFile("file")
@ -151,12 +149,10 @@ func (caller apiCaller) uploadAPI(w http.ResponseWriter, r *http.Request) error
Link: link,
Desc: desc,
Key: rf,
Service: servicename,
}
_, _, err = caller.mg.mongoClient.UpsertOne(CollectionFile, bson.M{
"_id": newidobj,
"service": servicename,
"key": rf,
"_id": newidobj,
"key": rf,
}, newdoc)
if err == nil {