Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
doc-service
Project
Project
Details
Activity
Releases
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
eifel邓鹏飞
doc-service
Commits
8a52178e
Commit
8a52178e
authored
Aug 15, 2024
by
Euan游根明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 获取桶类型
parent
d75ec8c6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
.gitignore
.gitignore
+1
-0
apiController.go
controllers/apiController.go
+1
-1
conversionService.go
service/conversionService.go
+7
-4
No files found.
.gitignore
0 → 100644
View file @
8a52178e
/log/*
\ No newline at end of file
controllers/apiController.go
View file @
8a52178e
package
controllers
import
(
service
"doc-service/S
ervice"
"doc-service/s
ervice"
"github.com/gin-contrib/sessions"
"github.com/gin-gonic/gin"
"net/http"
...
...
S
ervice/conversionService.go
→
s
ervice/conversionService.go
View file @
8a52178e
...
...
@@ -20,7 +20,8 @@ type Conversion struct {
AccessKeyId
string
AccessKeySecret
string
Endpoint
string
Bucket
string
BucketPrivate
string
BucketPublic
string
}
func
NewConversion
()
*
Conversion
{
...
...
@@ -33,11 +34,13 @@ func NewConversion() *Conversion {
accessId
:=
config
.
Section
(
"AliYun"
)
.
Key
(
"accessId"
)
.
String
()
accessKeySecret
:=
config
.
Section
(
"AliYun"
)
.
Key
(
"accessKeySecret"
)
.
String
()
bucketPrivate
:=
config
.
Section
(
"AliYun"
)
.
Key
(
"bucketPrivate"
)
.
String
()
bucketPublic
:=
config
.
Section
(
"AliYun"
)
.
Key
(
"bucketPub"
)
.
String
()
return
&
Conversion
{
Endpoint
:
host
,
AccessKeyId
:
accessId
,
AccessKeySecret
:
accessKeySecret
,
Bucket
:
bucketPrivate
,
BucketPrivate
:
bucketPrivate
,
BucketPublic
:
bucketPublic
,
}
}
...
...
@@ -71,9 +74,9 @@ func (o *Conversion) CreateApiInfo() (_result *openapi.Params) {
// GetBucket 获取bucket信息
func
(
o
*
Conversion
)
GetBucket
(
isPrivate
bool
)
string
{
if
isPrivate
{
return
"oss://"
+
"test-bucket-v1"
return
"oss://"
+
o
.
BucketPrivate
}
return
"oss://"
+
"test-bucket-v1-pub"
return
"oss://"
+
o
.
BucketPublic
}
type
ConversionRequest
struct
{
...
...
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