Commit defe8ede by Li Feifei

debug

parent 28fdc27d
Pipeline #8493 passed with stages
in 22 seconds
...@@ -90,6 +90,7 @@ type XyuSmallRoomRecord struct { ...@@ -90,6 +90,7 @@ type XyuSmallRoomRecord struct {
type XyuSmallTempFiles struct { type XyuSmallTempFiles struct {
Id int Id int
RoomNum string `form:"room_num"` RoomNum string `form:"room_num"`
Name string `form:"name"`
Type int `form:"type"` Type int `form:"type"`
Url string `form:"url"` Url string `form:"url"`
Time string `form:"time"'` Time string `form:"time"'`
......
...@@ -135,7 +135,7 @@ func Down(v *models.XyuSmallTempFiles) { ...@@ -135,7 +135,7 @@ func Down(v *models.XyuSmallTempFiles) {
room_file["is_courseware"] = "1" room_file["is_courseware"] = "1"
room_file["private"] = "1" room_file["private"] = "1"
room_file["nickname"] = "助教" room_file["nickname"] = "助教"
room_file["name"] = filename room_file["name"] = v.Name
room_file["time"] = now room_file["time"] = now
if v.Type == 1 { if v.Type == 1 {
room_file["is_material"] = 1 room_file["is_material"] = 1
...@@ -176,10 +176,12 @@ func Down(v *models.XyuSmallTempFiles) { ...@@ -176,10 +176,12 @@ func Down(v *models.XyuSmallTempFiles) {
return return
} }
defer fd.Close() defer fd.Close()
objectPath := "documents/" + v.RoomNum + "/" + contentHash + "/" + fileHashName + "/"
objectName := objectPath + contentHash + ext //objectPath := "documents/" + v.RoomNum + "/" + contentHash + "/" + fileHashName + "/"
objectName := v.Url[strings.Index(v.Url, "com/")+4:]
fmt.Println("objectName == ", objectName) fmt.Println("objectName == ", objectName)
room_file["path"] = objectPath objectPath := objectName[0:strings.LastIndex(objectName, "/")]+"/"
room_file["path"] = objectName
err = bucket.PutObject(objectName, fd) err = bucket.PutObject(objectName, fd)
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)
...@@ -193,7 +195,7 @@ func Down(v *models.XyuSmallTempFiles) { ...@@ -193,7 +195,7 @@ func Down(v *models.XyuSmallTempFiles) {
} }
room_file["files_size"] = strconv.Itoa(int(maps["FileSize"].(float64))) room_file["files_size"] = strconv.Itoa(int(maps["FileSize"].(float64)))
room_file["link"] = furl room_file["link"] = v.Url
wordFloat64 := getWords(maps) wordFloat64 := getWords(maps)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment