diff --git a/.gitignore b/.gitignore index 1dd3955..ce6fd6b 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ cmd/migrate/migration/version-local/* # go sum go.sum +config/settings.deva.yml diff --git a/README.en.md b/README.en.md index 6e997ba..3be1777 100644 --- a/README.en.md +++ b/README.en.md @@ -23,6 +23,10 @@ - GORM-based database storage that can expand many types of databases - Simple model mapping of configuration files to quickly get the desired configuration + +- Form builder + +- Multi command mode - TODO: unit test @@ -39,102 +43,89 @@ 8. Operation log: system normal operation log record and query; system exception information log record and query. 9. Login log: The system login log record query contains login exceptions. 10. System interface: Automatically generate related api interface documents according to business code. +11. Multi command mode code generation: according to the data table structure to generate the corresponding business, all visual programming, basic business can be 0 code. +12. Form construction: Customize page style, drag and drop to achieve page layout. +13. Service monitoring: view the basic information of some servers. -## Configuration details +## 🗞 System architecture -1. Configuration file description -```yml -settings: - application: - # Project launch environment - env: dev - # When env: demo, prompts for request operations other than GET - envmsg: "谢谢您的参与,但为了大家更好的体验,所以本次提交就算了吧!" - # Host IP or domain name, default 0.0.0.0 - host: 0.0.0.0 - # Whether to initialize the database structure and basic data; true: required; false: not required - isinit: false - # JWT encrypted string - jwtsecret: 123abc - # log storage path - logpath: temp/logs/log.log - # application name - name: go-admin - # application port - port: 8000 - readtimeout: 1 - writertimeout: 2 - database: - # database name - database: dbname - # database type - dbtype: mysql - # database host - host: 127.0.0.1 - # database password - password: password - # database port - port: 3306 - # database username - username: root - redis: - # redis addresss - addr: 0.0.0.0:6379 - # db - db: 0 - # password - password: password - # read timeout - readtimeout: 50 -``` +
+
+
![]() |
+ ![]() |
+ ![]() |
+
| This QQ group is full | +![]() |
+
+
+
## 🤝 Open source projects used
@@ -169,20 +205,10 @@ Demo address:[http://www.zhangwj.com](http://www.zhangwj.com/#/login)
-## Version
-
-#### 2020-03-15 New Features and Optimization
-
-1. Add user avatar upload
-2. Add user password modification
-3. Operation log page adjustment
-4. Optimize captcha background color
-
-I saw a lot of friends who experience the wrong verification code, so I adjusted the contrast for everyone to experience!
-
## 🤝 Thanks
-[chengxiao](https://github.com/chengxiao)
+2. [chengxiao](https://github.com/chengxiao)
+
## License
@@ -191,4 +217,4 @@ I saw a lot of friends who experience the wrong verification code, so I adjusted
Copyright (c) 2020 wenjianzhang
-[中文]qq technical exchange group: 74520518
+[中文]qq technical exchange group: 74520518
\ No newline at end of file
diff --git a/README.md b/README.md
index f63b7e2..0af523d 100644
--- a/README.md
+++ b/README.md
@@ -182,10 +182,7 @@ docker run --name go-admin -p 8000:8000 -d go-admin
#### 文档生成
```bash
-swag init
-
-# 如果没有swag命令 go get安装一下即可
-go get -u github.com/swaggo/swag/cmd/swag
+go generate
```
#### 交叉编译
diff --git a/app/admin/middleware/init.go b/app/admin/middleware/init.go
index 08486be..54dfc8a 100644
--- a/app/admin/middleware/init.go
+++ b/app/admin/middleware/init.go
@@ -21,4 +21,4 @@ func InitMiddleware(r *gin.Engine) {
r.Use(Secure)
// 链路追踪
//r.Use(middleware.Trace())
-}
+}
\ No newline at end of file
diff --git a/app/admin/models/syschinaareadata.go b/app/admin/models/syschinaareadata.go
index 13d7c8b..019b041 100644
--- a/app/admin/models/syschinaareadata.go
+++ b/app/admin/models/syschinaareadata.go
@@ -2,18 +2,15 @@ package models
import (
"go-admin/common/models"
- "time"
)
type SysChinaAreaData struct {
models.Model
- models.ControlBy
PId string `json:"pId" gorm:"type:int(11);comment:上级编码"`
Name string `json:"name" gorm:"type:varchar(128);comment:名称"`
- CreateTime time.Time `json:"createTime" gorm:"type:timestamp;comment:CreateTime"`
- UpdateTime time.Time `json:"updateTime" gorm:"type:timestamp;comment:UpdateTime"`
- DeleteTime time.Time `json:"deleteTime" gorm:"type:timestamp;comment:DeleteTime"`
+ models.ControlBy
+ models.ModelTime
}
func (SysChinaAreaData) TableName() string {
@@ -27,4 +24,4 @@ func (e *SysChinaAreaData) Generate() models.ActiveRecord {
func (e *SysChinaAreaData) GetId() interface{} {
return e.Id
-}
+}
\ No newline at end of file
diff --git a/app/admin/service/dto/syschinaareadata.go b/app/admin/service/dto/syschinaareadata.go
index e236975..773571e 100644
--- a/app/admin/service/dto/syschinaareadata.go
+++ b/app/admin/service/dto/syschinaareadata.go
@@ -59,9 +59,6 @@ func (s *SysChinaAreaDataControl) Generate() (*models.SysChinaAreaData, error) {
Model: common.Model{Id: s.Id},
PId: s.PId,
Name: s.Name,
- CreateTime: s.CreateTime,
- UpdateTime: s.UpdateTime,
- DeleteTime: s.DeleteTime,
}, nil
}
@@ -98,4 +95,4 @@ func (s *SysChinaAreaDataById) Bind(ctx *gin.Context) error {
func (s *SysChinaAreaDataById) SetUpdateBy(id int) {
-}
+}
\ No newline at end of file
diff --git a/cmd/migrate/migration/version/1615948084336_migrate.go b/cmd/migrate/migration/version/1615948084336_migrate.go
index 5bd4617..72741cc 100644
--- a/cmd/migrate/migration/version/1615948084336_migrate.go
+++ b/cmd/migrate/migration/version/1615948084336_migrate.go
@@ -3,6 +3,7 @@ package version
import (
"gorm.io/gorm"
"runtime"
+ "strings"
"go-admin/cmd/migrate/migration"
common "go-admin/common/models"
@@ -17,7 +18,7 @@ func _1615948084336Test(db *gorm.DB, version string) error {
return db.Transaction(func(tx *gorm.DB) error {
err := tx.Exec("alter table sys_config add is_frontend int default 1 null comment '是否前台参数' after config_type").Error
- if err != nil {
+ if err != nil && !strings.Contains(err.Error(),"Duplicate column name 'is_frontend'") {
return err
}
@@ -25,4 +26,4 @@ func _1615948084336Test(db *gorm.DB, version string) error {
Version: version,
}).Error
})
-}
+}
\ No newline at end of file
diff --git a/docs/docs.go b/docs/docs.go
index 72cd100..63e03d1 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -1866,8 +1866,15 @@ var doc = `{
"definitions": {
"dto.PassWord": {
"type": "object",
+ "required": [
+ "newPassword",
+ "oldPassword"
+ ],
"properties": {
- "password": {
+ "newPassword": {
+ "type": "string"
+ },
+ "oldPassword": {
"type": "string"
}
}
diff --git a/docs/swagger.json b/docs/swagger.json
index cd81964..314ccfa 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -1849,8 +1849,15 @@
"definitions": {
"dto.PassWord": {
"type": "object",
+ "required": [
+ "newPassword",
+ "oldPassword"
+ ],
"properties": {
- "password": {
+ "newPassword": {
+ "type": "string"
+ },
+ "oldPassword": {
"type": "string"
}
}
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index b9377fe..15724fc 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -1,8 +1,13 @@
definitions:
dto.PassWord:
properties:
- password:
+ newPassword:
type: string
+ oldPassword:
+ type: string
+ required:
+ - newPassword
+ - oldPassword
type: object
dto.SysDeptById:
properties:
diff --git a/main.go b/main.go
index e9a81a9..0e874dd 100644
--- a/main.go
+++ b/main.go
@@ -18,4 +18,4 @@ import (
// @name Authorization
func main() {
cmd.Execute()
-}
+}
\ No newline at end of file