Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rs-cloud-platform
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
周健威
rs-cloud-platform
Commits
c7837787
Commit
c7837787
authored
May 09, 2024
by
chenyan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024/05/09_API文档后台管理开发
parent
1ae0694d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
20 deletions
+16
-20
ApiCustomNodeVo.java
...va/com/upyuns/platform/rs/website/vo/ApiCustomNodeVo.java
+7
-3
ApiCustomParamsBiz.java
...om/upyuns/platform/rs/website/biz/ApiCustomParamsBiz.java
+6
-15
ApiDocBiz.java
...in/java/com/upyuns/platform/rs/website/biz/ApiDocBiz.java
+2
-0
ApiCustomParamsController.java
...form/rs/website/controller/ApiCustomParamsController.java
+1
-2
No files found.
rs-website/rs-website-api/src/main/java/com/upyuns/platform/rs/website/vo/ApiCustomNodeVo.java
View file @
c7837787
...
@@ -13,10 +13,14 @@ public class ApiCustomNodeVo {
...
@@ -13,10 +13,14 @@ public class ApiCustomNodeVo {
private
String
method
;
private
String
method
;
/**
/**
*
主键自增ID
*
请求参数id
*/
*/
@Id
private
Integer
paramId
;
private
Integer
id
;
/**
* 接口id
*/
private
Integer
nodeId
;
/**
/**
* api_doc主键ID
* api_doc主键ID
...
...
rs-website/rs-website-server/src/main/java/com/upyuns/platform/rs/website/biz/ApiCustomParamsBiz.java
View file @
c7837787
...
@@ -68,16 +68,14 @@ public class ApiCustomParamsBiz extends BaseBiz<ApiCustomParamsMapper, ApiCustom
...
@@ -68,16 +68,14 @@ public class ApiCustomParamsBiz extends BaseBiz<ApiCustomParamsMapper, ApiCustom
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
EXIST_CODE
,
"API节点下已存在自定义参数"
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
EXIST_CODE
,
"API节点下已存在自定义参数"
);
}
}
}
}
Example
exampleParams
=
new
Example
(
ApiCustomParams
.
class
);
if
(
apiCustomParams
.
getId
()
!=
null
)
{
exampleParams
.
createCriteria
()
ApiCustomParams
old
=
selectById
(
apiCustomParams
.
getId
());
.
andEqualTo
(
"docId"
,
apiCustomParams
.
getDocId
())
if
(
old
==
null
||
old
.
getIsDel
()
==
1
)
{
.
andEqualTo
(
"nodeId"
,
apiCustomParams
.
getNodeId
())
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
ResultCode
.
getMsg
(
ResultCode
.
NOTEXIST_CODE
));
.
andEqualTo
(
"isDel"
,
0
);
}
ApiCustomParams
old
=
mapper
.
selectOneByExample
(
exampleParams
);
if
(
old
!=
null
)
{
BeanUtil
.
copyProperties
(
apiCustomParams
,
old
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
).
setIgnoreError
(
true
));
BeanUtil
.
copyProperties
(
apiCustomParams
,
old
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
).
setIgnoreError
(
true
));
updateSelectiveByIdRe
(
old
);
updateSelectiveByIdRe
(
old
);
}
else
{
}
else
{
insertSelectiveRe
(
apiCustomParams
);
insertSelectiveRe
(
apiCustomParams
);
}
}
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
...
@@ -89,13 +87,6 @@ public class ApiCustomParamsBiz extends BaseBiz<ApiCustomParamsMapper, ApiCustom
...
@@ -89,13 +87,6 @@ public class ApiCustomParamsBiz extends BaseBiz<ApiCustomParamsMapper, ApiCustom
return
ObjectRestResponse
.
succ
(
pageDataVO
);
return
ObjectRestResponse
.
succ
(
pageDataVO
);
}
}
public
ObjectRestResponse
getByNodeId
(
Integer
id
)
{
Example
exampleParams
=
new
Example
(
ApiCustomParams
.
class
);
exampleParams
.
createCriteria
()
.
andEqualTo
(
"isDel"
,
0
)
.
andEqualTo
(
"nodeId"
,
id
);
return
ObjectRestResponse
.
succ
(
mapper
.
selectOneByExample
(
exampleParams
));
}
}
}
...
...
rs-website/rs-website-server/src/main/java/com/upyuns/platform/rs/website/biz/ApiDocBiz.java
View file @
c7837787
...
@@ -62,6 +62,7 @@ public class ApiDocBiz extends BaseBiz<ApiDocMapper, ApiDoc> {
...
@@ -62,6 +62,7 @@ public class ApiDocBiz extends BaseBiz<ApiDocMapper, ApiDoc> {
List
<
ApiCustomNodeVo
>
nodeVos
=
nodeMapper
.
selectByExample
(
exampleNode
).
stream
().
map
(
apiCustomNode
->
{
List
<
ApiCustomNodeVo
>
nodeVos
=
nodeMapper
.
selectByExample
(
exampleNode
).
stream
().
map
(
apiCustomNode
->
{
ApiCustomNodeVo
nodeVoss
=
new
ApiCustomNodeVo
();
ApiCustomNodeVo
nodeVoss
=
new
ApiCustomNodeVo
();
BeanUtils
.
copyProperties
(
apiCustomNode
,
nodeVoss
);
BeanUtils
.
copyProperties
(
apiCustomNode
,
nodeVoss
);
nodeVoss
.
setNodeId
(
apiCustomNode
.
getId
());
exampleParams
.
clear
();
exampleParams
.
clear
();
exampleParams
.
createCriteria
()
exampleParams
.
createCriteria
()
.
andEqualTo
(
"nodeId"
,
apiCustomNode
.
getId
())
.
andEqualTo
(
"nodeId"
,
apiCustomNode
.
getId
())
...
@@ -71,6 +72,7 @@ public class ApiDocBiz extends BaseBiz<ApiDocMapper, ApiDoc> {
...
@@ -71,6 +72,7 @@ public class ApiDocBiz extends BaseBiz<ApiDocMapper, ApiDoc> {
if
(
Objects
.
isNull
(
params
))
{
if
(
Objects
.
isNull
(
params
))
{
return
nodeVoss
;
return
nodeVoss
;
}
}
nodeVoss
.
setParamId
(
params
.
getId
());
nodeVoss
.
setMethod
(
params
.
getMethod
());
nodeVoss
.
setMethod
(
params
.
getMethod
());
return
nodeVoss
;
return
nodeVoss
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
...
...
rs-website/rs-website-server/src/main/java/com/upyuns/platform/rs/website/controller/ApiCustomParamsController.java
View file @
c7837787
...
@@ -14,7 +14,6 @@ import com.upyuns.platform.rs.website.entity.ApiCustomParams;
...
@@ -14,7 +14,6 @@ import com.upyuns.platform.rs.website.entity.ApiCustomParams;
import
com.upyuns.platform.rs.website.mapper.ApiCustomParamsMapper
;
import
com.upyuns.platform.rs.website.mapper.ApiCustomParamsMapper
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
tk.mybatis.mapper.entity.Example
;
/**
/**
*
*
...
@@ -39,7 +38,7 @@ public class ApiCustomParamsController extends BaseController<ApiCustomParamsBiz
...
@@ -39,7 +38,7 @@ public class ApiCustomParamsController extends BaseController<ApiCustomParamsBiz
@GetMapping
(
value
=
"/detail"
)
@GetMapping
(
value
=
"/detail"
)
public
ObjectRestResponse
detail
(
Integer
id
)
{
public
ObjectRestResponse
detail
(
Integer
id
)
{
return
baseBiz
.
getByNodeId
(
id
);
return
ObjectRestResponse
.
succ
(
baseBiz
.
selectById
(
id
)
);
}
}
...
...
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