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
aa052070
Commit
aa052070
authored
Jan 27, 2021
by
Li Feifei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
96a6b53c
Pipeline
#13603
passed with stages
in 26 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
14 deletions
+11
-14
go.mod
go.mod
+2
-2
go.sum
go.sum
+2
-0
mq.go
upload/mq.go
+6
-11
ppt.go
upload/ppt.go
+1
-1
No files found.
go.mod
View file @
aa052070
...
...
@@ -5,10 +5,10 @@ go 1.12
require (
github.com/aliyun/aliyun-oss-go-sdk v2.0.6+incompatible
github.com/astaxie/beego v1.12.1
github.com/beego/bee v1.12.3
// indirect
github.com/beego/bee v1.12.3
github.com/go-sql-driver/mysql v1.5.0
github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 // indirect
github.com/streadway/amqp v1.0.0
// indirect
github.com/streadway/amqp v1.0.0
github.com/stretchr/objx v0.1.1 // indirect
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
)
go.sum
View file @
aa052070
...
...
@@ -290,6 +290,7 @@ golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
...
...
@@ -350,6 +351,7 @@ gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
...
...
upload/mq.go
View file @
aa052070
...
...
@@ -7,14 +7,13 @@ package upload
import
(
"encoding/json"
"fmt"
"sync"
beeLogger
"github.com/beego/bee/logger"
"github.com/streadway/amqp"
)
var
once
sync
.
Once
var
RM
*
RabbitMQ
type
RabbitMQ
struct
{
connection
*
amqp
.
Connection
channel
*
amqp
.
Channel
...
...
@@ -67,7 +66,7 @@ func (r *RabbitMQ) mqClose() {
}
func
(
r
*
RabbitMQ
)
Send
(
req
map
[
string
]
interface
{})
error
{
//
defer r.mqClose()
defer
r
.
mqClose
()
if
err
:=
r
.
mqConnect
();
err
!=
nil
{
return
err
}
...
...
@@ -82,13 +81,9 @@ func (r *RabbitMQ) Send(req map[string]interface{}) error {
}
func
init
()
{
once
.
Do
(
func
()
{
RM
=
NewRabbitmq
()
})
}
func
NewRabbitmq
()
*
RabbitMQ
{
return
&
RabbitMQ
{}
func
Send
(
r
map
[
string
]
interface
{})
error
{
mq
:=
&
RabbitMQ
{}
return
mq
.
Send
(
r
)
}
upload/ppt.go
View file @
aa052070
...
...
@@ -69,7 +69,7 @@ func (p *PPT) Transform() (err error) {
maps
[
"type"
]
=
mime
.
TypeByExtension
(
ext
)
maps
[
"path"
]
=
objectName
if
err
=
RM
.
Send
(
maps
);
err
!=
nil
{
if
err
=
Send
(
maps
);
err
!=
nil
{
beeLogger
.
Log
.
Errorf
(
"Send Error: %s"
,
err
)
_
=
UpdateFileError
(
"6"
,
maps
[
"uuid"
]
.
(
string
),
maps
[
"roomNum"
]
.
(
string
),
objectName
)
return
...
...
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