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
01859617
Commit
01859617
authored
Sep 18, 2024
by
Bess严根旺
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
702b09aa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
41 deletions
+47
-41
get_convert_command.go
console/get_convert_command.go
+2
-18
convert_service.go
domain/service/convert_service.go
+45
-23
No files found.
console/get_convert_command.go
View file @
01859617
...
...
@@ -5,6 +5,7 @@ import (
"context"
"doc-service/domain/entity/serversitemicros/docserverproject"
service
"doc-service/domain/repository"
service2
"doc-service/domain/service"
"doc-service/infra/db"
"fmt"
"github.com/nacos-group/nacos-sdk-go/v2/common/logger"
...
...
@@ -93,24 +94,7 @@ func GetProjectInfo(c context.Context, projectId int32) int8 {
logger
.
Error
(
"错误信息"
+
errs
.
Error
())
return
0
}
c
reateGetProject
(
c
,
projectId
,
*
result
.
Body
.
Status
)
service2
.
C
reateGetProject
(
c
,
projectId
,
*
result
.
Body
.
Status
)
return
1
}
func
createGetProject
(
c
context
.
Context
,
projectId
int32
,
aliRes
string
)
{
var
statusData
int8
if
aliRes
!=
"Succeeded"
{
statusData
=
1
}
else
{
statusData
=
2
}
_
,
_
=
db
.
GetServerSiteMicrosDB
()
.
DocServerGetProject
.
Create
()
.
SetCreatedAt
(
time
.
Now
())
.
SetUpdatedAt
(
time
.
Now
())
.
SetStatus
(
statusData
)
.
SetCurrNum
(
1
)
.
SetAliResult
(
aliRes
)
.
SetServerProjectID
(
projectId
)
.
Save
(
c
)
}
domain/service/convert_service.go
View file @
01859617
...
...
@@ -94,13 +94,16 @@ func (doc *DocServiceService) GetProjectInfo(c context.Context, req *pb.GetProje
request
:=
&
service
.
GetTaskRequest
{
ProjectId
:
req
.
ProjectId
,
ProjectName
:
req
.
ProjectName
,
//TaskType: req.TaskType,
//TaskId: req.TaskId,
//RequestDefinition: req.RequestDefinition,
}
request
.
RequestDefinition
=
true
if
req
.
ProjectId
>
0
{
if
request
.
ProjectId
<=
0
{
resp
.
Msg
=
"项目id不能为空"
resp
.
Code
=
100010
resp
.
Data
=
nil
return
resp
,
err
}
projectInfo
,
infoErr
:=
db
.
GetServerSiteMicrosDB
()
.
DocServerProject
.
Get
(
c
,
req
.
ProjectId
)
if
infoErr
!=
nil
{
resp
.
Msg
=
err
.
Error
()
...
...
@@ -120,8 +123,10 @@ func (doc *DocServiceService) GetProjectInfo(c context.Context, req *pb.GetProje
ConversionInfo
.
SourceType
=
projectInfo
.
SourceType
ConversionInfo
.
TaskId
=
projectInfo
.
TaskID
ConversionInfo
.
TargetType
=
projectInfo
.
TargetType
}
result
,
errs
:=
service
.
NewConversion
()
.
GetTaskProject
(
*
request
)
//获取入库
CreateGetProject
(
c
,
request
.
ProjectId
,
*
result
.
Body
.
Status
)
if
errs
!=
nil
||
*
result
.
StatusCode
!=
200
||
*
result
.
Body
.
Status
!=
"Succeeded"
{
resp
.
Msg
=
err
.
Error
()
resp
.
Code
=
100010
...
...
@@ -134,3 +139,20 @@ func (doc *DocServiceService) GetProjectInfo(c context.Context, req *pb.GetProje
resp
.
Data
=
ConversionInfo
return
resp
,
nil
}
func
CreateGetProject
(
c
context
.
Context
,
projectId
int32
,
aliRes
string
)
{
var
statusData
int8
if
aliRes
!=
"Succeeded"
{
statusData
=
1
}
else
{
statusData
=
2
}
_
,
_
=
db
.
GetServerSiteMicrosDB
()
.
DocServerGetProject
.
Create
()
.
SetCreatedAt
(
time
.
Now
())
.
SetUpdatedAt
(
time
.
Now
())
.
SetStatus
(
statusData
)
.
SetCurrNum
(
1
)
.
SetAliResult
(
aliRes
)
.
SetServerProjectID
(
projectId
)
.
Save
(
c
)
}
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