mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-21 10:13:01 +00:00
新增系统设置接口
This commit is contained in:
@@ -0,0 +1,38 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help us improve
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
**To Reproduce**
|
||||||
|
Steps to reproduce the behavior:
|
||||||
|
1. Go to '...'
|
||||||
|
2. Click on '....'
|
||||||
|
3. Scroll down to '....'
|
||||||
|
4. See error
|
||||||
|
|
||||||
|
**Expected behavior**
|
||||||
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
|
**Screenshots**
|
||||||
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
|
**Desktop (please complete the following information):**
|
||||||
|
- OS: [e.g. iOS]
|
||||||
|
- Browser [e.g. chrome, safari]
|
||||||
|
- Version [e.g. 22]
|
||||||
|
|
||||||
|
**Smartphone (please complete the following information):**
|
||||||
|
- Device: [e.g. iPhone6]
|
||||||
|
- OS: [e.g. iOS8.1]
|
||||||
|
- Browser [e.g. stock browser, safari]
|
||||||
|
- Version [e.g. 22]
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the problem here.
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
name: build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
build:
|
||||||
|
name: Build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Set up Go 1.13
|
||||||
|
uses: actions/setup-go@v1
|
||||||
|
with:
|
||||||
|
go-version: 1.13
|
||||||
|
id: go
|
||||||
|
|
||||||
|
- name: Check out code into the Go module directory
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Get dependencies
|
||||||
|
run: |
|
||||||
|
go get -v -t -d ./...
|
||||||
|
if [ -f Gopkg.toml ]; then
|
||||||
|
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
||||||
|
dep ensure
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: go build -v .
|
||||||
@@ -24,6 +24,7 @@ const (
|
|||||||
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
|
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
|
||||||
// @Router /api/v1/settings/serverInfo [get]
|
// @Router /api/v1/settings/serverInfo [get]
|
||||||
func ServerInfo(c *gin.Context) {
|
func ServerInfo(c *gin.Context) {
|
||||||
|
|
||||||
osDic := make(map[string]interface{}, 0)
|
osDic := make(map[string]interface{}, 0)
|
||||||
osDic["goOs"] = runtime.GOOS
|
osDic["goOs"] = runtime.GOOS
|
||||||
osDic["arch"] = runtime.GOARCH
|
osDic["arch"] = runtime.GOARCH
|
||||||
@@ -56,8 +57,7 @@ func ServerInfo(c *gin.Context) {
|
|||||||
cpuDic["cpuInfo"],_ = cpu.Info()
|
cpuDic["cpuInfo"],_ = cpu.Info()
|
||||||
percent,_ := cpu.Percent(0,false)
|
percent,_ := cpu.Percent(0,false)
|
||||||
cpuDic["Percent"] = fmt.Sprintf("%.2f",percent[0])
|
cpuDic["Percent"] = fmt.Sprintf("%.2f",percent[0])
|
||||||
|
cpuDic["cpuNum"], _ = cpu.Counts(false)
|
||||||
|
|
||||||
|
|
||||||
app.Custum(c, gin.H{
|
app.Custum(c, gin.H{
|
||||||
"code": 200,
|
"code": 200,
|
||||||
|
|||||||
+45
-19
@@ -1,30 +1,56 @@
|
|||||||
settings:
|
settings:
|
||||||
application:
|
application:
|
||||||
enabledp: true
|
# dev开发环境 test测试环境 prod线上环境
|
||||||
host: 0.0.0.0
|
|
||||||
mode: dev
|
mode: dev
|
||||||
|
# 服务器ip,默认使用 0.0.0.0
|
||||||
|
host: 0.0.0.0
|
||||||
|
# 服务名称
|
||||||
name: testApp
|
name: testApp
|
||||||
port: 8000
|
# 端口号
|
||||||
|
port: 8000 # 服务端口号
|
||||||
readtimeout: 1
|
readtimeout: 1
|
||||||
writertimeout: 2
|
writertimeout: 2
|
||||||
database:
|
# 数据权限功能开关
|
||||||
driver: mysql
|
enabledp: false
|
||||||
source: root:123456@tcp(127.0.0.1:3306)/goplus?charset=utf8&parseTime=True&loc=Local&timeout=1000ms
|
|
||||||
gen:
|
|
||||||
dbname: goplus
|
|
||||||
frontpath: ../web/src
|
|
||||||
jwt:
|
|
||||||
secret: goplus
|
|
||||||
timeout: 3600
|
|
||||||
logger:
|
|
||||||
enabledbus: false
|
|
||||||
enableddb: false
|
|
||||||
enabledreq: false
|
|
||||||
level: all
|
|
||||||
path: temp/logs
|
|
||||||
stdout: true
|
|
||||||
ssl:
|
ssl:
|
||||||
|
# https对应的域名
|
||||||
domain: localhost:8000
|
domain: localhost:8000
|
||||||
|
# https开关
|
||||||
enable: false
|
enable: false
|
||||||
|
# ssl 证书key
|
||||||
key: keystring
|
key: keystring
|
||||||
|
# ssl 证书路径
|
||||||
pem: temp/pem.pem
|
pem: temp/pem.pem
|
||||||
|
logger:
|
||||||
|
# 日志存放路径
|
||||||
|
path: temp/logs
|
||||||
|
# 控制台日志
|
||||||
|
stdout: true
|
||||||
|
# 日志等级
|
||||||
|
level: all
|
||||||
|
# 业务日志开关
|
||||||
|
enabledbus: false
|
||||||
|
# 请求日志开关
|
||||||
|
enabledreq: false
|
||||||
|
# 数据库日志开关 dev模式,将自动开启
|
||||||
|
enableddb: false
|
||||||
|
# 自动任务日志开关 dev模式,将自动开启
|
||||||
|
enabledjob: false
|
||||||
|
jwt:
|
||||||
|
# token 密钥,生产环境时及的修改
|
||||||
|
secret: go-admin
|
||||||
|
# token 过期时间 单位:秒
|
||||||
|
timeout: 3600
|
||||||
|
database:
|
||||||
|
# 数据库类型 mysql,sqlite3, postgres
|
||||||
|
driver: mysql
|
||||||
|
# 数据库连接字符串 mysql 缺省信息 charset=utf8&parseTime=True&loc=Local&timeout=1000ms
|
||||||
|
source: user:password@tcp(127.0.0.1:3306)/dbname?charset=utf8&parseTime=True&loc=Local&timeout=1000ms
|
||||||
|
# source: sqlite3.db
|
||||||
|
# source: host=myhost port=myport user=gorm dbname=gorm password=mypassword
|
||||||
|
gen:
|
||||||
|
# 代码生成读取的数据库名称
|
||||||
|
dbname: dbname
|
||||||
|
# 代码生成是使用前端代码存放位置,需要指定到src文件夹,相对路径
|
||||||
|
frontpath: ../go-admin-ui/src
|
||||||
|
>>>>>>> c396f318ef0649f7231b8ee7b2a70d26159c19c2
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ func sysNoCheckRoleRouter(r *gin.RouterGroup) {
|
|||||||
registerPublicRouter(v1)
|
registerPublicRouter(v1)
|
||||||
|
|
||||||
registerSysSettingRouter(v1)
|
registerSysSettingRouter(v1)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func registerDBRouter(api *gin.RouterGroup) {
|
func registerDBRouter(api *gin.RouterGroup) {
|
||||||
@@ -258,7 +257,6 @@ func registerDeptRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddlewar
|
|||||||
dept.DELETE("/:id", system.DeleteDept)
|
dept.DELETE("/:id", system.DeleteDept)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func registerSysSettingRouter(v1 *gin.RouterGroup) {
|
func registerSysSettingRouter(v1 *gin.RouterGroup) {
|
||||||
setting := v1.Group("/setting")
|
setting := v1.Group("/setting")
|
||||||
{
|
{
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 60 KiB |
Reference in New Issue
Block a user