Browse Source
Merge branch 'develop' into feature/docker-support
main
rikugun
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
24 additions and
20 deletions
-
README-zh_CN.md
-
README.md
-
server/initialize/sqlite.go
-
server/main.go
|
@ -180,7 +180,7 @@ go run main.go; |
|
|
- 配置管理:配置文件可前台修改(测试环境不开放此功能)。 |
|
|
- 配置管理:配置文件可前台修改(测试环境不开放此功能)。 |
|
|
- 富文本编辑器:MarkDown编辑器功能嵌入。 |
|
|
- 富文本编辑器:MarkDown编辑器功能嵌入。 |
|
|
- 条件搜索:增加条件搜索示例。 |
|
|
- 条件搜索:增加条件搜索示例。 |
|
|
- restful示例:参考客户管理功能,customer组api。 |
|
|
|
|
|
|
|
|
- restful示例:可以参考用户管理模块中的示例API。 |
|
|
``` |
|
|
``` |
|
|
前端文件参考: src\view\superAdmin\api\api.vue |
|
|
前端文件参考: src\view\superAdmin\api\api.vue |
|
|
后台文件参考: model\dnModel\api.go |
|
|
后台文件参考: model\dnModel\api.go |
|
|
|
@ -177,7 +177,7 @@ go run main.go; |
|
|
- Configuration management: The configuration file can be modified in the web page (the test environment does not provide this function). |
|
|
- Configuration management: The configuration file can be modified in the web page (the test environment does not provide this function). |
|
|
- Rich text editor: Embed MarkDown editor function. |
|
|
- Rich text editor: Embed MarkDown editor function. |
|
|
- Conditional search: Add an example of conditional search. |
|
|
- Conditional search: Add an example of conditional search. |
|
|
- Restful example: refer to customer management function and apidcustomer group. |
|
|
|
|
|
|
|
|
- Restful example: You can see sample APIs in user management module. |
|
|
|
|
|
|
|
|
``` |
|
|
``` |
|
|
fontend code file: src\view\superAdmin\api\api.vue |
|
|
fontend code file: src\view\superAdmin\api\api.vue |
|
|
|
@ -1,19 +1,23 @@ |
|
|
package initialize |
|
|
package initialize |
|
|
|
|
|
|
|
|
import ( |
|
|
|
|
|
"fmt" |
|
|
|
|
|
"gin-vue-admin/global" |
|
|
|
|
|
"github.com/jinzhu/gorm" |
|
|
|
|
|
_ "github.com/jinzhu/gorm/dialects/sqlite" |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
// sqlite需要gcc支持 windows用户需要自行安装gcc 如需使用打开注释即可
|
|
|
|
|
|
|
|
|
//初始化数据库并产生数据库全局变量
|
|
|
|
|
|
func Sqlite() { |
|
|
|
|
|
admin := global.GVA_CONFIG.Sqlite |
|
|
|
|
|
if db, err := gorm.Open("sqlite3", fmt.Sprintf("%s?%s", admin.Path,admin.Config)); err != nil { |
|
|
|
|
|
global.GVA_LOG.Error("DEFAULT DB数据库启动异常", err) |
|
|
|
|
|
} else { |
|
|
|
|
|
global.GVA_DB = db |
|
|
|
|
|
global.GVA_DB.LogMode(admin.LogMode) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 感谢 sqlitet提供者 [rikugun] 作者github: https://github.com/rikugun
|
|
|
|
|
|
|
|
|
|
|
|
//import (
|
|
|
|
|
|
// "fmt"
|
|
|
|
|
|
// "gin-vue-admin/global"
|
|
|
|
|
|
// "github.com/jinzhu/gorm"
|
|
|
|
|
|
// _ "github.com/jinzhu/gorm/dialects/sqlite"
|
|
|
|
|
|
//)
|
|
|
|
|
|
//
|
|
|
|
|
|
////初始化数据库并产生数据库全局变量
|
|
|
|
|
|
//func Sqlite() {
|
|
|
|
|
|
// admin := global.GVA_CONFIG.Sqlite
|
|
|
|
|
|
// if db, err := gorm.Open("sqlite3", fmt.Sprintf("%s?%s", admin.Path,admin.Config)); err != nil {
|
|
|
|
|
|
// global.GVA_LOG.Error("DEFAULTDB数据库启动异常", err)
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
// global.GVA_DB = db
|
|
|
|
|
|
// global.GVA_DB.LogMode(admin.LogMode)
|
|
|
|
|
|
// }
|
|
|
|
|
|
//}
|
|
@ -11,8 +11,8 @@ func main() { |
|
|
switch global.GVA_CONFIG.System.DbType { |
|
|
switch global.GVA_CONFIG.System.DbType { |
|
|
case "mysql": |
|
|
case "mysql": |
|
|
initialize.Mysql() |
|
|
initialize.Mysql() |
|
|
case "sqlite": |
|
|
|
|
|
initialize.Sqlite() |
|
|
|
|
|
|
|
|
//case "sqlite":
|
|
|
|
|
|
// initialize.Sqlite() // sqlite需要gcc支持 windows用户需要自行安装gcc 如需使用打开注释即可
|
|
|
default: |
|
|
default: |
|
|
initialize.Mysql() |
|
|
initialize.Mysql() |
|
|
} |
|
|
} |
|
|