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
62fb1ede
Commit
62fb1ede
authored
Jul 27, 2021
by
Li Feifei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug
parent
22e832ce
Pipeline
#15677
passed with stages
in 31 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
file_parser.go
packed/file/file_parser.go
+5
-4
file_upload.go
packed/file/file_upload.go
+1
-1
No files found.
packed/file/file_parser.go
View file @
62fb1ede
...
...
@@ -34,11 +34,11 @@ func parseURL(ossFileLink string) (*parser, error) {
return
nil
,
gerror
.
New
(
"上传URL格式不正确"
)
}
f
:=
&
parser
{
ext
:
path
.
Ext
(
Parser
FileLink
),
ext
:
path
.
Ext
(
oss
FileLink
),
url
:
ossFileLink
,
path
:
parseURLPath
[
"path"
],
slicePath
:
slicePath
,
name
:
path
.
Base
(
Parser
FileLink
),
name
:
path
.
Base
(
oss
FileLink
),
}
return
f
,
nil
...
...
@@ -46,7 +46,7 @@ func parseURL(ossFileLink string) (*parser, error) {
//解析课件的URL
func
(
f
*
parser
)
splitFileInfoLink
()
string
{
return
fmt
.
Sprintf
(
"%s?info=0&ssl=1&furl=%s%s"
,
return
fmt
.
Sprintf
(
"%s?info=0&ssl=1&furl=%s
/
%s"
,
ParserFileLink
,
g
.
Cfg
()
.
GetString
(
"oss.url"
),
f
.
dataPath
())
}
...
...
@@ -77,7 +77,7 @@ func (f *parser) contentHash() string {
// 数据库存储path
func
(
f
*
parser
)
dataPath
()
string
{
return
"/"
+
f
.
splitUploadPath
()
+
gurl
.
Encode
(
f
.
slicePath
[
len
(
f
.
slicePath
)
-
1
:
][
0
])
return
f
.
splitUploadPath
()
+
gurl
.
Encode
(
f
.
slicePath
[
len
(
f
.
slicePath
)
-
1
:
][
0
])
}
// 解析doctype
...
...
@@ -100,5 +100,6 @@ func (f *parser) docType() string {
func
(
f
*
parser
)
mineType
()
string
{
_
=
mime
.
AddExtensionType
(
".pptx"
,
"application/vnd.openxmlformats-officedocument.presentationml.presentation"
)
_
=
mime
.
AddExtensionType
(
".ppt"
,
"application/vnd.ms-powerpoint"
)
fmt
.
Println
(
"ext == "
,
f
.
ext
)
return
mime
.
TypeByExtension
(
f
.
ext
)
}
packed/file/file_upload.go
View file @
62fb1ede
...
...
@@ -199,7 +199,7 @@ func (f *ObtainFile) Worker(err error) {
}
// 清理ZIP包
defer
os
.
Remove
(
f
.
parser
.
splitTempZipLink
())
g
.
Log
()
.
Async
()
.
Infof
(
"file: %s Zip Donwload Complete"
,
f
.
parser
.
name
)
g
.
Log
()
.
Async
()
.
Infof
(
"file: %s Zip Donwload Complete"
,
f
.
parser
.
filename
()
)
// 解析ZIP包并上传图片到OSS
if
err
=
f
.
uploadPicture
();
err
!=
nil
{
...
...
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