Commit f0c822a6 by tangyi

修复bug、调整GC参数

parent 32f5194f
# 1 简介 # 1 简介
- 重写[spring-cloud-online-exam](https://gitee.com/wells2333/spring-cloud-online-exam) 硕果云,基于Spring Cloud搭建的新一代微服务教学管理平台,提供多租户、权限管理、考试、练习等功能。
- 采用前后端分离技术
- 前端采用`vue2.0`,通过`jwt`和后端交互
- 后端基于`spring boot``spring cloud``MySQL`等技术实现权限管理、考试管理等功能。
# 2 在线体验 # 2 在线体验
...@@ -14,13 +8,13 @@ ...@@ -14,13 +8,13 @@
- 后台:[http://118.25.138.130:81](http://118.25.138.130:81) - 后台:[http://118.25.138.130:81](http://118.25.138.130:81)
默认账号: 账号:
单位ID:gitee | 单位ID | 账号 | 密码 | 角色 |
| --------- | -------- | -------- | -------- |
1. 管理员:admin/123456 | gitee | admin | 123456 | 管理员 |
2. 学生:student/123456 | gitee | student | 123456 | 学生 |
3. 教师:teacher/123456 | gitee | teacher | 123456 | 老师 |
# 3 技术选型 # 3 技术选型
...@@ -141,6 +135,8 @@ ...@@ -141,6 +135,8 @@
交流QQ群:<a target="_blank" href="https://jq.qq.com/?_wv=1027&k=5RKZNF2"><img border="0" src="http://pub.idqqimg.com/wpa/images/group.png" alt="Spring Cloud考试系统学习" title="Spring Cloud考试系统学习"></a> 交流QQ群:<a target="_blank" href="https://jq.qq.com/?_wv=1027&k=5RKZNF2"><img border="0" src="http://pub.idqqimg.com/wpa/images/group.png" alt="Spring Cloud考试系统学习" title="Spring Cloud考试系统学习"></a>
QQ群号:996208878 QQ群号:996208878,二维码:
<img src="http://118.25.138.130/static/img/WechatIMG4.c775d3e.png" alt="Spring Cloud考试系统学习" title="Spring Cloud考试系统学习">
如果您觉得有帮助,请点右上角 "Star" 或者项目底部的“捐助”支持一下,谢谢! 如果您觉得有帮助,请点右上角 "Star" 或者项目底部的“捐助”支持一下,谢谢!
\ No newline at end of file
...@@ -5,4 +5,4 @@ ADD target/${JAR_FILE} /opt/app.jar ...@@ -5,4 +5,4 @@ ADD target/${JAR_FILE} /opt/app.jar
EXPOSE 9181 EXPOSE 9181
ENTRYPOINT java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -Duser.timezone=Asia/Shanghai -Dfile.encoding=UTF-8 -jar /opt/app.jar ENTRYPOINT java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -Duser.timezone=Asia/Shanghai -Dfile.encoding=UTF-8 -jar /opt/app.jar
# JAVA_OPS配置,如:JAVA_OPS='-Xmx512m -Xms256m' # 演示环境GC参数:JAVA_OPS='-Xmx512m -Xms256m -XX:+UnlockDiagnosticVMOptions -XX:+UseConcMarkSweepGC -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -XX:AutoBoxCacheMax=20000 -XX:-UseBiasedLocking -XX:-UseCounterDecay -XX:-OmitStackTraceInFastThrow -Djava.security.egd=file:/dev/urandom -XX:+CMSParallelInitialMarkEnabled -XX:+ParallelRefProcEnabled -XX:+ExplicitGCInvokesConcurrent -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintTenuringDistribution -XX:+HeapDumpOnOutOfMemoryError -XX:+PerfDisableSharedMem -XX:+PrintCompressedOopsMode -XX:-PrintGCApplicationStoppedTime'
\ No newline at end of file \ No newline at end of file
...@@ -108,13 +108,13 @@ swagger: ...@@ -108,13 +108,13 @@ swagger:
# 演示环境 # 演示环境
preview: preview:
enabled: ${PREVIEW_ENABLED:false}
ignores: ignores:
- api/auth # 授权服务 - api/auth # 授权服务
- resetPassword # 重置密码 - resetPassword # 重置密码
- register - register
- checkExist - checkExist
- updateInfo - updateInfo
- updateAvatar
- attachment - attachment
- api/exam # 考试服务 - api/exam # 考试服务
- api/msc - api/msc
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
:show-file-list="showFileList" :show-file-list="showFileList"
:on-success="handleUploadSuccess" :on-success="handleUploadSuccess"
:on-progress="handleUploadProgress" :on-progress="handleUploadProgress"
:action="sysConfig.uploadUrl" action="api/user/v1/attachment/upload"
:headers="headers" :headers="headers"
:data="params" :data="params"
class="upload-demo" class="upload-demo"
...@@ -28,17 +28,17 @@ ...@@ -28,17 +28,17 @@
style="width: 100%;" style="width: 100%;"
@sort-change="sortChange"> @sort-change="sortChange">
<el-table-column type="selection" width="55"/> <el-table-column type="selection" width="55"/>
<el-table-column sortable prop="id" label="流水号" min-width="100"> <el-table-column prop="id" label="流水号" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.id }}</span> <span>{{ scope.row.id }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('table.attachName')" sortable prop="attach_name" min-width="90"> <el-table-column :label="$t('table.attachName')" prop="attach_name" min-width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.attachName }}</span> <span>{{ scope.row.attachName }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('table.uploader')" min-width="90"> <el-table-column :label="$t('table.uploader')" min-width="50">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.creator }}</span> <span>{{ scope.row.creator }}</span>
</template> </template>
...@@ -48,9 +48,9 @@ ...@@ -48,9 +48,9 @@
<span>{{ scope.row.busiType | attachmentTypeFilter }}</span> <span>{{ scope.row.busiType | attachmentTypeFilter }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('table.uploadDate')" min-width="90"> <el-table-column :label="$t('table.uploadDate')" min-width="70">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.createDate }}</span> <span>{{ scope.row.createDate | timeFilter }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('table.actions')" class-name="status-col" width="300px"> <el-table-column :label="$t('table.actions')" class-name="status-col" width="300px">
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
import { fetchList, addObj, putObj, delAttachment, getDownloadUrl } from '@/api/admin/attachment' import { fetchList, addObj, putObj, delAttachment, getDownloadUrl } from '@/api/admin/attachment'
import waves from '@/directive/waves' import waves from '@/directive/waves'
import { getToken } from '@/utils/auth' // getToken from cookie import { getToken } from '@/utils/auth' // getToken from cookie
import { notifySuccess, messageSuccess, isNotEmpty } from '@/utils/util' import { notifySuccess, messageSuccess, isNotEmpty, formatDate } from '@/utils/util'
import { mapState } from 'vuex' import { mapState } from 'vuex'
import SpinnerLoading from '@/components/SpinnerLoading' import SpinnerLoading from '@/components/SpinnerLoading'
...@@ -105,6 +105,9 @@ export default { ...@@ -105,6 +105,9 @@ export default {
attachType = '普通附件' attachType = '普通附件'
} }
return attachType return attachType
},
timeFilter (time) {
return formatDate(new Date(time), 'yyyy-MM-dd hh:mm')
} }
}, },
data () { data () {
...@@ -155,11 +158,6 @@ export default { ...@@ -155,11 +158,6 @@ export default {
created () { created () {
this.getList() this.getList()
}, },
computed: {
...mapState({
sysConfig: state => state.sysConfig.sysConfig
})
},
methods: { methods: {
getList () { getList () {
this.listLoading = true this.listLoading = true
......
<template> <template>
<el-row :gutter="40" class="panel-group"> <el-row :gutter="40" class="panel-group">
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col"> <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div class="card-panel" @click="handleSetLineChartData('purchases')">
<div class="card-panel-icon-wrapper icon-tab">
<svg-icon icon-class="tab" class-name="card-panel-icon" />
</div>
<div class="card-panel-description">
<div class="card-panel-text">单位数</div>
<count-to :start-val="0" :end-val="tenantNumber" :duration="2400" class="card-panel-num"/>
</div>
</div>
</el-col>
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div class="card-panel" @click="handleSetLineChartData('newVisitis')"> <div class="card-panel" @click="handleSetLineChartData('newVisitis')">
<div class="card-panel-icon-wrapper icon-people"> <div class="card-panel-icon-wrapper icon-people">
<svg-icon icon-class="peoples" class-name="card-panel-icon" /> <svg-icon icon-class="peoples" class-name="card-panel-icon" />
...@@ -23,22 +34,11 @@ ...@@ -23,22 +34,11 @@
</div> </div>
</el-col> </el-col>
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col"> <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div class="card-panel" @click="handleSetLineChartData('purchases')"> <div class="card-panel" @click="handleSetLineChartData('shoppings')">
<div class="card-panel-icon-wrapper icon-chart"> <div class="card-panel-icon-wrapper icon-chart">
<svg-icon icon-class="chart" class-name="card-panel-icon" /> <svg-icon icon-class="chart" class-name="card-panel-icon" />
</div> </div>
<div class="card-panel-description"> <div class="card-panel-description">
<div class="card-panel-text">参加人数</div>
<count-to :start-val="0" :end-val="examUserNumber" :duration="2400" class="card-panel-num"/>
</div>
</div>
</el-col>
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div class="card-panel" @click="handleSetLineChartData('shoppings')">
<div class="card-panel-icon-wrapper icon-tab">
<svg-icon icon-class="tab" class-name="card-panel-icon" />
</div>
<div class="card-panel-description">
<div class="card-panel-text">课程数</div> <div class="card-panel-text">课程数</div>
<count-to :start-val="0" :end-val="13600" :duration="2600" class="card-panel-num"/> <count-to :start-val="0" :end-val="13600" :duration="2600" class="card-panel-num"/>
</div> </div>
...@@ -60,7 +60,8 @@ export default { ...@@ -60,7 +60,8 @@ export default {
return { return {
onlineUserNumber: 0, onlineUserNumber: 0,
examinationNumber: 0, examinationNumber: 0,
examUserNumber: 0 examUserNumber: 0,
tenantNumber: 0
} }
}, },
created () { created () {
...@@ -84,6 +85,9 @@ export default { ...@@ -84,6 +85,9 @@ export default {
if (isNotEmpty(data.examUserNumber)) { if (isNotEmpty(data.examUserNumber)) {
this.examUserNumber = parseInt(data.examUserNumber) this.examUserNumber = parseInt(data.examUserNumber)
} }
if (isNotEmpty(data.tenantCount)) {
this.tenantNumber = parseInt(data.tenantCount)
}
} }
}).catch(error => { }).catch(error => {
console.error(error) console.error(error)
......
...@@ -18,22 +18,22 @@ ...@@ -18,22 +18,22 @@
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
@sort-change="sortChange"> @sort-change="sortChange">
<el-table-column type="selection" width="55"/> <el-table-column type="selection" width="55"/>
<el-table-column :label="$t('table.courseName')" sortable prop="course_name"> <el-table-column :label="$t('table.courseName')" prop="course_name">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.courseName }}</span> <span>{{ scope.row.courseName }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('table.college')" sortable prop="college"> <el-table-column :label="$t('table.college')" prop="college">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.college }}</span> <span>{{ scope.row.college }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('table.major')" sortable prop="major"> <el-table-column :label="$t('table.major')" prop="major">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.major }}</span> <span>{{ scope.row.major }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('table.teacher')" sortable prop="teacher"> <el-table-column :label="$t('table.teacher')" prop="teacher">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.teacher }}</span> <span>{{ scope.row.teacher }}</span>
</template> </template>
......
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
:show-file-list="false" :show-file-list="false"
:on-success="handleAvatarSuccess" :on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload" :before-upload="beforeAvatarUpload"
:action="sysConfig.uploadUrl" action="api/user/v1/attachment/upload"
:headers="headers" :headers="headers"
:data="params" :data="params"
class="avatar-uploader"> class="avatar-uploader">
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
:on-success="handleUploadSuccess" :on-success="handleUploadSuccess"
:on-exceed="handleExceed" :on-exceed="handleExceed"
:on-remove="handleRemove" :on-remove="handleRemove"
:action="sysConfig.uploadUrl" action="api/user/v1/attachment/upload"
:headers="headers" :headers="headers"
:data="params" :data="params"
:limit="1" :limit="1"
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
import { fetchKnowledgeList, addObj, putObj, delObj, delAllObj } from '@/api/exam/knowledge' import { fetchKnowledgeList, addObj, putObj, delObj, delAllObj } from '@/api/exam/knowledge'
import waves from '@/directive/waves' import waves from '@/directive/waves'
import { mapGetters, mapState } from 'vuex' import { mapGetters, mapState } from 'vuex'
import { checkMultipleSelect, notifySuccess, notifyFail, messageSuccess } from '@/utils/util' import { isNotEmpty, checkMultipleSelect, notifySuccess, notifyFail, messageSuccess } from '@/utils/util'
import { getToken } from '@/utils/auth' // getToken from cookie import { getToken } from '@/utils/auth' // getToken from cookie
import { getObj, delAttachment } from '@/api/admin/attachment' import { getObj, delAttachment } from '@/api/admin/attachment'
import SpinnerLoading from '@/components/SpinnerLoading' import SpinnerLoading from '@/components/SpinnerLoading'
...@@ -317,7 +317,8 @@ export default { ...@@ -317,7 +317,8 @@ export default {
}, },
// 查询附件列表 // 查询附件列表
getFileList (attachmentId) { getFileList (attachmentId) {
if (attachmentId !== '') { this.fileList = []
if (isNotEmpty(attachmentId)) {
getObj(attachmentId).then(response => { getObj(attachmentId).then(response => {
const data = response.data.data const data = response.data.data
const attachment = { const attachment = {
......
...@@ -17,12 +17,12 @@ ...@@ -17,12 +17,12 @@
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
@sort-change="sortChange"> @sort-change="sortChange">
<el-table-column type="selection" width="55"/> <el-table-column type="selection" width="55"/>
<el-table-column :label="$t('table.client.clientId')" sortable prop="client_id"> <el-table-column :label="$t('table.client.clientId')" prop="client_id">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.clientId }}</span> <span>{{ scope.row.clientId }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('table.client.clientSecretPlainText')"> <el-table-column :label="$t('table.client.clientSecretPlainText')" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.clientSecretPlainText }}</span> <span>{{ scope.row.clientSecretPlainText }}</span>
</template> </template>
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
:props="defaultProps" :props="defaultProps"
class="filter-tree" class="filter-tree"
node-key="id" node-key="id"
default-expand-all
highlight-current highlight-current
@node-click="getNodeData" @node-click="getNodeData"
@node-expand="nodeExpand" @node-expand="nodeExpand"
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<h4>链接</h4> <h4>链接</h4>
<a target="_blank" href="https://gitee.com/wells2333/spring-microservice-exam">码云</a> <a target="_blank" href="https://gitee.com/wells2333/spring-microservice-exam">码云</a>
<a target="_blank" href="https://github.com/">GITHUB</a> <a target="_blank" href="https://github.com/">GITHUB</a>
<a target="_blank" href="http://it99.club:81">管理后台</a> <a target="_blank" href="http://118.25.138.130:81">管理后台</a>
<a target="_blank" href="https://gitee.com/wells2333/spring-microservice-exam/blob/master/CHANGELOG.md">更新日志</a> <a target="_blank" href="https://gitee.com/wells2333/spring-microservice-exam/blob/master/CHANGELOG.md">更新日志</a>
</el-col> </el-col>
<el-col :span="4" class="footer-col"> <el-col :span="4" class="footer-col">
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<a href="https://www.kancloud.cn/tangyi/spring-microservice-exam/1322870" target="_blank">部署文档</a> <a href="https://www.kancloud.cn/tangyi/spring-microservice-exam/1322870" target="_blank">部署文档</a>
</el-menu-item> </el-menu-item>
<el-menu-item index="u-admin"> <el-menu-item index="u-admin">
<a href="http://it99.club:81" target="_blank">管理后台</a> <a href="http://118.25.138.130:81" target="_blank">管理后台</a>
</el-menu-item> </el-menu-item>
</el-submenu> </el-submenu>
<el-submenu index="/c"> <el-submenu index="/c">
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
:show-file-list="false" :show-file-list="false"
:on-success="handleAvatarSuccess" :on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload" :before-upload="beforeAvatarUpload"
:action="sysConfig.uploadUrl" action="api/user/v1/attachment/upload"
:headers="headers" :headers="headers"
:data="params" :data="params"
class="avatar-uploader"> class="avatar-uploader">
...@@ -127,8 +127,7 @@ export default { ...@@ -127,8 +127,7 @@ export default {
}, },
computed: { computed: {
...mapState({ ...mapState({
userInfo: state => state.user.userInfo, userInfo: state => state.user.userInfo
sysConfig: state => state.sysConfig.sysConfig
}) })
}, },
methods: { methods: {
......
...@@ -5,4 +5,4 @@ ADD target/${JAR_FILE} /opt/app.jar ...@@ -5,4 +5,4 @@ ADD target/${JAR_FILE} /opt/app.jar
EXPOSE 9180 EXPOSE 9180
ENTRYPOINT java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -Duser.timezone=Asia/Shanghai -Dfile.encoding=UTF-8 -jar /opt/app.jar ENTRYPOINT java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -Duser.timezone=Asia/Shanghai -Dfile.encoding=UTF-8 -jar /opt/app.jar
# JAVA_OPS配置,如:JAVA_OPS='-Xmx512m -Xms256m' # 演示环境GC参数:JAVA_OPS='-Xmx512m -Xms256m -XX:+UnlockDiagnosticVMOptions -XX:+UseConcMarkSweepGC -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -XX:AutoBoxCacheMax=20000 -XX:-UseBiasedLocking -XX:-UseCounterDecay -XX:-OmitStackTraceInFastThrow -Djava.security.egd=file:/dev/urandom -XX:+CMSParallelInitialMarkEnabled -XX:+ParallelRefProcEnabled -XX:+ExplicitGCInvokesConcurrent -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintTenuringDistribution -XX:+HeapDumpOnOutOfMemoryError -XX:+PerfDisableSharedMem -XX:+PrintCompressedOopsMode -XX:-PrintGCApplicationStoppedTime'
\ No newline at end of file \ No newline at end of file
...@@ -5,4 +5,4 @@ ADD target/${JAR_FILE} /opt/app.jar ...@@ -5,4 +5,4 @@ ADD target/${JAR_FILE} /opt/app.jar
EXPOSE 9182 EXPOSE 9182
ENTRYPOINT java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -Duser.timezone=Asia/Shanghai -Dfile.encoding=UTF-8 -jar /opt/app.jar ENTRYPOINT java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -Duser.timezone=Asia/Shanghai -Dfile.encoding=UTF-8 -jar /opt/app.jar
# JAVA_OPS配置,如:JAVA_OPS='-Xmx512m -Xms256m' # 演示环境GC参数:JAVA_OPS='-Xmx512m -Xms256m -XX:+UnlockDiagnosticVMOptions -XX:+UseConcMarkSweepGC -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -XX:AutoBoxCacheMax=20000 -XX:-UseBiasedLocking -XX:-UseCounterDecay -XX:-OmitStackTraceInFastThrow -Djava.security.egd=file:/dev/urandom -XX:+CMSParallelInitialMarkEnabled -XX:+ParallelRefProcEnabled -XX:+ExplicitGCInvokesConcurrent -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintTenuringDistribution -XX:+HeapDumpOnOutOfMemoryError -XX:+PerfDisableSharedMem -XX:+PrintCompressedOopsMode -XX:-PrintGCApplicationStoppedTime'
\ No newline at end of file \ No newline at end of file
...@@ -5,4 +5,4 @@ ADD target/${JAR_FILE} /opt/app.jar ...@@ -5,4 +5,4 @@ ADD target/${JAR_FILE} /opt/app.jar
EXPOSE 9184 EXPOSE 9184
ENTRYPOINT java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -Duser.timezone=Asia/Shanghai -Dfile.encoding=UTF-8 -jar /opt/app.jar ENTRYPOINT java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -Duser.timezone=Asia/Shanghai -Dfile.encoding=UTF-8 -jar /opt/app.jar
# JAVA_OPS配置,如:JAVA_OPS='-Xmx512m -Xms256m' # 演示环境GC参数:JAVA_OPS='-Xmx512m -Xms256m -XX:+UnlockDiagnosticVMOptions -XX:+UseConcMarkSweepGC -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -XX:AutoBoxCacheMax=20000 -XX:-UseBiasedLocking -XX:-UseCounterDecay -XX:-OmitStackTraceInFastThrow -Djava.security.egd=file:/dev/urandom -XX:+CMSParallelInitialMarkEnabled -XX:+ParallelRefProcEnabled -XX:+ExplicitGCInvokesConcurrent -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintTenuringDistribution -XX:+HeapDumpOnOutOfMemoryError -XX:+PerfDisableSharedMem -XX:+PrintCompressedOopsMode -XX:-PrintGCApplicationStoppedTime'
\ No newline at end of file \ No newline at end of file
...@@ -5,4 +5,4 @@ ADD target/${JAR_FILE} /opt/app.jar ...@@ -5,4 +5,4 @@ ADD target/${JAR_FILE} /opt/app.jar
EXPOSE 9185 EXPOSE 9185
ENTRYPOINT java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -Duser.timezone=Asia/Shanghai -Dfile.encoding=UTF-8 -jar /opt/app.jar ENTRYPOINT java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -Duser.timezone=Asia/Shanghai -Dfile.encoding=UTF-8 -jar /opt/app.jar
# JAVA_OPS配置,如:JAVA_OPS='-Xmx512m -Xms256m' # 演示环境GC参数:JAVA_OPS='-Xmx512m -Xms256m -XX:+UnlockDiagnosticVMOptions -XX:+UseConcMarkSweepGC -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -XX:AutoBoxCacheMax=20000 -XX:-UseBiasedLocking -XX:-UseCounterDecay -XX:-OmitStackTraceInFastThrow -Djava.security.egd=file:/dev/urandom -XX:+CMSParallelInitialMarkEnabled -XX:+ParallelRefProcEnabled -XX:+ExplicitGCInvokesConcurrent -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintTenuringDistribution -XX:+HeapDumpOnOutOfMemoryError -XX:+PerfDisableSharedMem -XX:+PrintCompressedOopsMode -XX:-PrintGCApplicationStoppedTime'
\ No newline at end of file \ No newline at end of file
...@@ -29,4 +29,14 @@ public class DashboardDto implements Serializable { ...@@ -29,4 +29,14 @@ public class DashboardDto implements Serializable {
* 参与人数 * 参与人数
*/ */
private String examUserNumber; private String examUserNumber;
/**
* 单位数量
*/
private String tenantCount;
/**
* 课程数
*/
private String courseCount;
} }
...@@ -5,4 +5,4 @@ ADD target/${JAR_FILE} /opt/app.jar ...@@ -5,4 +5,4 @@ ADD target/${JAR_FILE} /opt/app.jar
EXPOSE 9185 EXPOSE 9185
ENTRYPOINT java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -Duser.timezone=Asia/Shanghai -Dfile.encoding=UTF-8 -jar /opt/app.jar ENTRYPOINT java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -Duser.timezone=Asia/Shanghai -Dfile.encoding=UTF-8 -jar /opt/app.jar
# JAVA_OPS配置,如:JAVA_OPS='-Xmx512m -Xms256m' # 演示环境GC参数:JAVA_OPS='-Xmx512m -Xms256m -XX:+UnlockDiagnosticVMOptions -XX:+UseConcMarkSweepGC -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -XX:AutoBoxCacheMax=20000 -XX:-UseBiasedLocking -XX:-UseCounterDecay -XX:-OmitStackTraceInFastThrow -Djava.security.egd=file:/dev/urandom -XX:+CMSParallelInitialMarkEnabled -XX:+ParallelRefProcEnabled -XX:+ExplicitGCInvokesConcurrent -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintTenuringDistribution -XX:+HeapDumpOnOutOfMemoryError -XX:+PerfDisableSharedMem -XX:+PrintCompressedOopsMode -XX:-PrintGCApplicationStoppedTime'
\ No newline at end of file \ No newline at end of file
...@@ -8,6 +8,7 @@ import com.github.tangyi.common.core.vo.UserVo; ...@@ -8,6 +8,7 @@ import com.github.tangyi.common.core.vo.UserVo;
import com.github.tangyi.common.core.web.BaseController; import com.github.tangyi.common.core.web.BaseController;
import com.github.tangyi.exam.api.feign.ExaminationServiceClient; import com.github.tangyi.exam.api.feign.ExaminationServiceClient;
import com.github.tangyi.user.api.dto.DashboardDto; import com.github.tangyi.user.api.dto.DashboardDto;
import com.github.tangyi.user.service.TenantService;
import com.github.tangyi.user.service.UserService; import com.github.tangyi.user.service.UserService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -32,6 +33,8 @@ public class DashboardController extends BaseController { ...@@ -32,6 +33,8 @@ public class DashboardController extends BaseController {
private final UserService userService; private final UserService userService;
private final TenantService tenantService;
/** /**
* 获取管控台首页数据 * 获取管控台首页数据
* *
...@@ -48,6 +51,8 @@ public class DashboardController extends BaseController { ...@@ -48,6 +51,8 @@ public class DashboardController extends BaseController {
UserVo userVo = new UserVo(); UserVo userVo = new UserVo();
userVo.setTenantCode(tenantCode); userVo.setTenantCode(tenantCode);
dashboardDto.setOnlineUserNumber(userService.userCount(userVo).toString()); dashboardDto.setOnlineUserNumber(userService.userCount(userVo).toString());
// 租户数量
dashboardDto.setTenantCount(tenantService.tenantCount().toString());
// 查询考试数量 // 查询考试数量
ResponseBean<Integer> examinationCountResponseBean = examinationService.findExaminationCount(tenantCode); ResponseBean<Integer> examinationCountResponseBean = examinationService.findExaminationCount(tenantCode);
if (!ResponseUtil.isSuccess(examinationCountResponseBean)) if (!ResponseUtil.isSuccess(examinationCountResponseBean))
......
...@@ -22,4 +22,11 @@ public interface TenantMapper extends CrudMapper<Tenant> { ...@@ -22,4 +22,11 @@ public interface TenantMapper extends CrudMapper<Tenant> {
* @date 2019/05/26 10:29 * @date 2019/05/26 10:29
*/ */
Tenant getByTenantCode(String tenantCode); Tenant getByTenantCode(String tenantCode);
/**
* 查询租户数量
*
* @return Integer
*/
Integer tenantCount();
} }
...@@ -111,7 +111,6 @@ public class AttachmentService extends CrudService<AttachmentMapper, Attachment> ...@@ -111,7 +111,6 @@ public class AttachmentService extends CrudService<AttachmentMapper, Attachment>
@Transactional @Transactional
@CacheEvict(value = {"attachment", "attachment_preview"}, key = "#attachment.id") @CacheEvict(value = {"attachment", "attachment_preview"}, key = "#attachment.id")
public int delete(Attachment attachment) { public int delete(Attachment attachment) {
qiNiuService.delete(attachment.getAttachName());
return super.delete(attachment); return super.delete(attachment);
} }
......
...@@ -143,4 +143,14 @@ public class TenantService extends CrudService<TenantMapper, Tenant> { ...@@ -143,4 +143,14 @@ public class TenantService extends CrudService<TenantMapper, Tenant> {
public int deleteAll(Long[] ids) { public int deleteAll(Long[] ids) {
return super.deleteAll(ids); return super.deleteAll(ids);
} }
/**
* 查询单位数量
* @return Integer
* @author tangyi
* @date 2019/12/18 5:09 下午
*/
public Integer tenantCount() {
return this.dao.tenantCount();
}
} }
...@@ -65,6 +65,11 @@ ...@@ -65,6 +65,11 @@
</foreach> </foreach>
</select> </select>
<select id="tenantCount" resultType="Integer">
SELECT COUNT(1) FROM sys_tenant a
WHERE a.del_flag = 0
</select>
<insert id="insert"> <insert id="insert">
INSERT INTO sys_tenant ( INSERT INTO sys_tenant (
id, id,
......
...@@ -5,4 +5,4 @@ ADD target/${JAR_FILE} /opt/app.jar ...@@ -5,4 +5,4 @@ ADD target/${JAR_FILE} /opt/app.jar
EXPOSE 9186 EXPOSE 9186
ENTRYPOINT java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -Duser.timezone=Asia/Shanghai -Dfile.encoding=UTF-8 -jar /opt/app.jar ENTRYPOINT java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -Duser.timezone=Asia/Shanghai -Dfile.encoding=UTF-8 -jar /opt/app.jar
# JAVA_OPS配置,如:JAVA_OPS='-Xmx512m -Xms256m' # 演示环境GC参数:JAVA_OPS='-Xmx512m -Xms256m -XX:+UnlockDiagnosticVMOptions -XX:+UseConcMarkSweepGC -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -XX:AutoBoxCacheMax=20000 -XX:-UseBiasedLocking -XX:-UseCounterDecay -XX:-OmitStackTraceInFastThrow -Djava.security.egd=file:/dev/urandom -XX:+CMSParallelInitialMarkEnabled -XX:+ParallelRefProcEnabled -XX:+ExplicitGCInvokesConcurrent -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintTenuringDistribution -XX:+HeapDumpOnOutOfMemoryError -XX:+PerfDisableSharedMem -XX:+PrintCompressedOopsMode -XX:-PrintGCApplicationStoppedTime'
\ No newline at end of file \ No newline at end of file
sonar.projectKey=spring-microservice-exam sonar.projectKey=spring-microservice-exam
sonar.projectName=spring-microservice-exam sonar.projectName=spring-microservice-exam
sonar.projectVersion=3.4.0 sonar.projectVersion=3.5.0
sonar.sources= sonar.sources=
sonar.binaries=bin sonar.binaries=bin
sonar.language=java sonar.language=java
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment