Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
ppt_server
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Li Feifei
ppt_server
Commits
defe8ede
Commit
defe8ede
authored
Feb 27, 2020
by
Li Feifei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug
parent
28fdc27d
Pipeline
#8493
passed with stages
in 22 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
database.go
models/database.go
+1
-0
upload.go
upload/upload.go
+7
-5
No files found.
models/database.go
View file @
defe8ede
...
...
@@ -90,6 +90,7 @@ type XyuSmallRoomRecord struct {
type
XyuSmallTempFiles
struct
{
Id
int
RoomNum
string
`form:"room_num"`
Name
string
`form:"name"`
Type
int
`form:"type"`
Url
string
`form:"url"`
Time
string
`form:"time"'`
...
...
upload/upload.go
View file @
defe8ede
...
...
@@ -135,7 +135,7 @@ func Down(v *models.XyuSmallTempFiles) {
room_file
[
"is_courseware"
]
=
"1"
room_file
[
"private"
]
=
"1"
room_file
[
"nickname"
]
=
"助教"
room_file
[
"name"
]
=
filen
ame
room_file
[
"name"
]
=
v
.
N
ame
room_file
[
"time"
]
=
now
if
v
.
Type
==
1
{
room_file
[
"is_material"
]
=
1
...
...
@@ -176,10 +176,12 @@ func Down(v *models.XyuSmallTempFiles) {
return
}
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
)
room_file
[
"path"
]
=
objectPath
objectPath
:=
objectName
[
0
:
strings
.
LastIndex
(
objectName
,
"/"
)]
+
"/"
room_file
[
"path"
]
=
objectName
err
=
bucket
.
PutObject
(
objectName
,
fd
)
if
err
!=
nil
{
fmt
.
Println
(
err
)
...
...
@@ -193,7 +195,7 @@ func Down(v *models.XyuSmallTempFiles) {
}
room_file
[
"files_size"
]
=
strconv
.
Itoa
(
int
(
maps
[
"FileSize"
]
.
(
float64
)))
room_file
[
"link"
]
=
fu
rl
room_file
[
"link"
]
=
v
.
U
rl
wordFloat64
:=
getWords
(
maps
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment