Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
3b315dec
Commit
3b315dec
authored
Jan 06, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加申请页面抓取
parent
fa3e2de2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
140 additions
and
19 deletions
+140
-19
base-manager/doc/api.md
base-manager/doc/api.md
+90
-0
base-manager/src/main/java/com/mortals/xhx/module/app/service/AppService.java
...n/java/com/mortals/xhx/module/app/service/AppService.java
+2
-0
base-manager/src/main/java/com/mortals/xhx/module/app/service/impl/AppServiceImpl.java
...m/mortals/xhx/module/app/service/impl/AppServiceImpl.java
+28
-5
base-manager/src/main/java/com/mortals/xhx/module/app/web/AppController.java
...in/java/com/mortals/xhx/module/app/web/AppController.java
+20
-14
No files found.
base-manager/doc/api.md
View file @
3b315dec
...
@@ -9383,6 +9383,96 @@ msg|String|消息|-
...
@@ -9383,6 +9383,96 @@ msg|String|消息|-
```
```
### 自助终端应用部署
**请求URL:**
app/appDistribute
**请求方式:**
POST
**内容类型:**
application/json;charset=utf-8
**简要描述:**
应用部署
**请求参数:**
参数名称| 类型 | 必填 |描述
:---|:------|:----|:-------
id|Long|否|应用Id
**请求样例:**
```
{
}
```
**响应参数:**
参数名称 |参数类型|描述
:---|:---|:------
code|Integer|结果码(-1.失败,1.成功)
msg|String|消息
data|object|数据对象
**响应消息样例:**
```
{
"msg":"应用部署成功",
"code":1,
"data":{}
}
}
```
### 自助终端基础应用部署
**请求URL:**
app/appCommonDistribute
**请求方式:**
POST
**内容类型:**
application/json;charset=utf-8
**简要描述:**
基础应用部署
**请求参数:**
参数名称| 类型 | 必填 |描述
:---|:------|:----|:-------
filePath|String|是|文件相对路径地址
**请求样例:**
```
{
}
```
**响应参数:**
参数名称 |参数类型|描述
:---|:---|:------
code|Integer|结果码(-1.失败,1.成功)
msg|String|消息
data|object|数据对象
**响应消息样例:**
```
{
"msg":"应用部署成功",
"code":1,
"data":{}
}
}
```
### 自助终端应用克隆
### 自助终端应用克隆
...
...
base-manager/src/main/java/com/mortals/xhx/module/app/service/AppService.java
View file @
3b315dec
...
@@ -22,6 +22,8 @@ public interface AppService extends ICRUDService<AppEntity, Long> {
...
@@ -22,6 +22,8 @@ public interface AppService extends ICRUDService<AppEntity, Long> {
Rest
<
String
>
appDistribute
(
AppEntity
appEntity
,
Context
context
);
Rest
<
String
>
appDistribute
(
AppEntity
appEntity
,
Context
context
);
Rest
<
Void
>
appCommonDistribute
(
AppEntity
appEntity
,
Context
context
);
Rest
<
String
>
cloneAppsBySites
(
List
<
AppEntity
>
appList
,
List
<
SiteEntity
>
siteList
,
Context
context
);
Rest
<
String
>
cloneAppsBySites
(
List
<
AppEntity
>
appList
,
List
<
SiteEntity
>
siteList
,
Context
context
);
...
...
base-manager/src/main/java/com/mortals/xhx/module/app/service/impl/AppServiceImpl.java
View file @
3b315dec
...
@@ -62,16 +62,16 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L
...
@@ -62,16 +62,16 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L
@Override
@Override
protected
void
findAfter
(
AppEntity
params
,
PageInfo
pageInfo
,
Context
context
,
List
<
AppEntity
>
list
)
throws
AppException
{
protected
void
findAfter
(
AppEntity
params
,
PageInfo
pageInfo
,
Context
context
,
List
<
AppEntity
>
list
)
throws
AppException
{
//排序
//排序
if
(!
ObjectUtils
.
isEmpty
(
params
.
getIdList
()))
{
if
(!
ObjectUtils
.
isEmpty
(
params
.
getIdList
()))
{
//根据idList进行排序
//根据idList进行排序
for
(
int
i
=
0
;
i
<
params
.
getIdList
().
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
params
.
getIdList
().
size
();
i
++)
{
Long
id
=
params
.
getIdList
().
get
(
i
);
Long
id
=
params
.
getIdList
().
get
(
i
);
for
(
int
j
=
0
;
j
<
list
.
size
();
j
++)
{
for
(
int
j
=
0
;
j
<
list
.
size
();
j
++)
{
if
(
id
.
equals
(
list
.
get
(
j
).
getId
()))
{
if
(
id
.
equals
(
list
.
get
(
j
).
getId
()))
{
//判断位置是否一直
//判断位置是否一直
if
(
i
!=
j
)
{
if
(
i
!=
j
)
{
//交换
//交换
Collections
.
swap
(
list
,
i
,
j
);
Collections
.
swap
(
list
,
i
,
j
);
}
}
}
}
}
}
...
@@ -119,6 +119,29 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L
...
@@ -119,6 +119,29 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L
return
Rest
.
ok
(
"应用部署成功!"
);
return
Rest
.
ok
(
"应用部署成功!"
);
}
}
@Override
public
Rest
<
Void
>
appCommonDistribute
(
AppEntity
appEntity
,
Context
context
)
{
//判断文件是否存在
String
targetFilePath
=
uploadService
.
getFilePath
(
appEntity
.
getFilePath
());
if
(
FileUtil
.
isEmpty
(
new
File
(
targetFilePath
)))
{
throw
new
AppException
(
"部署文件不存在!"
);
}
if
(!
FileUtil
.
getSuffix
(
appEntity
.
getFilePath
()).
equals
(
"zip"
))
{
throw
new
AppException
(
"部署只支持zip文件!"
);
}
//部署路径是否存在 如果不存在 创建目录,
//文件构成目录 /home/publish/app/common
String
disPath
=
"/home/publish/app/common"
;
//判断目标目录是否存在 如果存在 这删除
if
(
FileUtil
.
isDirectory
(
disPath
))
{
FileUtil
.
del
(
disPath
);
}
ZipUtils
.
unzip
(
new
File
(
targetFilePath
),
disPath
);
return
Rest
.
ok
(
"基础应用部署成功!"
);
}
@Override
@Override
public
Rest
<
String
>
cloneAppsBySites
(
List
<
AppEntity
>
appList
,
List
<
SiteEntity
>
siteList
,
Context
context
)
{
public
Rest
<
String
>
cloneAppsBySites
(
List
<
AppEntity
>
appList
,
List
<
SiteEntity
>
siteList
,
Context
context
)
{
log
.
info
(
"克隆应用开始!"
);
log
.
info
(
"克隆应用开始!"
);
...
@@ -319,6 +342,6 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L
...
@@ -319,6 +342,6 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
}
}
}
}
\ No newline at end of file
base-manager/src/main/java/com/mortals/xhx/module/app/web/AppController.java
View file @
3b315dec
...
@@ -57,8 +57,6 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
...
@@ -57,8 +57,6 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
}
}
@Override
@Override
protected
int
infoAfter
(
Long
id
,
Map
<
String
,
Object
>
model
,
AppEntity
entity
,
Context
context
)
throws
AppException
{
protected
int
infoAfter
(
Long
id
,
Map
<
String
,
Object
>
model
,
AppEntity
entity
,
Context
context
)
throws
AppException
{
List
<
AppEntity
>
appEntityList
=
this
.
service
.
find
(
new
AppQuery
().
appCode
(
entity
.
getAppCode
()),
context
);
List
<
AppEntity
>
appEntityList
=
this
.
service
.
find
(
new
AppQuery
().
appCode
(
entity
.
getAppCode
()),
context
);
...
@@ -67,22 +65,13 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
...
@@ -67,22 +65,13 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
return
super
.
infoAfter
(
id
,
model
,
entity
,
context
);
return
super
.
infoAfter
(
id
,
model
,
entity
,
context
);
}
}
@Override
protected
int
doListAfter
(
AppEntity
query
,
Map
<
String
,
Object
>
model
,
Context
context
)
throws
AppException
{
//model.get("result")
return
super
.
doListAfter
(
query
,
model
,
context
);
}
/**
/**
* app应用部署
* app应用部署
*/
*/
@PostMapping
(
value
=
"appDistribute"
)
@PostMapping
(
value
=
"appDistribute"
)
public
Rest
<
Void
>
appDistribute
(
@RequestBody
AppEntity
appEntity
)
{
public
Rest
<
String
>
appDistribute
(
@RequestBody
AppEntity
appEntity
)
{
String
busiDesc
=
this
.
getModuleDesc
()
+
"自助服务应用部署"
;
String
busiDesc
=
this
.
getModuleDesc
()
+
"自助服务应用部署"
;
Rest
<
Void
>
rest
=
Rest
.
ok
(
busiDesc
+
" 【成功】"
);
Rest
<
String
>
rest
=
Rest
.
ok
(
busiDesc
+
" 【成功】"
);
try
{
try
{
if
(
ObjectUtils
.
isEmpty
(
appEntity
.
getId
()))
{
if
(
ObjectUtils
.
isEmpty
(
appEntity
.
getId
()))
{
throw
new
AppException
(
"应用Id不能为空!"
);
throw
new
AppException
(
"应用Id不能为空!"
);
...
@@ -91,7 +80,7 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
...
@@ -91,7 +80,7 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
if
(
ObjectUtils
.
isEmpty
(
appEntity
))
{
if
(
ObjectUtils
.
isEmpty
(
appEntity
))
{
throw
new
AppException
(
"当前应用不存在!appId:"
+
appEntity
.
getId
());
throw
new
AppException
(
"当前应用不存在!appId:"
+
appEntity
.
getId
());
}
}
Rest
<
String
>
disR
est
=
this
.
service
.
appDistribute
(
appEntity
,
getContext
());
r
est
=
this
.
service
.
appDistribute
(
appEntity
,
getContext
());
recordSysLog
(
request
,
busiDesc
+
" 【成功】"
);
recordSysLog
(
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"自助服务应用部署"
,
e
);
log
.
error
(
"自助服务应用部署"
,
e
);
...
@@ -100,6 +89,23 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
...
@@ -100,6 +89,23 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
return
rest
;
return
rest
;
}
}
/**
* app基础应用部署
*/
@PostMapping
(
value
=
"appCommonDistribute"
)
public
Rest
<
Void
>
appCommonDistribute
(
@RequestBody
AppEntity
appEntity
)
{
String
busiDesc
=
this
.
getModuleDesc
()
+
"自助服务应用部署"
;
Rest
<
Void
>
rest
=
Rest
.
ok
(
busiDesc
+
" 【成功】"
);
try
{
rest
=
this
.
service
.
appCommonDistribute
(
appEntity
,
getContext
());
recordSysLog
(
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
e
)
{
log
.
error
(
"基础服务应用部署"
,
e
);
rest
=
Rest
.
fail
(
super
.
convertException
(
e
));
}
return
rest
;
}
/**
/**
* app应用克隆给其它站点
* app应用克隆给其它站点
...
...
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