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
86c286ea
Commit
86c286ea
authored
Jan 14, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
应用添加服务访问地址
parent
44058681
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
104 additions
and
22 deletions
+104
-22
base-manager/db/params.sql
base-manager/db/params.sql
+1
-1
base-manager/src/main/java/com/mortals/xhx/common/key/Constant.java
...er/src/main/java/com/mortals/xhx/common/key/Constant.java
+2
-0
base-manager/src/main/java/com/mortals/xhx/module/app/model/vo/AppVo.java
.../main/java/com/mortals/xhx/module/app/model/vo/AppVo.java
+4
-0
base-manager/src/main/java/com/mortals/xhx/module/app/service/impl/AppServiceImpl.java
...m/mortals/xhx/module/app/service/impl/AppServiceImpl.java
+23
-3
base-manager/src/main/java/com/mortals/xhx/module/app/web/AppController.java
...in/java/com/mortals/xhx/module/app/web/AppController.java
+26
-0
base-manager/src/main/java/com/mortals/xhx/module/app/web/AppVersionController.java
.../com/mortals/xhx/module/app/web/AppVersionController.java
+2
-1
deploy.sh
deploy.sh
+46
-17
No files found.
base-manager/db/params.sql
View file @
86c286ea
...
...
@@ -360,7 +360,7 @@ INSERT INTO `mortals_xhx_product` VALUES (null, '窗口屏', 'ckp', '窗口屏',
INSERT
INTO
`mortals_xhx_product`
VALUES
(
null
,
'呼叫器'
,
'hjq'
,
'呼叫器'
,
1
,
now
(),
NULL
,
NULL
);
INSERT
INTO
`mortals_xhx_product`
VALUES
(
null
,
'集中显示屏'
,
'jzxsp'
,
'集中显示屏'
,
1
,
now
(),
NULL
,
NULL
);
INSERT
INTO
`mortals_xhx_product`
VALUES
(
null
,
'导视机'
,
'dsj'
,
'导视机'
,
1
,
now
(),
NULL
,
NULL
);
INSERT
INTO
`mortals_xhx_product`
VALUES
(
null
,
'评
级器'
,
'pjq'
,
'评级
器'
,
1
,
now
(),
NULL
,
NULL
);
INSERT
INTO
`mortals_xhx_product`
VALUES
(
null
,
'评
价器'
,
'pjq'
,
'评价
器'
,
1
,
now
(),
NULL
,
NULL
);
INSERT
INTO
`mortals_xhx_product`
VALUES
(
null
,
'自助服务终端'
,
'zzfwzd'
,
'自助服务终端'
,
1
,
now
(),
NULL
,
NULL
);
INSERT
INTO
`mortals_xhx_product`
VALUES
(
null
,
'填单机'
,
'tdj'
,
'填单机'
,
1
,
now
(),
NULL
,
NULL
);
INSERT
INTO
`mortals_xhx_product`
VALUES
(
null
,
'样表机'
,
'ybj'
,
'样表机'
,
1
,
now
(),
NULL
,
NULL
);
...
...
base-manager/src/main/java/com/mortals/xhx/common/key/Constant.java
View file @
86c286ea
...
...
@@ -128,5 +128,7 @@ public final class Constant {
*/
public
final
static
String
PARAM_SERVER_HTTP_URL
=
"server_http_url"
;
public
final
static
String
CUSTAPP_ROOT_PATH
=
"app"
;
}
base-manager/src/main/java/com/mortals/xhx/module/app/model/vo/AppVo.java
View file @
86c286ea
...
...
@@ -23,5 +23,9 @@ public class AppVo extends BaseEntityLong {
private
List
<
Long
>
siteIdList
;
private
List
<
Long
>
idList
;
/**
* 自主应用访问地址
*/
private
String
custUrl
;
}
\ No newline at end of file
base-manager/src/main/java/com/mortals/xhx/module/app/service/impl/AppServiceImpl.java
View file @
86c286ea
package
com.mortals.xhx.module.app.service.impl
;
import
cn.hutool.core.net.url.UrlBuilder
;
import
cn.hutool.core.util.NumberUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.ZipUtil
;
...
...
@@ -36,6 +37,8 @@ import java.io.File;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
Constant
.
CUSTAPP_ROOT_PATH
;
/**
* AppService
* 自助终端应用 service实现
...
...
@@ -78,13 +81,30 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L
}
}
}
//统计站点
list
.
forEach
(
item
->
{
List
<
AppEntity
>
appEntityList
=
this
.
find
(
new
AppQuery
().
appCode
(
item
.
getAppCode
()),
context
);
item
.
setApplianceSiteScope
(
appEntityList
.
size
());
item
.
setSiteIdList
(
appEntityList
.
stream
().
map
(
AppEntity:
:
getSiteId
).
collect
(
Collectors
.
toList
()));
//构建访问地址
SiteEntity
siteEntity
=
siteService
.
getCache
(
item
.
getSiteId
().
toString
());
if
(!
ObjectUtils
.
isEmpty
(
siteEntity
))
{
//请求地址 http://domian/app/siteCode/appcode/html
String
domainUrl
=
GlobalSysInfo
.
getParamValue
(
Constant
.
PARAM_SERVER_HTTP_URL
,
"http://192.168.0.98:11078"
);
item
.
setCustUrl
(
UrlBuilder
.
of
(
domainUrl
)
.
addPath
(
CUSTAPP_ROOT_PATH
)
.
addPath
(
siteEntity
.
getSiteCode
())
.
addPath
(
item
.
getAppCode
())
.
addPath
(
item
.
getVersion
().
toString
())
.
toString
());
}
else
{
item
.
setCustUrl
(
""
);
}
});
super
.
findAfter
(
params
,
pageInfo
,
context
,
list
);
}
...
...
@@ -111,7 +131,7 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L
FileUtil
.
del
(
disPath
);
}
//ZipUtils.unzip(new File(targetFilePath), disPath);
ZipUtil
.
unzip
(
targetFilePath
,
disPath
);
ZipUtil
.
unzip
(
targetFilePath
,
disPath
);
//更新
appEntity
.
setDistributeFilePath
(
disPath
);
appEntity
.
setDistribute
(
YesNoEnum
.
YES
.
getValue
());
...
...
@@ -138,7 +158,7 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L
if
(
FileUtil
.
isDirectory
(
disPath
))
{
FileUtil
.
del
(
disPath
);
}
// ZipUtils.unzip(new File(targetFilePath), disPath);
// ZipUtils.unzip(new File(targetFilePath), disPath);
ZipUtil
.
unzip
(
targetFilePath
,
disPath
);
return
Rest
.
ok
(
"基础应用部署成功!"
);
...
...
base-manager/src/main/java/com/mortals/xhx/module/app/web/AppController.java
View file @
86c286ea
package
com.mortals.xhx.module.app.web
;
import
cn.hutool.core.net.url.UrlBuilder
;
import
cn.hutool.core.util.ZipUtil
;
import
com.mortals.framework.ap.GlobalSysInfo
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
...
...
@@ -8,6 +10,7 @@ import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.common.code.AppTypeEnum
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.common.key.Constant
;
import
com.mortals.xhx.module.app.model.AppEntity
;
import
com.mortals.xhx.module.app.model.AppQuery
;
import
com.mortals.xhx.module.app.service.AppService
;
...
...
@@ -25,6 +28,8 @@ import java.util.List;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
Constant
.
CUSTAPP_ROOT_PATH
;
/**
* 自助终端应用
*
...
...
@@ -60,6 +65,22 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
List
<
AppEntity
>
appEntityList
=
this
.
service
.
find
(
new
AppQuery
().
appCode
(
entity
.
getAppCode
()),
context
);
entity
.
setApplianceSiteScope
(
appEntityList
.
size
());
entity
.
setSiteIdList
(
appEntityList
.
stream
().
map
(
AppEntity:
:
getSiteId
).
collect
(
Collectors
.
toList
()));
SiteEntity
siteEntity
=
siteService
.
getCache
(
entity
.
getSiteId
().
toString
());
if
(!
ObjectUtils
.
isEmpty
(
siteEntity
)){
//请求地址 http://domian/app/siteCode/appcode/html
String
domainUrl
=
GlobalSysInfo
.
getParamValue
(
Constant
.
PARAM_SERVER_HTTP_URL
,
"http://192.168.0.98:11078"
);
entity
.
setCustUrl
(
UrlBuilder
.
of
(
domainUrl
)
.
addPath
(
CUSTAPP_ROOT_PATH
)
.
addPath
(
siteEntity
.
getSiteCode
())
.
addPath
(
entity
.
getAppCode
())
.
addPath
(
entity
.
getVersion
().
toString
())
.
toString
());
}
else
{
entity
.
setCustUrl
(
""
);
}
return
super
.
infoAfter
(
id
,
model
,
entity
,
context
);
}
...
...
@@ -131,6 +152,11 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
}
public
static
void
main
(
String
[]
args
)
{
...
...
base-manager/src/main/java/com/mortals/xhx/module/app/web/AppVersionController.java
View file @
86c286ea
...
...
@@ -37,6 +37,7 @@ import org.springframework.web.bind.annotation.*;
import
org.springframework.web.multipart.MultipartFile
;
import
static
com
.
mortals
.
framework
.
ap
.
SysConstains
.*;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
Constant
.
CUSTAPP_ROOT_PATH
;
/**
* 自助终端应用版本历史
...
...
@@ -130,7 +131,7 @@ public class AppVersionController extends BaseCRUDJsonBodyMappingController<AppV
//请求地址 http://domian/app/siteCode/appcode/html
String
domainUrl
=
GlobalSysInfo
.
getParamValue
(
Constant
.
PARAM_SERVER_HTTP_URL
,
"http://192.168.0.98:11078"
);
rest
.
setData
(
UrlBuilder
.
of
(
domainUrl
)
.
addPath
(
"app"
)
.
addPath
(
CUSTAPP_ROOT_PATH
)
.
addPath
(
siteEntity
.
getSiteCode
())
.
addPath
(
appEntity
.
getAppCode
())
.
addPath
(
appEntity
.
getVersion
().
toString
())
...
...
deploy.sh
View file @
86c286ea
...
...
@@ -43,6 +43,7 @@ MYSQL_HOST="127.0.0.1"
MYSQL_PORT
=
"3306"
MYSQL_USER
=
"root"
MYSQL_PASSWORD
=
"xhx@2022"
MYSQL_SERVICE
=
"
${
SERVICE_PATH
}
/mysql.service"
#rabbitmq
RABBITMQ
=
"rabbitmq"
...
...
@@ -192,19 +193,20 @@ setup_redis() {
echo
"notify-keyspace-events Ex"
>>
${
REDIS_EXECPATH
}
/redis.conf
echo
"requirepass
${
REDIS_PASSWORD
}
"
>>
${
REDIS_EXECPATH
}
/redis.conf
echo
"[Unit]
Description=
${
REDIS
}
After=network.target
echo
"
[Unit]
Description=
${
REDIS
}
After=network.target
[Service]
Type=forking
ExecStart=
${
REDIS_EXECPATH
}
/bin/redis-server
${
REDIS_EXECPATH
}
/redis.conf
ExecReload=
${
REDIS_EXECPATH
}
/bin/redis-server -s reload
ExecStop=
${
REDIS_EXECPATH
}
/bin/redis-server -s stop
PrivateTmp=true
[Service]
Type=forking
ExecStart=
${
REDIS_EXECPATH
}
/bin/redis-server
${
REDIS_EXECPATH
}
/redis.conf
ExecReload=
${
REDIS_EXECPATH
}
/bin/redis-server -s reload
ExecStop=
${
REDIS_EXECPATH
}
/bin/redis-server -s stop
PrivateTmp=true
[Install]
WantedBy=multi-user.target
WantedBy=multi-user.target
"
>
${
REDIS_SERVICE
}
systemctl
enable
redis
...
...
@@ -242,7 +244,8 @@ setup_mysql() {
chown
mysql:mysql mysql-files
chmod
750 mysql-file
echo
"[mysqld]
echo
"
[mysqld]
datadir=
${
MYSQL_DATA_PATH
}
socket=/tmp/mysql.sock
port =
${
MYSQL_PORT
}
...
...
@@ -269,15 +272,41 @@ socket=/tmp/mysql.sock
#bin/mysqld --initialize-insecure --user=mysql --datadir=${MYSQL_DATA_PATH} --basedir=${MYSQL_EXECPATH} --socket=/tmp/mysql.sock
#创建软连接
rm
-m
/etc/init.d/mysql
rm
-m
/usr/bin/mysql
ln
-s
${
MYSQL_EXECPATH
}
/support-files/mysql.server /etc/init.d/mysql
ln
-s
${
MYSQL_EXECPATH
}
/bin/mysql /usr/bin/mysql
export
PATH
=
$PATH
:
${
MYSQL_EXECPATH
}
/bin
source
/etc/profile
service mysql restart
mysql
-uroot
-p
<
${
BASEDIR
}
/soft/
${
MYSQL
}
/user.sql
sed
-i
"s/skip-grant-tables/#skip-grant-tables/g"
${
MYSQL_CONF_PATH
}
service mysql restart
# export PATH=$PATH:${MYSQL_EXECPATH}/bin
# source /etc/profile
# service mysql restart
# mysql -uroot -p123 <${BASEDIR}/soft/${MYSQL}/user.sql
# sed -i "s/skip-grant-tables/#skip-grant-tables/g" ${MYSQL_CONF_PATH}
#service mysql restart
echo
"
[Unit]
Description=MySQL Server
After=network.target
After=syslog.target
[Service]
User=mysql
Group=mysql
Type=forking
PermissionsStartOnly=true
ExecStart= /etc/init.d/mysql start
ExecStop= /etc/init.d/mysql stop
ExecReload= /etc/init.d/mysql restart
LimitNOFILE = 5000
[Install]
WantedBy=multi-user.target
"
>
${
MYSQL_CONF_PATH
}
systemctl
enable
mysql
systemctl daemon-reload
systemctl restart mysql
mysql
-uroot
-p123
<
${
BASEDIR
}
/soft/
${
MYSQL
}
/user.sql
sed
-i
"s/skip-grant-tables/#skip-grant-tables/g"
${
MYSQL_CONF_PATH
}
systemctl restart mysql
}
setup_rabbitmq
()
{
...
...
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