diff --git a/.github/workflows/mirror.yaml b/.github/workflows/mirror.yaml new file mode 100644 index 0000000..8768198 --- /dev/null +++ b/.github/workflows/mirror.yaml @@ -0,0 +1,17 @@ +name: 'GitHub Actions Mirror' + +on: [push, delete] + +jobs: + mirror_to_gitee: + runs-on: ubuntu-latest + steps: + - name: 'Checkout' + uses: actions/checkout@v1 + - name: 'Mirror to gitee' + uses: pixta-dev/repository-mirroring-action@v1 + with: + target_repo_url: + git@gitee.com:nicelizhi/easy-admin.git + ssh_private_key: + ${{ secrets.GITEE_KEY }} diff --git a/Makefile b/Makefile index b57ffad..4b03990 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,17 @@ export PATH := $(GOPATH)/bin:$(PATH) export GO111MODULE=on +GOCMD=go +GOBUILD=$(GOCMD) build +GOTEST=$(GOCMD) test +GOCLEAN=$(GOCMD) clean +GOGET=$(GOCMD) get LDFLAGS := -s -w +# application name PROJECT:=easy-admin - +# application version +VERSION := 1.2.0 +# application url +URL := https://github.com/nicelizhi/easy-admin .PHONY: build @@ -10,17 +19,45 @@ all: make build-ui make build +# build vue ui build-ui: @echo "build node start" cd ./ui/ && npm run build:prod +# build go application build: - CGO_ENABLED=0 go build -ldflags="$(LDFLAGS)" -a -installsuffix "" -o easy-admin . + CGO_ENABLED=0 go build -ldflags="$(LDFLAGS)" -a -installsuffix "" -o $(PROJECT) . # make build-linux build-linux: - @docker build -t easy-admin:latest . + make build-ui + make build + @docker build -t $(PROJECT):$(VERSION) . @echo "build successful" +# build sql go application version build-sqlite: - go build -tags sqlite3 -ldflags="$(LDFLAGS)" -a -installsuffix -o easy-admin . + go build -tags sqlite3 -ldflags="$(LDFLAGS)" -a -installsuffix -o $(PROJECT) . + +clean: + $(GOCLEAN) + rm ./$(PROJECT) + +test: + $(GOTEST) + +restart: + make stop + make start + +.PHONY: start +start: + nohup ./$(PROJECT) server -c=config/settings.dev_steve.yml >> acc.txt & + ps aux | grep "$(PROJECT)" + +stop: + pkill $(PROJECT) + +# debug file +debug: + dlv debug $(file) \ No newline at end of file diff --git a/app/admin/apis/go_admin.go b/app/admin/apis/easy_admin.go similarity index 75% rename from app/admin/apis/go_admin.go rename to app/admin/apis/easy_admin.go index 5673897..cba8efe 100644 --- a/app/admin/apis/go_admin.go +++ b/app/admin/apis/easy_admin.go @@ -6,12 +6,11 @@ import ( "github.com/gin-gonic/gin" ) -func GoAdmin(c *gin.Context) { +func EasyAdminStart(c *gin.Context) { c.Header("Content-Type", "text/html; charset=utf-8") c.String(200, string(resource.Html)) } func Favicon(c *gin.Context) { - //c.Header("Content-Type", "text/html; charset=utf-8") c.String(200, string(resource.Favicon)) } diff --git a/app/admin/models/model.go b/app/admin/models/model.go index 4a1c439..c057fd5 100644 --- a/app/admin/models/model.go +++ b/app/admin/models/model.go @@ -2,10 +2,12 @@ package models import ( "time" + + "gorm.io/plugin/soft_delete" ) type BaseModel struct { - CreatedAt time.Time `json:"createdAt"` - UpdatedAt time.Time `json:"updatedAt"` - DeletedAt *time.Time `json:"deletedAt"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` + DeletedAt soft_delete.DeletedAt `json:"deletedAt"` } diff --git a/app/admin/router/sys_router.go b/app/admin/router/sys_router.go index fd64579..c3b9ae9 100644 --- a/app/admin/router/sys_router.go +++ b/app/admin/router/sys_router.go @@ -92,7 +92,7 @@ func sysBaseRouter(r *gin.RouterGroup) { go ws.WebsocketManager.SendAllService() if config.ApplicationConfig.Mode != "prod" { - r.GET("/", apis.GoAdmin) + r.GET("/", apis.EasyAdminStart) r.GET("/favicon.ico", apis.Favicon) r.StaticFS("/css", http.FS(CssResource())) diff --git a/app/admin/service/sys_api.go b/app/admin/service/sys_api.go index cc560e7..1731c4f 100644 --- a/app/admin/service/sys_api.go +++ b/app/admin/service/sys_api.go @@ -79,7 +79,7 @@ func (e *SysApi) Update(c *dto.SysApiUpdateReq, p *actions.DataPermission) error var model = models.SysApi{} db := e.Orm.Debug().First(&model, c.GetId()) if db.RowsAffected == 0 { - return errors.New("无权更新该数据") + return errors.New("do not have permission to update this data") } c.Generate(&model) db = e.Orm.Save(&model) @@ -104,7 +104,7 @@ func (e *SysApi) Remove(d *dto.SysApiDeleteReq, p *actions.DataPermission) error return err } if db.RowsAffected == 0 { - return errors.New("无权删除该数据") + return errors.New("no right to delete this data") } return nil } diff --git a/app/admin/service/sys_config.go b/app/admin/service/sys_config.go index 3160af3..cbe9c2e 100644 --- a/app/admin/service/sys_config.go +++ b/app/admin/service/sys_config.go @@ -73,7 +73,7 @@ func (e *SysConfig) Update(c *dto.SysConfigControl) error { return err } if db.RowsAffected == 0 { - return errors.New("无权更新该数据") + return errors.New("do not have permission to update this data") } return nil @@ -94,7 +94,7 @@ func (e *SysConfig) SetSysConfig(c *[]dto.GetSetSysConfigReq) error { return err } if db.RowsAffected == 0 { - return errors.New("无权更新该数据") + return errors.New("do not have permission to update this data") } } } @@ -149,7 +149,7 @@ func (e *SysConfig) Remove(d *dto.SysConfigDeleteReq) error { return err } if db.RowsAffected == 0 { - err = errors.New("无权删除该数据") + err = errors.New("no right to delete this data") return err } return nil diff --git a/app/admin/service/sys_dept.go b/app/admin/service/sys_dept.go index b7f890a..8cb323e 100644 --- a/app/admin/service/sys_dept.go +++ b/app/admin/service/sys_dept.go @@ -122,7 +122,7 @@ func (e *SysDept) Update(c *dto.SysDeptUpdateReq) error { return err } if db.RowsAffected == 0 { - return errors.New("无权更新该数据") + return errors.New("do not have permission to update this data") } return nil } @@ -139,7 +139,7 @@ func (e *SysDept) Remove(d *dto.SysDeptDeleteReq) error { return err } if db.RowsAffected == 0 { - err = errors.New("无权删除该数据") + err = errors.New("no right to delete this data") return err } return nil diff --git a/app/admin/service/sys_dict_data.go b/app/admin/service/sys_dict_data.go index 8ee8017..b0961c4 100644 --- a/app/admin/service/sys_dict_data.go +++ b/app/admin/service/sys_dict_data.go @@ -80,7 +80,7 @@ func (e *SysDictData) Update(c *dto.SysDictDataUpdateReq) error { return err } if db.RowsAffected == 0 { - return errors.New("无权更新该数据") + return errors.New("do not have permission to update this data") } return nil @@ -98,7 +98,7 @@ func (e *SysDictData) Remove(c *dto.SysDictDataDeleteReq) error { return err } if db.RowsAffected == 0 { - err = errors.New("无权删除该数据") + err = errors.New("no right to delete this data") return err } return nil diff --git a/app/admin/service/sys_dict_type.go b/app/admin/service/sys_dict_type.go index a568f1e..8e26a27 100644 --- a/app/admin/service/sys_dict_type.go +++ b/app/admin/service/sys_dict_type.go @@ -84,7 +84,7 @@ func (e *SysDictType) Update(c *dto.SysDictTypeUpdateReq) error { return err } if db.RowsAffected == 0 { - return errors.New("无权更新该数据") + return errors.New("do not have permission to update this data") } return nil @@ -102,7 +102,7 @@ func (e *SysDictType) Remove(d *dto.SysDictTypeDeleteReq) error { return err } if db.RowsAffected == 0 { - err = errors.New("无权删除该数据") + err = errors.New("no right to delete this data") return err } return nil diff --git a/app/admin/service/sys_login_log.go b/app/admin/service/sys_login_log.go index 4b6cc97..d3ebced 100644 --- a/app/admin/service/sys_login_log.go +++ b/app/admin/service/sys_login_log.go @@ -64,7 +64,7 @@ func (e *SysLoginLog) Remove(c *dto.SysLoginLogDeleteReq) error { return err } if db.RowsAffected == 0 { - err = errors.New("无权删除该数据") + err = errors.New("no right to delete this data") return err } return nil diff --git a/app/admin/service/sys_menu.go b/app/admin/service/sys_menu.go index d939733..498be6b 100644 --- a/app/admin/service/sys_menu.go +++ b/app/admin/service/sys_menu.go @@ -174,7 +174,7 @@ func (e *SysMenu) Update(c *dto.SysMenuUpdateReq) *SysMenu { return e } if db.RowsAffected == 0 { - _ = e.AddError(errors.New("无权更新该数据")) + _ = e.AddError(errors.New("do not have permission to update this data")) return e } var menuList []models.SysMenu @@ -198,7 +198,7 @@ func (e *SysMenu) Remove(d *dto.SysMenuDeleteReq) *SysMenu { _ = e.AddError(err) } if db.RowsAffected == 0 { - err = errors.New("无权删除该数据") + err = errors.New("no right to delete this data") _ = e.AddError(err) } return e @@ -397,7 +397,7 @@ func (e *SysMenu) getByRoleName(roleName string) ([]models.SysMenu, error) { data := make([]models.SysMenu, 0) if roleName == "admin" { - err = e.Orm.Where(" menu_type in ('M','C') and deleted_at is null"). + err = e.Orm.Where(" menu_type in ('M','C') and deleted_at = 0"). Order("sort"). Find(&data). Error diff --git a/app/admin/service/sys_opera_log.go b/app/admin/service/sys_opera_log.go index 3b9ad70..097424a 100644 --- a/app/admin/service/sys_opera_log.go +++ b/app/admin/service/sys_opera_log.go @@ -78,7 +78,7 @@ func (e *SysOperaLog) Remove(d *dto.SysOperaLogDeleteReq) error { return err } if db.RowsAffected == 0 { - return errors.New("无权删除该数据") + return errors.New("no right to delete this data") } return nil } diff --git a/app/admin/service/sys_post.go b/app/admin/service/sys_post.go index 8b949c7..e8cbd17 100644 --- a/app/admin/service/sys_post.go +++ b/app/admin/service/sys_post.go @@ -81,7 +81,7 @@ func (e *SysPost) Update(c *dto.SysPostUpdateReq) error { return err } if db.RowsAffected == 0 { - return errors.New("无权更新该数据") + return errors.New("do not have permission to update this data") } return nil @@ -99,7 +99,7 @@ func (e *SysPost) Remove(d *dto.SysPostDeleteReq) error { return err } if db.RowsAffected == 0 { - err = errors.New("无权删除该数据") + err = errors.New("no right to delete this data") return err } return nil diff --git a/app/admin/service/sys_role.go b/app/admin/service/sys_role.go index a7654d8..5917b6a 100644 --- a/app/admin/service/sys_role.go +++ b/app/admin/service/sys_role.go @@ -162,7 +162,7 @@ func (e *SysRole) Update(c *dto.SysRoleUpdateReq, cb *casbin.SyncedEnforcer) err return err } if db.RowsAffected == 0 { - return errors.New("无权更新该数据") + return errors.New("do not have permission to update this data") } // 清除 sys_casbin_rule 权限表里 当前角色的所有记录 @@ -218,7 +218,7 @@ func (e *SysRole) Remove(c *dto.SysRoleDeleteReq, cb *casbin.SyncedEnforcer) err return err } if db.RowsAffected == 0 { - return errors.New("无权更新该数据") + return errors.New("do not have permission to update this data") } // 清除 sys_casbin_rule 权限表里 当前角色的所有记录 @@ -276,7 +276,7 @@ func (e *SysRole) UpdateDataScope(c *dto.RoleDataScopeReq) *SysRole { return e } if db.RowsAffected == 0 { - _ = e.AddError(errors.New("无权更新该数据")) + _ = e.AddError(errors.New("do not have permission to update this data")) return e } return e @@ -306,7 +306,7 @@ func (e *SysRole) UpdateStatus(c *dto.UpdateStatusReq) error { return err } if db.RowsAffected == 0 { - return errors.New("无权更新该数据") + return errors.New("do not have permission to update this data") } return nil } diff --git a/app/admin/service/sys_user.go b/app/admin/service/sys_user.go index ca61165..ff19365 100644 --- a/app/admin/service/sys_user.go +++ b/app/admin/service/sys_user.go @@ -97,7 +97,7 @@ func (e *SysUser) Update(c *dto.SysUserUpdateReq, p *actions.DataPermission) err return err } if db.RowsAffected == 0 { - return errors.New("无权更新该数据") + return errors.New("do not have permission to update this data") } c.Generate(&model) @@ -126,7 +126,7 @@ func (e *SysUser) UpdateAvatar(c *dto.UpdateSysUserAvatarReq, p *actions.DataPer return err } if db.RowsAffected == 0 { - return errors.New("无权更新该数据") + return errors.New("do not have permission to update this data") } err = e.Orm.Table(model.TableName()).Where("user_id =? ", c.UserId).Updates(c).Error @@ -149,7 +149,7 @@ func (e *SysUser) UpdateStatus(c *dto.UpdateSysUserStatusReq, p *actions.DataPer return err } if db.RowsAffected == 0 { - return errors.New("无权更新该数据") + return errors.New("don not have permission to update this data") } err = e.Orm.Table(model.TableName()).Where("user_id =? ", c.UserId).Updates(c).Error @@ -172,7 +172,7 @@ func (e *SysUser) ResetPwd(c *dto.ResetSysUserPwdReq, p *actions.DataPermission) return err } if db.RowsAffected == 0 { - return errors.New("无权更新该数据") + return errors.New("do not have permission to update this data") } c.Generate(&model) err = e.Orm.Omit("username", "nick_name", "phone", "role_id", "avatar", "sex").Save(&model).Error @@ -197,7 +197,7 @@ func (e *SysUser) Remove(c *dto.SysUserById, p *actions.DataPermission) error { return err } if db.RowsAffected == 0 { - return errors.New("无权删除该数据") + return errors.New("no right to delete this data") } return nil } @@ -218,7 +218,7 @@ func (e *SysUser) UpdatePwd(id int, oldPassword, newPassword string, p *actions. First(c, id).Error if err != nil { if errors.Is(err, gorm.ErrRecordNotFound) { - return errors.New("无权更新该数据") + return errors.New("do not have permission to update this data") } e.Log.Errorf("db error: %s", err) return err diff --git a/cmd/cobra.go b/cmd/cobra.go index 926f1e9..9a4cb84 100644 --- a/cmd/cobra.go +++ b/cmd/cobra.go @@ -9,6 +9,7 @@ import ( "github.com/nicelizhi/easy-admin/cmd/app" "github.com/nicelizhi/easy-admin/cmd/autocert" + "github.com/nicelizhi/easy-admin/cmd/creatuser" "github.com/nicelizhi/easy-admin/common/global" "github.com/spf13/cobra" @@ -18,6 +19,7 @@ import ( "github.com/nicelizhi/easy-admin/cmd/version" ) +// @link https://github.com/spf13/cobra/blob/main/site/content/user_guide.md var rootCmd = &cobra.Command{ Use: "easy-admin", Short: "easy-admin", @@ -47,6 +49,7 @@ func init() { rootCmd.AddCommand(version.StartCmd) rootCmd.AddCommand(app.StartCmd) rootCmd.AddCommand(autocert.StartCmd) + rootCmd.AddCommand(creatuser.StartCmd) } // Execute : apply commands diff --git a/cmd/creatuser/server.go b/cmd/creatuser/server.go new file mode 100644 index 0000000..0fd53a1 --- /dev/null +++ b/cmd/creatuser/server.go @@ -0,0 +1,65 @@ +package creatuser + +import ( + "fmt" + + "github.com/nicelizhi/easy-admin-core/config/source/file" + "github.com/nicelizhi/easy-admin-core/sdk" + "github.com/nicelizhi/easy-admin-core/sdk/config" + "github.com/nicelizhi/easy-admin-core/sdk/service" + "github.com/nicelizhi/easy-admin/app/admin/models" + "github.com/nicelizhi/easy-admin/common/database" + "github.com/spf13/cobra" +) + +type SysUser struct { + service.Service +} + +var ( + configYml string + host string + StartCmd = &cobra.Command{ + Use: "creatuser", + Short: "create user", + Example: "easy-admin createuser -c config/settings.yml", + RunE: func(cmd *cobra.Command, args []string) error { + return run() + }, + } +) + +func init() { + StartCmd.PersistentFlags().StringVarP(&configYml, "config", "c", "config/settings.yml", "Start server with provided configuration file") +} + +func run() error { + config.Setup( + file.NewSource(file.WithPath(configYml)), + initDB, + ) + if host == "" { + host = "*" + } + db := sdk.Runtime.GetDbByKey(host) + + var model *models.SysUser + + var username = "admin" + //var defaultpass = "admin" + + row := db.Debug().Where("username = ?", username).First(&model) + + if row.Error != nil { + fmt.Println(row.Error) + return nil + } + + fmt.Println(row.RowsAffected) + + return nil +} + +func initDB() { + database.Setup() +} diff --git a/cmd/migrate/migration/models/by.go b/cmd/migrate/migration/models/by.go index c9dd906..1f59dfc 100644 --- a/cmd/migrate/migration/models/by.go +++ b/cmd/migrate/migration/models/by.go @@ -3,7 +3,7 @@ package models import ( "time" - "gorm.io/gorm" + "gorm.io/plugin/soft_delete" ) type ControlBy struct { @@ -16,7 +16,7 @@ type Model struct { } type ModelTime struct { - CreatedAt time.Time `json:"createdAt" gorm:"comment:创建时间"` - UpdatedAt time.Time `json:"updatedAt" gorm:"comment:最后更新时间"` - DeletedAt gorm.DeletedAt `json:"-" gorm:"index;comment:删除时间"` + CreatedAt time.Time `json:"createdAt" gorm:"comment:创建时间"` + UpdatedAt time.Time `json:"updatedAt" gorm:"comment:最后更新时间"` + DeletedAt soft_delete.DeletedAt `json:"-" gorm:"index;comment:flag"` } diff --git a/cmd/migrate/migration/models/model.go b/cmd/migrate/migration/models/model.go index 4a1c439..c057fd5 100644 --- a/cmd/migrate/migration/models/model.go +++ b/cmd/migrate/migration/models/model.go @@ -2,10 +2,12 @@ package models import ( "time" + + "gorm.io/plugin/soft_delete" ) type BaseModel struct { - CreatedAt time.Time `json:"createdAt"` - UpdatedAt time.Time `json:"updatedAt"` - DeletedAt *time.Time `json:"deletedAt"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` + DeletedAt soft_delete.DeletedAt `json:"deletedAt"` } diff --git a/cmd/migrate/server.go b/cmd/migrate/server.go index b81f72c..ca2aade 100644 --- a/cmd/migrate/server.go +++ b/cmd/migrate/server.go @@ -24,7 +24,7 @@ import ( var ( configYml string generate bool - goAdmin bool + EasyAdmin bool host string StartCmd = &cobra.Command{ Use: "migrate", @@ -40,7 +40,7 @@ var ( func init() { StartCmd.PersistentFlags().StringVarP(&configYml, "config", "c", "config/settings.yml", "Start server with provided configuration file") StartCmd.PersistentFlags().BoolVarP(&generate, "generate", "g", false, "generate migration file") - StartCmd.PersistentFlags().BoolVarP(&goAdmin, "goAdmin", "a", false, "generate easy-admin migration file") + StartCmd.PersistentFlags().BoolVarP(&EasyAdmin, "EasyAdmin", "e", false, "generate easy-admin migration file") StartCmd.PersistentFlags().StringVarP(&host, "domain", "d", "*", "select tenant host") } @@ -48,7 +48,7 @@ func run() { if !generate { fmt.Println(`start init`) - //1. 读取配置 + //1. read the config config.Setup( file.NewSource(file.WithPath(configYml)), initDB, @@ -65,7 +65,7 @@ func migrateModel() error { } db := sdk.Runtime.GetDbByKey(host) if config.DatabasesConfig[host].Driver == "mysql" { - //初始化数据库时候用 + // init db db.Set("gorm:table_options", "ENGINE=InnoDB CHARSET=utf8mb4") } err := db.Debug().AutoMigrate(&models.Migration{}) @@ -77,12 +77,12 @@ func migrateModel() error { return err } func initDB() { - //3. 初始化数据库链接 + //3. init db database.Setup() - //4. 数据库迁移 - fmt.Println("数据库迁移开始") + //4. migrate start + fmt.Println("start migrate ") _ = migrateModel() - fmt.Println(`数据库基础数据初始化成功`) + fmt.Println(`migrate done`) } func genFile() error { @@ -93,12 +93,15 @@ func genFile() error { m := map[string]string{} m["GenerateTime"] = strconv.FormatInt(time.Now().UnixNano()/1e6, 10) m["Package"] = "version_local" - if goAdmin { + if EasyAdmin { m["Package"] = "version" } var b1 bytes.Buffer err = t1.Execute(&b1, m) - if goAdmin { + if err != nil { + return err + } + if EasyAdmin { pkg.FileCreate(b1, "./cmd/migrate/migration/version/"+m["GenerateTime"]+"_migrate.go") } else { pkg.FileCreate(b1, "./cmd/migrate/migration/version-local/"+m["GenerateTime"]+"_migrate.go") diff --git a/common/actions/update.go b/common/actions/update.go index cf19fb4..9f3c469 100644 --- a/common/actions/update.go +++ b/common/actions/update.go @@ -52,7 +52,7 @@ func UpdateAction(control dto.Control) gin.HandlerFunc { return } if db.RowsAffected == 0 { - response.Error(c, http.StatusForbidden, nil, ginI18n.MustGetMessage(c, "Don not have permission to update this data")) + response.Error(c, http.StatusForbidden, nil, ginI18n.MustGetMessage(c, "do not have permission to update this data")) return } response.OK(c, object.GetId(), ginI18n.MustGetMessage(c, "Update completed")) diff --git a/common/global/adm.go b/common/global/adm.go index c98628b..a6ae9ae 100644 --- a/common/global/adm.go +++ b/common/global/adm.go @@ -2,8 +2,8 @@ package global const ( // Version easy-admin version info - Version = "1.1.0" - VersionNum = 110 // version number + Version = "1.2.0" + VersionNum = 120 // version number HomePage = "https://github.com/nicelizhi/easy-admin/" //project home page TemplateVer = "v1" ) diff --git a/common/middleware/demo.go b/common/middleware/demo.go deleted file mode 100644 index 30efe2f..0000000 --- a/common/middleware/demo.go +++ /dev/null @@ -1,31 +0,0 @@ -package middleware - -import ( - "net/http" - - "github.com/nicelizhi/easy-admin-core/sdk/config" - - "github.com/gin-gonic/gin" -) - -func DemoEvn() gin.HandlerFunc { - return func(c *gin.Context) { - method := c.Request.Method - if config.ApplicationConfig.Mode == "demo" { - if method == "GET" || - method == "OPTIONS" || - c.Request.RequestURI == "/api/v1/login" || - c.Request.RequestURI == "/api/v1/logout" { - c.Next() - } else { - c.JSON(http.StatusOK, gin.H{ - "code": 500, - "msg": "谢谢您的参与,但为了大家更好的体验,所以本次提交就算了吧!\U0001F600\U0001F600\U0001F600", - }) - c.Abort() - return - } - } - c.Next() - } -} diff --git a/common/middleware/init.go b/common/middleware/init.go index 2f0dfeb..aafd5fe 100644 --- a/common/middleware/init.go +++ b/common/middleware/init.go @@ -16,7 +16,6 @@ const ( ) func InitMiddleware(r *gin.Engine) { - r.Use(DemoEvn()) // 数据库链接 r.Use(WithContextDb) // 日志处理 diff --git a/common/middleware/permission.go b/common/middleware/permission.go index 3c40db6..a6b2a8f 100644 --- a/common/middleware/permission.go +++ b/common/middleware/permission.go @@ -23,7 +23,6 @@ func AuthCheckRole() gin.HandlerFunc { e := sdk.Runtime.GetCasbinKey(c.Request.Host) var res, casbinExclude bool var err error - //检查权限 if v["rolekey"] == "admin" { res = true c.Next() @@ -54,8 +53,7 @@ func AuthCheckRole() gin.HandlerFunc { log.Warnf("isTrue: %v role: %s method: %s path: %s message: %s", res, v["rolekey"], c.Request.Method, c.Request.URL.Path, ginI18n.MustGetMessage(c, "The current request does not have permission please check by the administrator")) c.JSON(http.StatusOK, gin.H{ "code": 403, - //"msg": "对不起,您没有该接口访问权限,请联系管理员", - "msg": ginI18n.MustGetMessage(c, "Sorry you do not have access to this interface, contact your administrator"), + "msg": ginI18n.MustGetMessage(c, "Sorry you do not have access to this interface, contact your administrator"), }) c.Abort() return diff --git a/common/models/by.go b/common/models/by.go index 181c7ed..0a9a39e 100644 --- a/common/models/by.go +++ b/common/models/by.go @@ -3,30 +3,32 @@ package models import ( "time" - "gorm.io/gorm" + "gorm.io/plugin/soft_delete" ) +// create and update by user type ControlBy struct { - CreateBy int `json:"createBy" gorm:"index;comment:创建者"` - UpdateBy int `json:"updateBy" gorm:"index;comment:更新者"` + CreateBy int `json:"createBy" gorm:"index;comment:create user"` + UpdateBy int `json:"updateBy" gorm:"index;comment:update user"` } -// SetCreateBy 设置创建人id +// SetCreateBy creater id func (e *ControlBy) SetCreateBy(createBy int) { e.CreateBy = createBy } -// SetUpdateBy 设置修改人id +// SetUpdateBy edit id func (e *ControlBy) SetUpdateBy(updateBy int) { e.UpdateBy = updateBy } type Model struct { - Id int `json:"id" gorm:"primaryKey;autoIncrement;comment:主键编码"` + Id int `json:"id" gorm:"primaryKey;autoIncrement;comment:key"` } +// Org model Time and delete flag type ModelTime struct { - CreatedAt time.Time `json:"createdAt" gorm:"comment:创建时间"` - UpdatedAt time.Time `json:"updatedAt" gorm:"comment:最后更新时间"` - DeletedAt gorm.DeletedAt `json:"-" gorm:"index;comment:删除时间"` -} \ No newline at end of file + CreatedAt time.Time `json:"createdAt" gorm:"comment:create date"` + UpdatedAt time.Time `json:"updatedAt" gorm:"comment:update date"` + DeletedAt soft_delete.DeletedAt `json:"-" gorm:"index;comment:flag"` +} diff --git a/config/database.sql b/config/database.sql new file mode 100644 index 0000000..c92047b --- /dev/null +++ b/config/database.sql @@ -0,0 +1,774 @@ +-- Adminer 4.8.1 MySQL 8.0.28 dump + +SET NAMES utf8; +SET time_zone = '+00:00'; +SET foreign_key_checks = 0; +SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; + +SET NAMES utf8mb4; + +DROP TABLE IF EXISTS `sys_api`; +CREATE TABLE `sys_api` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键编码', + `handle` varchar(128) DEFAULT NULL COMMENT 'handle', + `title` varchar(128) DEFAULT NULL COMMENT '标题', + `path` varchar(128) DEFAULT NULL COMMENT '地址', + `type` varchar(16) DEFAULT NULL COMMENT '接口类型', + `action` varchar(16) DEFAULT NULL COMMENT '请求类型', + `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间', + `updated_at` datetime(3) DEFAULT NULL COMMENT '最后更新时间', + `deleted_at` tinyint DEFAULT '0' COMMENT '删除状态', + `create_by` bigint DEFAULT NULL COMMENT '创建者', + `update_by` bigint DEFAULT NULL COMMENT '更新者', + PRIMARY KEY (`id`), + KEY `idx_sys_api_create_by` (`create_by`), + KEY `idx_sys_api_update_by` (`update_by`), + KEY `idx_sys_api_deleted_at` (`deleted_at`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +INSERT INTO `sys_api` (`id`, `handle`, `title`, `path`, `type`, `action`, `created_at`, `updated_at`, `deleted_at`, `create_by`, `update_by`) VALUES +(5, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysLoginLog.Get-fm', '登录日志通过id获取', '/api/v1/sys-login-log/:id', 'BUS', 'GET', '2021-05-13 19:59:00.728', '2021-06-17 11:37:12.331', 0, 0, 0), +(6, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysOperaLog.GetPage-fm', '操作日志列表', '/api/v1/sys-opera-log', 'BUS', 'GET', '2021-05-13 19:59:00.778', '2021-06-17 11:48:40.732', 0, 0, 0), +(7, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysOperaLog.Get-fm', '操作日志通过id获取', '/api/v1/sys-opera-log/:id', 'BUS', 'GET', '2021-05-13 19:59:00.821', '2021-06-16 21:49:48.598', 0, 0, 0), +(8, 'github.com/nicelizhi/easy-admin/common/actions.IndexAction.func1', '分类列表', '/api/v1/syscategory', 'BUS', 'GET', '2021-05-13 19:59:00.870', '2021-06-13 20:53:47.883', 0, 0, 0), +(9, 'github.com/nicelizhi/easy-admin/common/actions.ViewAction.func1', '分类通过id获取', '/api/v1/syscategory/:id', 'BUS', 'GET', '2021-05-13 19:59:00.945', '2021-06-13 20:53:47.926', 0, 0, 0), +(10, 'github.com/nicelizhi/easy-admin/common/actions.IndexAction.func1', '内容列表', '/api/v1/syscontent', 'BUS', 'GET', '2021-05-13 19:59:01.005', '2021-06-13 20:53:47.966', 0, 0, 0), +(11, 'github.com/nicelizhi/easy-admin/common/actions.ViewAction.func1', '内容通过id获取', '/api/v1/syscontent/:id', 'BUS', 'GET', '2021-05-13 19:59:01.056', '2021-06-13 20:53:48.005', 0, 0, 0), +(15, 'github.com/nicelizhi/easy-admin/common/actions.IndexAction.func1', 'job列表', '/api/v1/sysjob', 'BUS', 'GET', '2021-05-13 19:59:01.248', '2021-06-13 20:53:48.169', 0, 0, 0), +(16, 'github.com/nicelizhi/easy-admin/common/actions.ViewAction.func1', 'job通过id获取', '/api/v1/sysjob/:id', 'BUS', 'GET', '2021-05-13 19:59:01.298', '2021-06-13 20:53:48.214', 0, 0, 0), +(21, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysDictType.GetPage-fm', '字典类型列表', '/api/v1/dict/type', 'BUS', 'GET', '2021-05-13 19:59:01.525', '2021-06-17 11:48:40.732', 0, 0, 0), +(22, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysDictType.GetAll-fm', '字典类型查询【代码生成】', '/api/v1/dict/type-option-select', 'SYS', 'GET', '2021-05-13 19:59:01.582', '2021-06-13 20:53:48.388', 0, 0, 0), +(23, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysDictType.Get-fm', '字典类型通过id获取', '/api/v1/dict/type/:id', 'BUS', 'GET', '2021-05-13 19:59:01.632', '2021-06-17 11:48:40.732', 0, 0, 0), +(24, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysDictData.GetPage-fm', '字典数据列表', '/api/v1/dict/data', 'BUS', 'GET', '2021-05-13 19:59:01.684', '2021-06-17 11:48:40.732', 0, 0, 0), +(25, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysDictData.Get-fm', '字典数据通过code获取', '/api/v1/dict/data/:dictCode', 'BUS', 'GET', '2021-05-13 19:59:01.732', '2021-06-17 11:48:40.732', 0, 0, 0), +(26, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysDictData.GetSysDictDataAll-fm', '数据字典根据key获取', '/api/v1/dict-data/option-select', 'SYS', 'GET', '2021-05-13 19:59:01.832', '2021-06-17 11:48:40.732', 0, 0, 0), +(27, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysDept.GetPage-fm', '部门列表', '/api/v1/dept', 'BUS', 'GET', '2021-05-13 19:59:01.940', '2021-06-17 11:48:40.732', 0, 0, 0), +(28, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysDept.Get-fm', '部门通过id获取', '/api/v1/dept/:id', 'BUS', 'GET', '2021-05-13 19:59:02.009', '2021-06-17 11:48:40.732', 0, 0, 0), +(29, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysDept.Get2Tree-fm', '查询部门下拉树【角色权限-自定权限】', '/api/v1/deptTree', 'SYS', 'GET', '2021-05-13 19:59:02.050', '2021-06-17 11:48:40.732', 0, 0, 0), +(30, 'github.com/nicelizhi/easy-admin/app/admin/apis/tools.(*Gen).GetDBTableList-fm', '数据库表列表', '/api/v1/db/tables/page', 'SYS', 'GET', '2021-05-13 19:59:02.098', '2021-06-13 20:53:48.730', 0, 0, 0), +(31, 'github.com/nicelizhi/easy-admin/app/admin/apis/tools.(*Gen).GetDBColumnList-fm', '数据表列列表', '/api/v1/db/columns/page', 'SYS', 'GET', '2021-05-13 19:59:02.140', '2021-06-13 20:53:48.771', 0, 0, 0), +(32, 'github.com/nicelizhi/easy-admin/app/admin/apis/tools.Gen.GenCode-fm', '数据库表生成到项目', '/api/v1/gen/toproject/:tableId', 'SYS', 'GET', '2021-05-13 19:59:02.183', '2021-06-13 20:53:48.812', 0, 0, 0), +(33, 'github.com/nicelizhi/easy-admin/app/admin/apis/tools.Gen.GenMenuAndApi-fm', '数据库表生成到DB', '/api/v1/gen/todb/:tableId', 'SYS', 'GET', '2021-05-13 19:59:02.227', '2021-06-13 20:53:48.853', 0, 0, 0), +(34, 'github.com/nicelizhi/easy-admin/app/admin/apis/tools.(*SysTable).GetSysTablesTree-fm', '关系表数据【代码生成】', '/api/v1/gen/tabletree', 'SYS', 'GET', '2021-05-13 19:59:02.271', '2021-06-13 20:53:48.893', 0, 0, 0), +(35, 'github.com/nicelizhi/easy-admin/app/admin/apis/tools.Gen.Preview-fm', '生成预览通过id获取', '/api/v1/gen/preview/:tableId', 'SYS', 'GET', '2021-05-13 19:59:02.315', '2021-06-13 20:53:48.935', 0, 0, 0), +(36, 'github.com/nicelizhi/easy-admin/app/admin/apis/tools.Gen.GenApiToFile-fm', '生成api带文件', '/api/v1/gen/apitofile/:tableId', 'SYS', 'GET', '2021-05-13 19:59:02.357', '2021-06-13 20:53:48.977', 0, 0, 0), +(37, 'github.com/nicelizhi/easy-admin/app/admin/apis.System.GenerateCaptchaHandler-fm', '验证码获取', '/api/v1/getCaptcha', 'SYS', 'GET', '2021-05-13 19:59:02.405', '2021-06-13 20:53:49.020', 0, 0, 0), +(38, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysUser.GetInfo-fm', '用户信息获取', '/api/v1/getinfo', 'SYS', 'GET', '2021-05-13 19:59:02.447', '2021-06-13 20:53:49.065', 0, 0, 0), +(39, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysMenu.GetPage-fm', '菜单列表', '/api/v1/menu', 'BUS', 'GET', '2021-05-13 19:59:02.497', '2021-06-17 11:48:40.732', 0, 0, 0), +(40, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysMenu.GetMenuTreeSelect-fm', '查询菜单下拉树结构【废弃】', '/api/v1/menuTreeselect', 'SYS', 'GET', '2021-05-13 19:59:02.542', '2021-06-03 22:37:21.857', 0, 0, 0), +(41, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysMenu.Get-fm', '菜单通过id获取', '/api/v1/menu/:id', 'BUS', 'GET', '2021-05-13 19:59:02.584', '2021-06-17 11:48:40.732', 0, 0, 0), +(42, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysMenu.GetMenuRole-fm', '角色菜单【顶部左侧菜单】', '/api/v1/menurole', 'SYS', 'GET', '2021-05-13 19:59:02.630', '2021-06-13 20:53:49.574', 0, 0, 0), +(43, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysMenu.GetMenuIDS-fm', '获取角色对应的菜单id数组【废弃】', '/api/v1/menuids', 'SYS', 'GET', '2021-05-13 19:59:02.675', '2021-06-03 22:39:52.500', 0, 0, 0), +(44, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysRole.GetPage-fm', '角色列表', '/api/v1/role', 'BUS', 'GET', '2021-05-13 19:59:02.720', '2021-06-17 11:48:40.732', 0, 0, 0), +(45, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysMenu.GetMenuTreeSelect-fm', '菜单权限列表【角色配菜单使用】', '/api/v1/roleMenuTreeselect/:roleId', 'SYS', 'GET', '2021-05-13 19:59:02.762', '2021-06-17 11:48:40.732', 0, 0, 0), +(46, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysDept.GetDeptTreeRoleSelect-fm', '角色部门结构树【自定义数据权限】', '/api/v1/roleDeptTreeselect/:roleId', 'SYS', 'GET', '2021-05-13 19:59:02.809', '2021-06-17 11:48:40.732', 0, 0, 0), +(47, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysRole.Get-fm', '角色通过id获取', '/api/v1/role/:id', 'BUS', 'GET', '2021-05-13 19:59:02.850', '2021-06-17 11:48:40.732', 0, 0, 0), +(48, 'github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth.(*GinJWTMiddleware).RefreshHandler-fm', '刷新token', '/api/v1/refresh_token', 'SYS', 'GET', '2021-05-13 19:59:02.892', '2021-06-13 20:53:49.278', 0, 0, 0), +(53, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysConfig.GetPage-fm', '参数列表', '/api/v1/config', 'BUS', 'GET', '2021-05-13 19:59:03.116', '2021-06-17 11:48:40.732', 0, 0, 0), +(54, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysConfig.Get-fm', '参数通过id获取', '/api/v1/config/:id', 'BUS', 'GET', '2021-05-13 19:59:03.157', '2021-06-17 11:48:40.732', 0, 0, 0), +(55, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysConfig.GetSysConfigByKEYForService-fm', '参数通过键名搜索【基础默认配置】', '/api/v1/configKey/:configKey', 'SYS', 'GET', '2021-05-13 19:59:03.198', '2021-06-13 20:53:49.745', 0, 0, 0), +(57, 'github.com/nicelizhi/easy-admin/app/jobs/apis.SysJob.RemoveJobForService-fm', 'job移除', '/api/v1/job/remove/:id', 'BUS', 'GET', '2021-05-13 19:59:03.295', '2021-06-13 20:53:49.786', 0, 0, 0), +(58, 'github.com/nicelizhi/easy-admin/app/jobs/apis.SysJob.StartJobForService-fm', 'job启动', '/api/v1/job/start/:id', 'BUS', 'GET', '2021-05-13 19:59:03.339', '2021-06-13 20:53:49.829', 0, 0, 0), +(59, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysPost.GetPage-fm', '岗位列表', '/api/v1/post', 'BUS', 'GET', '2021-05-13 19:59:03.381', '2021-06-17 11:48:40.732', 0, 0, 0), +(60, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysPost.Get-fm', '岗位通过id获取', '/api/v1/post/:id', 'BUS', 'GET', '2021-05-13 19:59:03.433', '2021-06-17 11:48:40.732', 0, 0, 0), +(62, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysConfig.GetSysConfigBySysApp-fm', '系统前端参数', '/api/v1/app-config', 'SYS', 'GET', '2021-05-13 19:59:03.526', '2021-06-13 20:53:49.994', 0, 0, 0), +(63, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysUser.GetProfile-fm', '*用户信息获取', '/api/v1/user/profile', 'SYS', 'GET', '2021-05-13 19:59:03.567', '2021-06-13 20:53:50.038', 0, 0, 0), +(66, 'github.com/go-admin-team/go-admin-core/sdk/pkg/ws.(*Manager).WsClient-fm', '链接ws【定时任务log】', '/ws/:id/:channel', 'BUS', 'GET', '2021-05-13 19:59:03.705', '2021-06-13 20:53:50.167', 0, 0, 0), +(67, 'github.com/go-admin-team/go-admin-core/sdk/pkg/ws.(*Manager).UnWsClient-fm', '退出ws【定时任务log】', '/wslogout/:id/:channel', 'BUS', 'GET', '2021-05-13 19:59:03.756', '2021-06-13 20:53:50.209', 0, 0, 0), +(68, 'github.com/nicelizhi/easy-admin/common/middleware/handler.Ping', '*用户基本信息', '/info', 'SYS', 'GET', '2021-05-13 19:59:03.800', '2021-06-13 20:53:50.251', 0, 0, 0), +(72, 'github.com/nicelizhi/easy-admin/common/actions.CreateAction.func1', '分类创建', '/api/v1/syscategory', 'BUS', 'POST', '2021-05-13 19:59:03.982', '2021-06-13 20:53:50.336', 0, 0, 0), +(73, 'github.com/nicelizhi/easy-admin/common/actions.CreateAction.func1', '内容创建', '/api/v1/syscontent', 'BUS', 'POST', '2021-05-13 19:59:04.027', '2021-06-13 20:53:50.375', 0, 0, 0), +(76, 'github.com/nicelizhi/easy-admin/common/actions.CreateAction.func1', 'job创建', '/api/v1/sysjob', 'BUS', 'POST', '2021-05-13 19:59:04.164', '2021-06-13 20:53:50.500', 0, 0, 0), +(80, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysDictData.Insert-fm', '字典数据创建', '/api/v1/dict/data', 'BUS', 'POST', '2021-05-13 19:59:04.347', '2021-06-17 11:48:40.732', 0, 0, 0), +(81, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysDictType.Insert-fm', '字典类型创建', '/api/v1/dict/type', 'BUS', 'POST', '2021-05-13 19:59:04.391', '2021-06-17 11:48:40.732', 0, 0, 0), +(82, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysDept.Insert-fm', '部门创建', '/api/v1/dept', 'BUS', 'POST', '2021-05-13 19:59:04.435', '2021-06-17 11:48:40.732', 0, 0, 0), +(85, 'github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth.(*GinJWTMiddleware).LoginHandler-fm', '*登录', '/api/v1/login', 'SYS', 'POST', '2021-05-13 19:59:04.597', '2021-06-13 20:53:50.784', 0, 0, 0), +(86, 'github.com/nicelizhi/easy-admin/common/middleware/handler.LogOut', '*退出', '/api/v1/logout', 'SYS', 'POST', '2021-05-13 19:59:04.642', '2021-06-13 20:53:50.824', 0, 0, 0), +(87, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysConfig.Insert-fm', '参数创建', '/api/v1/config', 'BUS', 'POST', '2021-05-13 19:59:04.685', '2021-06-17 11:48:40.732', 0, 0, 0), +(88, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysMenu.Insert-fm', '菜单创建', '/api/v1/menu', 'BUS', 'POST', '2021-05-13 19:59:04.777', '2021-06-17 11:48:40.732', 0, 0, 0), +(89, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysPost.Insert-fm', '岗位创建', '/api/v1/post', 'BUS', 'POST', '2021-05-13 19:59:04.886', '2021-06-17 11:48:40.732', 0, 0, 0), +(90, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysRole.Insert-fm', '角色创建', '/api/v1/role', 'BUS', 'POST', '2021-05-13 19:59:04.975', '2021-06-17 11:48:40.732', 0, 0, 0), +(91, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysUser.InsetAvatar-fm', '*用户头像编辑', '/api/v1/user/avatar', 'SYS', 'POST', '2021-05-13 19:59:05.058', '2021-06-13 20:53:51.079', 0, 0, 0), +(92, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysApi.Update-fm', '接口编辑', '/api/v1/sys-api/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.122', '2021-06-17 11:48:40.732', 0, 0, 0), +(95, 'github.com/nicelizhi/easy-admin/common/actions.UpdateAction.func1', '分类编辑', '/api/v1/syscategory/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.255', '2021-06-13 20:53:51.247', 0, 0, 0), +(96, 'github.com/nicelizhi/easy-admin/common/actions.UpdateAction.func1', '内容编辑', '/api/v1/syscontent/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.299', '2021-06-13 20:53:51.289', 0, 0, 0), +(97, 'github.com/nicelizhi/easy-admin/common/actions.UpdateAction.func1', 'job编辑', '/api/v1/sysjob', 'BUS', 'PUT', '2021-05-13 19:59:05.343', '2021-06-13 20:53:51.331', 0, 0, 0), +(101, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysDictData.Update-fm', '字典数据编辑', '/api/v1/dict/data/:dictCode', 'BUS', 'PUT', '2021-05-13 19:59:05.519', '2021-06-17 11:48:40.732', 0, 0, 0), +(102, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysDictType.Update-fm', '字典类型编辑', '/api/v1/dict/type/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.569', '2021-06-17 11:48:40.732', 0, 0, 0), +(103, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysDept.Update-fm', '部门编辑', '/api/v1/dept/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.613', '2021-06-17 11:48:40.732', 0, 0, 0), +(104, 'github.com/nicelizhi/easy-admin/app/other/apis.SysFileDir.Update-fm', '文件夹编辑', '/api/v1/file-dir/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.662', '2021-06-13 20:53:51.847', 0, 0, 0), +(105, 'github.com/nicelizhi/easy-admin/app/other/apis.SysFileInfo.Update-fm', '文件编辑', '/api/v1/file-info/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.709', '2021-06-13 20:53:51.892', 0, 0, 0), +(106, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysRole.Update-fm', '角色编辑', '/api/v1/role/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.752', '2021-06-17 11:48:40.732', 0, 0, 0), +(107, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysRole.Update2DataScope-fm', '角色数据权限修改', '/api/v1/roledatascope', 'BUS', 'PUT', '2021-05-13 19:59:05.803', '2021-06-17 11:48:40.732', 0, 0, 0), +(108, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysConfig.Update-fm', '参数编辑', '/api/v1/config/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.848', '2021-06-17 11:48:40.732', 0, 0, 0), +(109, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysMenu.Update-fm', '编辑菜单', '/api/v1/menu/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.891', '2021-06-17 11:48:40.732', 0, 0, 0), +(110, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysPost.Update-fm', '岗位编辑', '/api/v1/post/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.934', '2021-06-17 11:48:40.732', 0, 0, 0), +(111, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysUser.UpdatePwd-fm', '*用户修改密码', '/api/v1/user/pwd', 'SYS', 'PUT', '2021-05-13 19:59:05.987', '2021-06-13 20:53:51.724', 0, 0, 0), +(112, 'github.com/nicelizhi/easy-admin/common/actions.DeleteAction.func1', '分类删除', '/api/v1/syscategory', 'BUS', 'DELETE', '2021-05-13 19:59:06.030', '2021-06-13 20:53:52.237', 0, 0, 0), +(113, 'github.com/nicelizhi/easy-admin/common/actions.DeleteAction.func1', '内容删除', '/api/v1/syscontent', 'BUS', 'DELETE', '2021-05-13 19:59:06.076', '2021-06-13 20:53:52.278', 0, 0, 0), +(114, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysLoginLog.Delete-fm', '登录日志删除', '/api/v1/sys-login-log', 'BUS', 'DELETE', '2021-05-13 19:59:06.118', '2021-06-17 11:48:40.732', 0, 0, 0), +(115, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysOperaLog.Delete-fm', '操作日志删除', '/api/v1/sys-opera-log', 'BUS', 'DELETE', '2021-05-13 19:59:06.162', '2021-06-17 11:48:40.732', 0, 0, 0), +(116, 'github.com/nicelizhi/easy-admin/common/actions.DeleteAction.func1', 'job删除', '/api/v1/sysjob', 'BUS', 'DELETE', '2021-05-13 19:59:06.206', '2021-06-13 20:53:52.323', 0, 0, 0), +(117, 'github.com/nicelizhi/easy-admin/app/other/apis.SysChinaAreaData.Delete-fm', '行政区删除', '/api/v1/sys-area-data', 'BUS', 'DELETE', '2021-05-13 19:59:06.249', '2021-06-13 20:53:52.061', 0, 0, 0), +(120, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysDictData.Delete-fm', '字典数据删除', '/api/v1/dict/data', 'BUS', 'DELETE', '2021-05-13 19:59:06.387', '2021-06-17 11:48:40.732', 0, 0, 0), +(121, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysDictType.Delete-fm', '字典类型删除', '/api/v1/dict/type', 'BUS', 'DELETE', '2021-05-13 19:59:06.432', '2021-06-17 11:48:40.732', 0, 0, 0), +(122, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysDept.Delete-fm', '部门删除', '/api/v1/dept/:id', 'BUS', 'DELETE', '2021-05-13 19:59:06.475', '2021-06-17 11:48:40.732', 0, 0, 0), +(123, 'github.com/nicelizhi/easy-admin/app/other/apis.SysFileDir.Delete-fm', '文件夹删除', '/api/v1/file-dir/:id', 'BUS', 'DELETE', '2021-05-13 19:59:06.520', '2021-06-13 20:53:52.539', 0, 0, 0), +(124, 'github.com/nicelizhi/easy-admin/app/other/apis.SysFileInfo.Delete-fm', '文件删除', '/api/v1/file-info/:id', 'BUS', 'DELETE', '2021-05-13 19:59:06.566', '2021-06-13 20:53:52.580', 0, 0, 0), +(125, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysConfig.Delete-fm', '参数删除', '/api/v1/config', 'BUS', 'DELETE', '2021-05-13 19:59:06.612', '2021-06-17 11:48:40.732', 0, 0, 0), +(126, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysMenu.Delete-fm', '删除菜单', '/api/v1/menu', 'BUS', 'DELETE', '2021-05-13 19:59:06.654', '2021-06-17 11:48:40.732', 0, 0, 0), +(127, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysPost.Delete-fm', '岗位删除', '/api/v1/post/:id', 'BUS', 'DELETE', '2021-05-13 19:59:06.702', '2021-06-17 11:48:40.732', 0, 0, 0), +(128, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysRole.Delete-fm', '角色删除', '/api/v1/role', 'BUS', 'DELETE', '2021-05-13 19:59:06.746', '2021-06-17 11:48:40.732', 0, 0, 0), +(131, 'github.com/go-admin-team/go-admin-core/tools/transfer.Handler.func1', '系统指标', '/api/v1/metrics', 'SYS', 'GET', '2021-05-17 22:13:55.933', '2021-06-13 20:53:49.614', 0, 0, 0), +(132, 'github.com/nicelizhi/easy-admin/app/other/router.registerMonitorRouter.func1', '健康状态', '/api/v1/health', 'SYS', 'GET', '2021-05-17 22:13:56.285', '2021-06-13 20:53:49.951', 0, 0, 0), +(133, 'github.com/nicelizhi/easy-admin/app/admin/apis.HelloWorld', '项目默认接口', '/', 'SYS', 'GET', '2021-05-24 10:30:44.553', '2021-06-13 20:53:47.406', 0, 0, 0), +(134, 'github.com/nicelizhi/easy-admin/app/other/apis.ServerMonitor.ServerInfo-fm', '服务器基本状态', '/api/v1/server-monitor', 'SYS', 'GET', '2021-05-24 10:30:44.937', '2021-06-13 20:53:48.255', 0, 0, 0), +(135, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysApi.GetPage-fm', '接口列表', '/api/v1/sys-api', 'BUS', 'GET', '2021-05-24 11:37:53.303', '2021-06-17 11:48:40.732', 0, 0, 0), +(136, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysApi.Get-fm', '接口通过id获取', '/api/v1/sys-api/:id', 'BUS', 'GET', '2021-05-24 11:37:53.359', '2021-06-17 11:48:40.732', 0, 0, 0), +(137, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysLoginLog.GetPage-fm', '登录日志列表', '/api/v1/sys-login-log', 'BUS', 'GET', '2021-05-24 11:47:30.397', '2021-06-17 11:48:40.732', 0, 0, 0), +(138, 'github.com/nicelizhi/easy-admin/app/other/apis.File.UploadFile-fm', '文件上传', '/api/v1/public/uploadFile', 'SYS', 'POST', '2021-05-25 19:16:18.493', '2021-06-13 20:53:50.866', 0, 0, 0), +(139, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysConfig.Update2Set-fm', '参数信息修改【参数配置】', '/api/v1/set-config', 'BUS', 'PUT', '2021-05-27 09:45:14.853', '2021-06-17 11:48:40.732', 0, 0, 0), +(140, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysConfig.Get2Set-fm', '参数获取全部【配置使用】', '/api/v1/set-config', 'BUS', 'GET', '2021-05-27 11:54:14.384', '2021-06-17 11:48:40.732', 0, 0, 0), +(141, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysUser.GetPage-fm', '管理员列表', '/api/v1/sys-user', 'BUS', 'GET', '2021-06-13 19:24:57.111', '2021-06-17 20:31:14.318', 0, 0, 0), +(142, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysUser.Get-fm', '管理员通过id获取', '/api/v1/sys-user/:id', 'BUS', 'GET', '2021-06-13 19:24:57.188', '2021-06-17 20:31:14.318', 0, 0, 0), +(143, 'github.com/nicelizhi/easy-admin/app/admin/apis/tools.(*SysTable).GetSysTablesInfo-fm', '', '/api/v1/sys/tables/info', '', 'GET', '2021-06-13 19:24:57.437', '2021-06-13 20:53:48.047', 0, 0, 0), +(144, 'github.com/nicelizhi/easy-admin/app/admin/apis/tools.(*SysTable).GetSysTables-fm', '', '/api/v1/sys/tables/info/:tableId', '', 'GET', '2021-06-13 19:24:57.510', '2021-06-13 20:53:48.088', 0, 0, 0), +(145, 'github.com/nicelizhi/easy-admin/app/admin/apis/tools.(*SysTable).GetSysTableList-fm', '', '/api/v1/sys/tables/page', '', 'GET', '2021-06-13 19:24:57.582', '2021-06-13 20:53:48.128', 0, 0, 0), +(146, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/static/*filepath', '', 'GET', '2021-06-13 19:24:59.641', '2021-06-13 20:53:50.081', 0, 0, 0), +(147, 'github.com/swaggo/gin-swagger.CustomWrapHandler.func1', '', '/swagger/*any', '', 'GET', '2021-06-13 19:24:59.713', '2021-06-13 20:53:50.123', 0, 0, 0), +(148, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/form-generator/*filepath', '', 'GET', '2021-06-13 19:24:59.914', '2021-06-13 20:53:50.295', 0, 0, 0), +(149, 'github.com/nicelizhi/easy-admin/app/admin/apis/tools.(*SysTable).InsertSysTable-fm', '', '/api/v1/sys/tables/info', '', 'POST', '2021-06-13 19:25:00.163', '2021-06-13 20:53:50.539', 0, 0, 0), +(150, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysUser.Insert-fm', '管理员创建', '/api/v1/sys-user', 'BUS', 'POST', '2021-06-13 19:25:00.233', '2021-06-17 20:31:14.318', 0, 0, 0), +(151, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysUser.Update-fm', '管理员编辑', '/api/v1/sys-user', 'BUS', 'PUT', '2021-06-13 19:25:00.986', '2021-06-17 20:31:14.318', 0, 0, 0), +(152, 'github.com/nicelizhi/easy-admin/app/admin/apis/tools.(*SysTable).UpdateSysTable-fm', '', '/api/v1/sys/tables/info', '', 'PUT', '2021-06-13 19:25:01.149', '2021-06-13 20:53:51.375', 0, 0, 0), +(153, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysRole.Update2Status-fm', '', '/api/v1/role-status', '', 'PUT', '2021-06-13 19:25:01.446', '2021-06-13 20:53:51.636', 0, 0, 0), +(154, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysUser.ResetPwd-fm', '', '/api/v1/user/pwd/reset', '', 'PUT', '2021-06-13 19:25:01.601', '2021-06-13 20:53:51.764', 0, 0, 0), +(155, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysUser.UpdateStatus-fm', '', '/api/v1/user/status', '', 'PUT', '2021-06-13 19:25:01.671', '2021-06-13 20:53:51.806', 0, 0, 0), +(156, 'github.com/nicelizhi/easy-admin/app/admin/apis.SysUser.Delete-fm', '管理员删除', '/api/v1/sys-user', 'BUS', 'DELETE', '2021-06-13 19:25:02.043', '2021-06-17 20:31:14.318', 0, 0, 0), +(157, 'github.com/nicelizhi/easy-admin/app/admin/apis/tools.(*SysTable).DeleteSysTables-fm', '', '/api/v1/sys/tables/info/:tableId', '', 'DELETE', '2021-06-13 19:25:02.283', '2021-06-13 20:53:52.367', 0, 0, 0), +(158, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/static/*filepath', '', 'HEAD', '2021-06-13 19:25:02.734', '2021-06-13 20:53:52.791', 0, 0, 0), +(159, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/form-generator/*filepath', '', 'HEAD', '2021-06-13 19:25:02.808', '2021-06-13 20:53:52.838', 0, 0, 0); + +DROP TABLE IF EXISTS `sys_casbin_rule`; +CREATE TABLE `sys_casbin_rule` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT, + `ptype` varchar(100) DEFAULT NULL, + `v0` varchar(100) DEFAULT NULL, + `v1` varchar(100) DEFAULT NULL, + `v2` varchar(100) DEFAULT NULL, + `v3` varchar(100) DEFAULT NULL, + `v4` varchar(100) DEFAULT NULL, + `v5` varchar(100) DEFAULT NULL, + `v6` varchar(25) DEFAULT NULL, + `v7` varchar(25) DEFAULT NULL, + `p_type` varchar(100) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `idx_sys_casbin_rule` (`ptype`,`v0`,`v1`,`v2`,`v3`,`v4`,`v5`,`v6`,`v7`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + + +DROP TABLE IF EXISTS `sys_columns`; +CREATE TABLE `sys_columns` ( + `column_id` bigint NOT NULL AUTO_INCREMENT, + `table_id` bigint DEFAULT NULL, + `column_name` varchar(128) DEFAULT NULL, + `column_comment` varchar(128) DEFAULT NULL, + `column_type` varchar(128) DEFAULT NULL, + `go_type` varchar(128) DEFAULT NULL, + `go_field` varchar(128) DEFAULT NULL, + `json_field` varchar(128) DEFAULT NULL, + `is_pk` varchar(4) DEFAULT NULL, + `is_increment` varchar(4) DEFAULT NULL, + `is_required` varchar(4) DEFAULT NULL, + `is_insert` varchar(4) DEFAULT NULL, + `is_edit` varchar(4) DEFAULT NULL, + `is_list` varchar(4) DEFAULT NULL, + `is_query` varchar(4) DEFAULT NULL, + `query_type` varchar(128) DEFAULT NULL, + `html_type` varchar(128) DEFAULT NULL, + `dict_type` varchar(128) DEFAULT NULL, + `sort` bigint DEFAULT NULL, + `list` varchar(1) DEFAULT NULL, + `pk` tinyint(1) DEFAULT NULL, + `required` tinyint(1) DEFAULT NULL, + `super_column` tinyint(1) DEFAULT NULL, + `usable_column` tinyint(1) DEFAULT NULL, + `increment` tinyint(1) DEFAULT NULL, + `insert` tinyint(1) DEFAULT NULL, + `edit` tinyint(1) DEFAULT NULL, + `query` tinyint(1) DEFAULT NULL, + `remark` varchar(255) DEFAULT NULL, + `fk_table_name` longtext, + `fk_table_name_class` longtext, + `fk_table_name_package` longtext, + `fk_label_id` longtext, + `fk_label_name` varchar(255) DEFAULT NULL, + `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间', + `updated_at` datetime(3) DEFAULT NULL COMMENT '最后更新时间', + `deleted_at` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态', + `create_by` bigint DEFAULT NULL COMMENT '创建者', + `update_by` bigint DEFAULT NULL COMMENT '更新者', + PRIMARY KEY (`column_id`), + UNIQUE KEY `column_id_table_id` (`column_id`,`table_id`), + KEY `idx_sys_columns_update_by` (`update_by`), + KEY `idx_sys_columns_deleted_at` (`deleted_at`), + KEY `idx_sys_columns_create_by` (`create_by`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + + +DROP TABLE IF EXISTS `sys_config`; +CREATE TABLE `sys_config` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键编码', + `config_name` varchar(128) DEFAULT NULL COMMENT 'ConfigName', + `config_key` varchar(128) DEFAULT NULL COMMENT 'ConfigKey', + `config_value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT 'ConfigValue', + `config_type` varchar(64) DEFAULT NULL COMMENT 'ConfigType', + `is_frontend` varchar(64) DEFAULT NULL COMMENT '是否前台', + `remark` varchar(128) DEFAULT NULL COMMENT 'Remark', + `create_by` bigint DEFAULT NULL COMMENT '创建者', + `update_by` bigint DEFAULT NULL COMMENT '更新者', + `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间', + `updated_at` datetime(3) DEFAULT NULL COMMENT '最后更新时间', + `deleted_at` tinyint(1) DEFAULT '0' COMMENT '删除状态', + PRIMARY KEY (`id`), + KEY `idx_sys_config_create_by` (`create_by`), + KEY `idx_sys_config_update_by` (`update_by`), + KEY `idx_sys_config_deleted_at` (`deleted_at`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +INSERT INTO `sys_config` (`id`, `config_name`, `config_key`, `config_value`, `config_type`, `is_frontend`, `remark`, `create_by`, `update_by`, `created_at`, `updated_at`, `deleted_at`) VALUES +(1, '皮肤样式', 'sys_index_skinName', 'skin-green', 'Y', '0', '主框架页-默认皮肤样式名称:蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow', 1, 1, '2021-05-13 19:56:37.913', '2023-11-01 17:37:12.533', 0), +(2, '初始密码', 'sys_user_initPassword', 'wgYoVaLXNGCXqcNY', 'Y', '0', '用户管理-账号初始密码:wgYoVaLXNGCXqcNY', 1, 1, '2021-05-13 19:56:37.913', '2023-10-21 21:35:53.284', 0), +(3, '侧栏主题', 'sys_index_sideTheme', 'theme-dark', 'Y', '0', '主框架页-侧边栏主题:深色主题theme-dark,浅色主题theme-light', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', 0), +(4, '系统名称', 'sys_app_name', '后台管理系统', 'Y', '1', '', 1, 0, '2021-03-17 08:52:06.067', '2023-10-21 21:34:37.282', 0), +(5, '系统logo', 'sys_app_logo', '', 'Y', '1', '', 1, 0, '2021-03-17 08:53:19.462', '2023-10-22 12:53:50.868', 0); + +DROP TABLE IF EXISTS `sys_dept`; +CREATE TABLE `sys_dept` ( + `dept_id` bigint NOT NULL AUTO_INCREMENT, + `parent_id` bigint DEFAULT NULL, + `dept_path` varchar(255) DEFAULT NULL, + `dept_name` varchar(128) DEFAULT NULL, + `sort` tinyint DEFAULT NULL, + `leader` varchar(128) DEFAULT NULL, + `phone` varchar(11) DEFAULT NULL, + `email` varchar(64) DEFAULT NULL, + `status` tinyint DEFAULT NULL, + `create_by` bigint DEFAULT NULL COMMENT '创建者', + `update_by` bigint DEFAULT NULL COMMENT '更新者', + `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间', + `updated_at` datetime(3) DEFAULT NULL COMMENT '最后更新时间', + `deleted_at` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态', + PRIMARY KEY (`dept_id`), + KEY `idx_sys_dept_create_by` (`create_by`), + KEY `idx_sys_dept_update_by` (`update_by`), + KEY `idx_sys_dept_deleted_at` (`deleted_at`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +INSERT INTO `sys_dept` (`dept_id`, `parent_id`, `dept_path`, `dept_name`, `sort`, `leader`, `phone`, `email`, `status`, `create_by`, `update_by`, `created_at`, `updated_at`, `deleted_at`) VALUES +(1, 0, '/0/1/', '上海申东', 0, '姚老师', '13524084051', 'atuo@aituo.com', 2, 1, 1, '2021-05-13 19:56:37.913', '2023-10-21 21:36:42.379', 0), +(7, 1, '/0/1/7/', '研发部', 1, 'aituo', '13782218188', 'atuo@aituo.com', 2, 1, 1, '2021-05-13 19:56:37.913', '2021-06-16 21:35:00.109', 0), +(8, 1, '/0/1/8/', '运维部', 0, 'aituo', '13782218188', 'atuo@aituo.com', 2, 1, 1, '2021-05-13 19:56:37.913', '2021-06-16 21:41:39.747', 0), +(9, 1, '/0/1/9/', '客服部', 0, 'aituo', '13782218188', 'atuo@aituo.com', 2, 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 17:07:05.993', 0), +(10, 1, '/0/1/10/', '人力资源', 3, 'aituo', '13782218188', 'atuo@aituo.com', 1, 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 17:07:08.503', 0), +(11, 10, '/0/1/10/11/', '财务部门', 10, 'admin', '13524084051', 'nice.lizhi@gmail.com', 2, 0, 0, '2023-10-13 20:53:10.408', '2023-10-13 20:53:10.410', 0); + +DROP TABLE IF EXISTS `sys_dict_data`; +CREATE TABLE `sys_dict_data` ( + `dict_code` bigint NOT NULL AUTO_INCREMENT, + `dict_sort` bigint DEFAULT NULL, + `dict_label` varchar(128) DEFAULT NULL, + `dict_value` varchar(255) DEFAULT NULL, + `dict_type` varchar(64) DEFAULT NULL, + `css_class` varchar(128) DEFAULT NULL, + `list_class` varchar(128) DEFAULT NULL, + `is_default` varchar(8) DEFAULT NULL, + `status` tinyint DEFAULT NULL, + `default` varchar(8) DEFAULT NULL, + `remark` varchar(255) DEFAULT NULL, + `create_by` bigint DEFAULT NULL COMMENT '创建者', + `update_by` bigint DEFAULT NULL COMMENT '更新者', + `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间', + `updated_at` datetime(3) DEFAULT NULL COMMENT '最后更新时间', + `deleted_at` tinyint(1) NOT NULL DEFAULT '0' COMMENT '删除状态', + PRIMARY KEY (`dict_code`), + KEY `idx_sys_dict_data_create_by` (`create_by`), + KEY `idx_sys_dict_data_update_by` (`update_by`), + KEY `idx_sys_dict_data_deleted_at` (`deleted_at`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `default`, `remark`, `create_by`, `update_by`, `created_at`, `updated_at`, `deleted_at`) VALUES +(1, 0, '正常', '2', 'sys_normal_disable', '', '', '', 2, '', '系统正常', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:40.168', 0), +(2, 0, '停用', '1', 'sys_normal_disable', '', '', '', 2, '', '系统停用', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(3, 0, '男', '0', 'sys_user_sex', '', '', '', 2, '', '性别男', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(4, 0, '女', '1', 'sys_user_sex', '', '', '', 2, '', '性别女', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(5, 0, '未知', '2', 'sys_user_sex', '', '', '', 2, '', '性别未知', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(6, 0, '显示', '0', 'sys_show_hide', '', '', '', 2, '', '显示菜单', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(7, 0, '隐藏', '1', 'sys_show_hide', '', '', '', 2, '', '隐藏菜单', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(8, 0, '是', 'Y', 'sys_yes_no', '', '', '', 2, '', '系统默认是', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(9, 0, '否', 'N', 'sys_yes_no', '', '', '', 2, '', '系统默认否', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(10, 0, '正常', '2', 'sys_job_status', '', '', '', 2, '', '正常状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(11, 0, '停用', '1', 'sys_job_status', '', '', '', 2, '', '停用状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(12, 0, '默认', 'DEFAULT', 'sys_job_group', '', '', '', 2, '', '默认分组', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(13, 0, '系统', 'SYSTEM', 'sys_job_group', '', '', '', 2, '', '系统分组', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(14, 0, '通知', '1', 'sys_notice_type', '', '', '', 2, '', '通知', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(15, 0, '公告', '2', 'sys_notice_type', '', '', '', 2, '', '公告', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(16, 0, '正常', '2', 'sys_common_status', '', '', '', 2, '', '正常状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(17, 0, '关闭', '1', 'sys_common_status', '', '', '', 2, '', '关闭状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(18, 0, '新增', '1', 'sys_oper_type', '', '', '', 2, '', '新增操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(19, 0, '修改', '2', 'sys_oper_type', '', '', '', 2, '', '修改操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(20, 0, '删除', '3', 'sys_oper_type', '', '', '', 2, '', '删除操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(21, 0, '授权', '4', 'sys_oper_type', '', '', '', 2, '', '授权操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(22, 0, '导出', '5', 'sys_oper_type', '', '', '', 2, '', '导出操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(23, 0, '导入', '6', 'sys_oper_type', '', '', '', 2, '', '导入操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(24, 0, '强退', '7', 'sys_oper_type', '', '', '', 2, '', '强退操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(25, 0, '生成代码', '8', 'sys_oper_type', '', '', '', 2, '', '生成操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(26, 0, '清空数据', '9', 'sys_oper_type', '', '', '', 2, '', '清空操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(27, 0, '成功', '0', 'sys_notice_status', '', '', '', 2, '', '成功状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(28, 0, '失败', '1', 'sys_notice_status', '', '', '', 2, '', '失败状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(29, 0, '登录', '10', 'sys_oper_type', '', '', '', 2, '', '登录操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(30, 0, '退出', '11', 'sys_oper_type', '', '', '', 2, '', '', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(31, 0, '获取验证码', '12', 'sys_oper_type', '', '', '', 2, '', '获取验证码', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(32, 0, '正常', '1', 'sys_content_status', '', '', '', 1, '', '', 1, 1, '2021-05-13 19:56:40.845', '2021-05-13 19:56:40.845', 0), +(33, 1, '禁用', '2', 'sys_content_status', '', '', '', 1, '', '', 1, 1, '2021-05-13 19:56:40.845', '2021-05-13 19:56:40.845', 0), +(34, 0, 'default', '50', 'related-config-min-limit', '', '', '', 2, '', '', 0, 0, '2023-11-01 10:23:18.902', '2023-11-01 10:23:18.902', 0); + +DROP TABLE IF EXISTS `sys_dict_type`; +CREATE TABLE `sys_dict_type` ( + `dict_id` bigint NOT NULL AUTO_INCREMENT, + `dict_name` varchar(128) DEFAULT NULL, + `dict_type` varchar(128) DEFAULT NULL, + `status` tinyint DEFAULT NULL, + `remark` varchar(255) DEFAULT NULL, + `create_by` bigint DEFAULT NULL COMMENT '创建者', + `update_by` bigint DEFAULT NULL COMMENT '更新者', + `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间', + `updated_at` datetime(3) DEFAULT NULL COMMENT '最后更新时间', + `deleted_at` tinyint(1) NOT NULL DEFAULT '0' COMMENT '删除状态', + PRIMARY KEY (`dict_id`), + KEY `idx_sys_dict_type_create_by` (`create_by`), + KEY `idx_sys_dict_type_update_by` (`update_by`), + KEY `idx_sys_dict_type_deleted_at` (`deleted_at`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +INSERT INTO `sys_dict_type` (`dict_id`, `dict_name`, `dict_type`, `status`, `remark`, `create_by`, `update_by`, `created_at`, `updated_at`, `deleted_at`) VALUES +(1, '系统开关', 'sys_normal_disable', 2, '系统开关列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(2, '用户性别', 'sys_user_sex', 2, '用户性别列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(3, '菜单状态', 'sys_show_hide', 2, '菜单状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(4, '系统是否', 'sys_yes_no', 2, '系统是否列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(5, '任务状态', 'sys_job_status', 2, '任务状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(6, '任务分组', 'sys_job_group', 2, '任务分组列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(7, '通知类型', 'sys_notice_type', 2, '通知类型列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(8, '系统状态', 'sys_common_status', 2, '登录状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(9, '操作类型', 'sys_oper_type', 2, '操作类型列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(10, '通知状态', 'sys_notice_status', 2, '通知状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', 0), +(11, '内容状态', 'sys_content_status', 2, '', 1, 1, '2021-05-13 19:56:40.813', '2021-05-13 19:56:40.813', 0); + +DROP TABLE IF EXISTS `sys_job`; +CREATE TABLE `sys_job` ( + `job_id` bigint NOT NULL AUTO_INCREMENT, + `job_name` varchar(255) DEFAULT NULL, + `job_group` varchar(255) DEFAULT NULL, + `job_type` tinyint DEFAULT NULL, + `cron_expression` varchar(255) DEFAULT NULL, + `invoke_target` varchar(255) DEFAULT NULL, + `args` varchar(255) DEFAULT NULL, + `misfire_policy` bigint DEFAULT NULL, + `concurrent` tinyint DEFAULT NULL, + `status` tinyint DEFAULT NULL, + `entry_id` smallint DEFAULT NULL, + `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间', + `updated_at` datetime(3) DEFAULT NULL COMMENT '最后更新时间', + `deleted_at` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态', + `create_by` bigint DEFAULT NULL COMMENT '创建者', + `update_by` bigint DEFAULT NULL COMMENT '更新者', + PRIMARY KEY (`job_id`), + KEY `idx_sys_job_deleted_at` (`deleted_at`), + KEY `idx_sys_job_create_by` (`create_by`), + KEY `idx_sys_job_update_by` (`update_by`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +INSERT INTO `sys_job` (`job_id`, `job_name`, `job_group`, `job_type`, `cron_expression`, `invoke_target`, `args`, `misfire_policy`, `concurrent`, `status`, `entry_id`, `created_at`, `updated_at`, `deleted_at`, `create_by`, `update_by`) VALUES +(1, '接口测试', 'DEFAULT', 1, '0/5 * * * * ', 'http://localhost:8000', '', 1, 1, 1, 0, '2021-05-13 19:56:37.914', '2021-06-14 20:59:55.417', 0, 1, 1), +(2, '函数测试', 'DEFAULT', 2, '0/5 * * * * ', 'ExamplesOne', '参数', 1, 1, 1, 0, '2021-05-13 19:56:37.914', '2021-05-31 23:55:37.221', 0, 1, 1); + +DROP TABLE IF EXISTS `sys_login_log`; +CREATE TABLE `sys_login_log` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键编码', + `username` varchar(128) DEFAULT NULL COMMENT '用户名', + `status` varchar(4) DEFAULT NULL COMMENT '状态', + `ipaddr` varchar(255) DEFAULT NULL COMMENT 'ip地址', + `login_location` varchar(255) DEFAULT NULL COMMENT '归属地', + `browser` varchar(255) DEFAULT NULL COMMENT '浏览器', + `os` varchar(255) DEFAULT NULL COMMENT '系统', + `platform` varchar(255) DEFAULT NULL COMMENT '固件', + `login_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '登录时间', + `remark` varchar(255) DEFAULT NULL COMMENT '备注', + `msg` varchar(255) DEFAULT NULL COMMENT '信息', + `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间', + `updated_at` datetime(3) DEFAULT NULL COMMENT '最后更新时间', + `create_by` bigint DEFAULT NULL COMMENT '创建者', + `update_by` bigint DEFAULT NULL COMMENT '更新者', + PRIMARY KEY (`id`), + KEY `idx_sys_login_log_create_by` (`create_by`), + KEY `idx_sys_login_log_update_by` (`update_by`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + + +DROP TABLE IF EXISTS `sys_menu`; +CREATE TABLE `sys_menu` ( + `menu_id` bigint NOT NULL AUTO_INCREMENT, + `menu_name` varchar(128) DEFAULT NULL, + `title` varchar(128) DEFAULT NULL, + `icon` varchar(128) DEFAULT NULL, + `path` varchar(128) DEFAULT NULL, + `paths` varchar(128) DEFAULT NULL, + `menu_type` varchar(1) DEFAULT NULL, + `action` varchar(16) DEFAULT NULL, + `permission` varchar(255) DEFAULT NULL, + `parent_id` smallint DEFAULT NULL, + `no_cache` tinyint(1) DEFAULT NULL, + `breadcrumb` varchar(255) DEFAULT NULL, + `component` varchar(255) DEFAULT NULL, + `sort` tinyint DEFAULT NULL, + `visible` varchar(1) DEFAULT NULL, + `is_frame` varchar(1) DEFAULT '0', + `create_by` bigint DEFAULT NULL COMMENT '创建者', + `update_by` bigint DEFAULT NULL COMMENT '更新者', + `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间', + `updated_at` datetime(3) DEFAULT NULL COMMENT '最后更新时间', + `deleted_at` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态', + PRIMARY KEY (`menu_id`), + KEY `idx_sys_menu_create_by` (`create_by`), + KEY `idx_sys_menu_update_by` (`update_by`), + KEY `idx_sys_menu_deleted_at` (`deleted_at`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `title`, `icon`, `path`, `paths`, `menu_type`, `action`, `permission`, `parent_id`, `no_cache`, `breadcrumb`, `component`, `sort`, `visible`, `is_frame`, `create_by`, `update_by`, `created_at`, `updated_at`, `deleted_at`) VALUES +(2, 'Admin', '系统管理', 'api-server', '/admin', '/0/2', 'M', '无', '', 0, 1, '', 'Layout', 10, '0', '1', 0, 1, '2021-05-20 21:58:45.679', '2023-10-07 22:06:59.442', 0), +(3, 'SysUserManage', '用户管理', 'user', '/admin/sys-user', '/0/2/3', 'C', '无', 'admin:sysUser:list', 2, 0, '', '/admin/sys-user/index', 10, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2023-10-07 22:06:59.446', 0), +(43, '', '新增管理员', 'app-group-fill', '', '/0/2/3/43', 'F', 'POST', 'admin:sysUser:add', 3, 0, '', '', 10, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2023-10-07 22:06:59.461', 0), +(44, '', '查询管理员', 'app-group-fill', '', '/0/2/3/44', 'F', 'GET', 'admin:sysUser:query', 3, 0, '', '', 40, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2023-10-07 22:06:59.462', 0), +(45, '', '修改管理员', 'app-group-fill', '', '/0/2/3/45', 'F', 'PUT', 'admin:sysUser:edit', 3, 0, '', '', 30, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2023-10-07 22:06:59.464', 0), +(46, '', '删除管理员', 'app-group-fill', '', '/0/2/3/46', 'F', 'DELETE', 'admin:sysUser:remove', 3, 0, '', '', 20, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2023-10-07 22:06:59.465', 0), +(51, 'SysMenuManage', '菜单管理', 'tree-table', '/admin/sys-menu', '/0/2/51', 'C', '无', 'admin:sysMenu:list', 2, 1, '', '/admin/sys-menu/index', 30, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2023-10-07 22:06:59.447', 0), +(52, 'SysRoleManage', '角色管理', 'peoples', '/admin/sys-role', '/0/2/52', 'C', '无', 'admin:sysRole:list', 2, 1, '', '/admin/sys-role/index', 20, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2023-10-07 22:06:59.449', 0), +(56, 'SysDeptManage', '部门管理', 'tree', '/admin/sys-dept', '/0/2/56', 'C', '无', 'admin:sysDept:list', 2, 0, '', '/admin/sys-dept/index', 40, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2023-10-07 22:06:59.450', 0), +(57, 'SysPostManage', '岗位管理', 'pass', '/admin/sys-post', '/0/2/57', 'C', '无', 'admin:sysPost:list', 2, 0, '', '/admin/sys-post/index', 50, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2023-10-07 22:06:59.451', 0), +(58, 'Dict', '字典管理', 'education', '/admin/dict', '/0/2/58', 'C', '无', 'admin:sysDictType:list', 2, 0, '', '/admin/dict/index', 60, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2023-10-07 22:06:59.453', 0), +(59, 'SysDictDataManage', '字典数据', 'education', '/admin/dict/data/:dictId', '/0/2/59', 'C', '无', 'admin:sysDictData:list', 2, 0, '', '/admin/dict/data', 100, '1', '1', 0, 1, '2021-05-20 22:08:44.526', '2023-10-07 22:06:59.454', 0), +(60, 'Tools', '开发工具', 'dev-tools', '/dev-tools', '/0/60', 'M', '无', '', 0, 0, '', 'Layout', 40, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.443', 0), +(61, 'Swagger', '系统接口', 'guide', '/dev-tools/swagger', '/0/60/61', 'C', '无', '', 60, 0, '', '/dev-tools/swagger/index', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.501', 0), +(62, 'SysConfigManage', '参数管理', 'swagger', '/admin/sys-config', '/0/2/62', 'C', '无', 'admin:sysConfig:list', 2, 0, '', '/admin/sys-config/index', 70, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2023-10-07 22:06:59.456', 0), +(211, 'Log', '日志管理', 'log', '/log', '/0/2/211', 'M', '', '', 2, 0, '', '/log/index', 80, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2023-10-07 22:06:59.457', 0), +(212, 'SysLoginLogManage', '登录日志', 'logininfor', '/admin/sys-login-log', '/0/2/211/212', 'C', '', 'admin:sysLoginLog:list', 211, 0, '', '/admin/sys-login-log/index', 1, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2023-10-07 22:06:59.512', 0), +(216, 'OperLog', '操作日志', 'skill', '/admin/sys-oper-log', '/0/2/211/216', 'C', '', 'admin:sysOperLog:list', 211, 0, '', '/admin/sys-oper-log/index', 1, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2023-10-07 22:06:59.513', 0), +(220, '', '新增菜单', 'app-group-fill', '', '/0/2/51/220', 'F', '', 'admin:sysMenu:add', 51, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.466', 0), +(221, '', '修改菜单', 'app-group-fill', '', '/0/2/51/221', 'F', '', 'admin:sysMenu:edit', 51, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.468', 0), +(222, '', '查询菜单', 'app-group-fill', '', '/0/2/51/222', 'F', '', 'admin:sysMenu:query', 51, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.469', 0), +(223, '', '删除菜单', 'app-group-fill', '', '/0/2/51/223', 'F', '', 'admin:sysMenu:remove', 51, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.470', 0), +(224, '', '新增角色', 'app-group-fill', '', '/0/2/52/224', 'F', '', 'admin:sysRole:add', 52, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.472', 0), +(225, '', '查询角色', 'app-group-fill', '', '/0/2/52/225', 'F', '', 'admin:sysRole:query', 52, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.473', 0), +(226, '', '修改角色', 'app-group-fill', '', '/0/2/52/226', 'F', '', 'admin:sysRole:update', 52, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.474', 0), +(227, '', '删除角色', 'app-group-fill', '', '/0/2/52/227', 'F', '', 'admin:sysRole:remove', 52, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.476', 0), +(228, '', '查询部门', 'app-group-fill', '', '/0/2/56/228', 'F', '', 'admin:sysDept:query', 56, 0, '', '', 40, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2023-10-07 22:06:59.477', 0), +(229, '', '新增部门', 'app-group-fill', '', '/0/2/56/229', 'F', '', 'admin:sysDept:add', 56, 0, '', '', 10, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2023-10-07 22:06:59.479', 0), +(230, '', '修改部门', 'app-group-fill', '', '/0/2/56/230', 'F', '', 'admin:sysDept:edit', 56, 0, '', '', 30, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2023-10-07 22:06:59.480', 0), +(231, '', '删除部门', 'app-group-fill', '', '/0/2/56/231', 'F', '', 'admin:sysDept:remove', 56, 0, '', '', 20, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2023-10-07 22:06:59.483', 0), +(232, '', '查询岗位', 'app-group-fill', '', '/0/2/57/232', 'F', '', 'admin:sysPost:query', 57, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.484', 0), +(233, '', '新增岗位', 'app-group-fill', '', '/0/2/57/233', 'F', '', 'admin:sysPost:add', 57, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.485', 0), +(234, '', '修改岗位', 'app-group-fill', '', '/0/2/57/234', 'F', '', 'admin:sysPost:edit', 57, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.487', 0), +(235, '', '删除岗位', 'app-group-fill', '', '/0/2/57/235', 'F', '', 'admin:sysPost:remove', 57, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.488', 0), +(236, '', '查询字典', 'app-group-fill', '', '/0/2/58/236', 'F', '', 'admin:sysDictType:query', 58, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.489', 0), +(237, '', '新增类型', 'app-group-fill', '', '/0/2/58/237', 'F', '', 'admin:sysDictType:add', 58, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.491', 0), +(238, '', '修改类型', 'app-group-fill', '', '/0/2/58/238', 'F', '', 'admin:sysDictType:edit', 58, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.492', 0), +(239, '', '删除类型', 'app-group-fill', '', '/0/2/58/239', 'F', '', 'system:sysdicttype:remove', 58, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.494', 0), +(240, '', '查询数据', 'app-group-fill', '', '/0/2/59/240', 'F', '', 'admin:sysDictData:query', 59, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.495', 0), +(241, '', '新增数据', 'app-group-fill', '', '/0/2/59/241', 'F', '', 'admin:sysDictData:add', 59, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.497', 0), +(242, '', '修改数据', 'app-group-fill', '', '/0/2/59/242', 'F', '', 'admin:sysDictData:edit', 59, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.498', 0), +(243, '', '删除数据', 'app-group-fill', '', '/0/2/59/243', 'F', '', 'admin:sysDictData:remove', 59, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.499', 0), +(244, '', '查询参数', 'app-group-fill', '', '/0/2/62/244', 'F', '', 'admin:sysConfig:query', 62, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.506', 0), +(245, '', '新增参数', 'app-group-fill', '', '/0/2/62/245', 'F', '', 'admin:sysConfig:add', 62, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.508', 0), +(246, '', '修改参数', 'app-group-fill', '', '/0/2/62/246', 'F', '', 'admin:sysConfig:edit', 62, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.509', 0), +(247, '', '删除参数', 'app-group-fill', '', '/0/2/62/247', 'F', '', 'admin:sysConfig:remove', 62, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.510', 0), +(248, '', '查询登录日志', 'app-group-fill', '', '/0/2/211/212/248', 'F', '', 'admin:sysLoginLog:query', 212, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.514', 0), +(249, '', '删除登录日志', 'app-group-fill', '', '/0/2/211/212/249', 'F', '', 'admin:sysLoginLog:remove', 212, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.516', 0), +(250, '', '查询操作日志', 'app-group-fill', '', '/0/2/211/216/250', 'F', '', 'admin:sysOperLog:query', 216, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.517', 0), +(251, '', '删除操作日志', 'app-group-fill', '', '/0/2/211/216/251', 'F', '', 'admin:sysOperLog:remove', 216, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.518', 0), +(261, 'Gen', '代码生成', 'code', '/dev-tools/gen', '/0/60/261', 'C', '', '', 60, 0, '', '/dev-tools/gen/index', 2, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.502', 0), +(262, 'EditTable', '代码生成修改', 'build', '/dev-tools/editTable', '/0/60/262', 'C', '', '', 60, 0, '', '/dev-tools/gen/editTable', 100, '1', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.504', 0), +(264, 'Build', '表单构建', 'build', '/dev-tools/build', '/0/60/264', 'C', '', '', 60, 0, '', '/dev-tools/build/index', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2023-10-07 22:06:59.505', 0), +(269, 'ServerMonitor', '服务监控', 'druid', '/sys-tools/monitor', '/0/537/269', 'C', '', 'sysTools:serverMonitor:list', 537, 0, '', '/sys-tools/monitor', 0, '0', '1', 1, 1, '2020-04-14 00:28:19.000', '2023-10-07 22:06:59.531', 0), +(459, 'Schedule', '定时任务', 'time-range', '/schedule', '/0/459', 'M', '无', '', 0, 0, '', 'Layout', 20, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2023-10-07 22:06:59.444', 0), +(460, 'ScheduleManage', 'Schedule', 'job', '/schedule/manage', '/0/459/460', 'C', '无', 'job:sysJob:list', 459, 0, '', '/schedule/index', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2023-10-07 22:06:59.520', 0), +(461, 'sys_job', '分页获取定时任务', 'app-group-fill', '', '/0/459/460/461', 'F', '无', 'job:sysJob:query', 460, 0, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2023-10-07 22:06:59.523', 0), +(462, 'sys_job', '创建定时任务', 'app-group-fill', '', '/0/459/460/462', 'F', '无', 'job:sysJob:add', 460, 0, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2023-10-07 22:06:59.524', 0), +(463, 'sys_job', '修改定时任务', 'app-group-fill', '', '/0/459/460/463', 'F', '无', 'job:sysJob:edit', 460, 0, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2023-10-07 22:06:59.525', 0), +(464, 'sys_job', '删除定时任务', 'app-group-fill', '', '/0/459/460/464', 'F', '无', 'job:sysJob:remove', 460, 0, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2023-10-07 22:06:59.527', 0), +(471, 'JobLog', '日志', 'bug', '/schedule/log', '/0/459/471', 'C', '', '', 459, 0, '', '/schedule/log', 0, '1', '1', 1, 1, '2020-08-05 21:24:46.000', '2023-10-07 22:06:59.521', 0), +(528, 'SysApiManage', '接口管理', 'api-doc', '/admin/sys-api', '/0/2/528', 'C', '无', 'admin:sysApi:list', 2, 0, '', '/admin/sys-api/index', 0, '0', '0', 0, 1, '2021-05-20 22:08:44.526', '2023-10-07 22:06:59.458', 0), +(529, '', '查询接口', 'app-group-fill', '', '/0/2/528/529', 'F', '无', 'admin:sysApi:query', 528, 0, '', '', 40, '0', '0', 0, 1, '2021-05-20 22:08:44.526', '2023-10-07 22:06:59.528', 0), +(531, '', '修改接口', 'app-group-fill', '', '/0/2/528/531', 'F', '无', 'admin:sysApi:edit', 528, 0, '', '', 30, '0', '0', 0, 1, '2021-05-20 22:08:44.526', '2023-10-07 22:06:59.529', 0), +(537, 'SysTools', '系统工具', 'system-tools', '/sys-tools', '/0/537', 'M', '', '', 0, 0, '', 'Layout', 30, '0', '1', 1, 1, '2021-05-21 11:13:32.166', '2023-10-07 22:06:59.444', 0); + +DROP TABLE IF EXISTS `sys_menu_api_rule`; +CREATE TABLE `sys_menu_api_rule` ( + `sys_menu_menu_id` bigint NOT NULL, + `sys_api_id` bigint NOT NULL COMMENT '主键编码', + PRIMARY KEY (`sys_menu_menu_id`,`sys_api_id`), + KEY `fk_sys_menu_api_rule_sys_api` (`sys_api_id`), + CONSTRAINT `fk_sys_menu_api_rule_sys_api` FOREIGN KEY (`sys_api_id`) REFERENCES `sys_api` (`id`), + CONSTRAINT `fk_sys_menu_api_rule_sys_menu` FOREIGN KEY (`sys_menu_menu_id`) REFERENCES `sys_menu` (`menu_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +INSERT INTO `sys_menu_api_rule` (`sys_menu_menu_id`, `sys_api_id`) VALUES +(216, 6), +(250, 6), +(58, 21), +(236, 21), +(238, 23), +(59, 24), +(240, 24), +(242, 25), +(58, 26), +(236, 26), +(56, 27), +(228, 27), +(230, 28), +(226, 29), +(51, 39), +(222, 39), +(221, 41), +(52, 44), +(225, 44), +(226, 45), +(226, 46), +(226, 47), +(62, 53), +(244, 53), +(246, 54), +(57, 59), +(232, 59), +(234, 60), +(241, 80), +(237, 81), +(229, 82), +(245, 87), +(220, 88), +(233, 89), +(224, 90), +(531, 92), +(242, 101), +(238, 102), +(230, 103), +(226, 106), +(226, 107), +(246, 108), +(221, 109), +(234, 110), +(249, 114), +(251, 115), +(243, 120), +(239, 121), +(231, 122), +(247, 125), +(223, 126), +(235, 127), +(227, 128), +(51, 135), +(528, 135), +(529, 135), +(531, 136), +(212, 137), +(248, 137), +(542, 139), +(540, 140), +(3, 141), +(44, 141), +(45, 142), +(43, 150), +(45, 151), +(46, 156); + +DROP TABLE IF EXISTS `sys_migration`; +CREATE TABLE `sys_migration` ( + `version` varchar(191) NOT NULL, + `apply_time` datetime(3) DEFAULT NULL, + PRIMARY KEY (`version`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +INSERT INTO `sys_migration` (`version`, `apply_time`) VALUES +('1599190683659', '2023-10-07 22:06:59.438'), +('1653638869132', '2023-10-07 22:06:59.533'); + +DROP TABLE IF EXISTS `sys_opera_log`; +CREATE TABLE `sys_opera_log` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键编码', + `title` varchar(255) DEFAULT NULL COMMENT '操作模块', + `business_type` varchar(128) DEFAULT NULL COMMENT '操作类型', + `business_types` varchar(128) DEFAULT NULL COMMENT 'BusinessTypes', + `method` varchar(128) DEFAULT NULL COMMENT '函数', + `request_method` varchar(128) DEFAULT NULL COMMENT '请求方式: GET POST PUT DELETE', + `operator_type` varchar(128) DEFAULT NULL COMMENT '操作类型', + `oper_name` varchar(128) DEFAULT NULL COMMENT '操作者', + `dept_name` varchar(128) DEFAULT NULL COMMENT '部门名称', + `oper_url` varchar(255) DEFAULT NULL COMMENT '访问地址', + `oper_ip` varchar(128) DEFAULT NULL COMMENT '客户端ip', + `oper_location` varchar(128) DEFAULT NULL COMMENT '访问位置', + `oper_param` text COMMENT '请求参数', + `status` varchar(4) DEFAULT NULL COMMENT '操作状态 1:正常 2:关闭', + `oper_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '操作时间', + `json_result` varchar(255) DEFAULT NULL COMMENT '返回数据', + `remark` varchar(255) DEFAULT NULL COMMENT '备注', + `latency_time` varchar(128) DEFAULT NULL COMMENT '耗时', + `user_agent` varchar(255) DEFAULT NULL COMMENT 'ua', + `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间', + `updated_at` datetime(3) DEFAULT NULL COMMENT '最后更新时间', + `create_by` bigint DEFAULT NULL COMMENT '创建者', + `update_by` bigint DEFAULT NULL COMMENT '更新者', + PRIMARY KEY (`id`), + KEY `idx_sys_opera_log_create_by` (`create_by`), + KEY `idx_sys_opera_log_update_by` (`update_by`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + + +DROP TABLE IF EXISTS `sys_post`; +CREATE TABLE `sys_post` ( + `post_id` bigint NOT NULL AUTO_INCREMENT, + `post_name` varchar(128) DEFAULT NULL, + `post_code` varchar(128) DEFAULT NULL, + `sort` tinyint DEFAULT NULL, + `status` tinyint DEFAULT NULL, + `remark` varchar(255) DEFAULT NULL, + `create_by` bigint DEFAULT NULL COMMENT '创建者', + `update_by` bigint DEFAULT NULL COMMENT '更新者', + `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间', + `updated_at` datetime(3) DEFAULT NULL COMMENT '最后更新时间', + `deleted_at` tinyint(1) NOT NULL DEFAULT '0' COMMENT '删除状态', + PRIMARY KEY (`post_id`), + KEY `idx_sys_post_create_by` (`create_by`), + KEY `idx_sys_post_update_by` (`update_by`), + KEY `idx_sys_post_deleted_at` (`deleted_at`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +INSERT INTO `sys_post` (`post_id`, `post_name`, `post_code`, `sort`, `status`, `remark`, `create_by`, `update_by`, `created_at`, `updated_at`, `deleted_at`) VALUES +(1, '首席执行官', 'CEO', 0, 2, '首席执行官', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', 0), +(2, '首席技术执行官', 'CTO', 2, 2, '首席技术执行官', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', 0), +(3, '首席运营官', 'COO', 3, 2, '测试工程师', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', 0); + +DROP TABLE IF EXISTS `sys_role`; +CREATE TABLE `sys_role` ( + `role_id` bigint NOT NULL AUTO_INCREMENT, + `role_name` varchar(128) DEFAULT NULL, + `status` varchar(4) DEFAULT NULL, + `role_key` varchar(128) DEFAULT NULL, + `role_sort` bigint DEFAULT NULL, + `flag` varchar(128) DEFAULT NULL, + `remark` varchar(255) DEFAULT NULL, + `admin` tinyint(1) DEFAULT NULL, + `data_scope` varchar(128) DEFAULT NULL, + `create_by` bigint DEFAULT NULL COMMENT '创建者', + `update_by` bigint DEFAULT NULL COMMENT '更新者', + `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间', + `updated_at` datetime(3) DEFAULT NULL COMMENT '最后更新时间', + `deleted_at` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态', + PRIMARY KEY (`role_id`), + KEY `idx_sys_role_update_by` (`update_by`), + KEY `idx_sys_role_deleted_at` (`deleted_at`), + KEY `idx_sys_role_create_by` (`create_by`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +INSERT INTO `sys_role` (`role_id`, `role_name`, `status`, `role_key`, `role_sort`, `flag`, `remark`, `admin`, `data_scope`, `create_by`, `update_by`, `created_at`, `updated_at`, `deleted_at`) VALUES +(1, '系统管理员', '2', 'admin', 1, '', '', 1, '', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', 0); + +DROP TABLE IF EXISTS `sys_role_dept`; +CREATE TABLE `sys_role_dept` ( + `role_id` smallint NOT NULL, + `dept_id` smallint NOT NULL, + PRIMARY KEY (`role_id`,`dept_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + + +DROP TABLE IF EXISTS `sys_role_menu`; +CREATE TABLE `sys_role_menu` ( + `role_id` bigint NOT NULL, + `menu_id` bigint NOT NULL, + PRIMARY KEY (`role_id`,`menu_id`), + KEY `fk_sys_role_menu_sys_menu` (`menu_id`), + CONSTRAINT `fk_sys_role_menu_sys_menu` FOREIGN KEY (`menu_id`) REFERENCES `sys_menu` (`menu_id`), + CONSTRAINT `fk_sys_role_menu_sys_role` FOREIGN KEY (`role_id`) REFERENCES `sys_role` (`role_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + + +DROP TABLE IF EXISTS `sys_tables`; +CREATE TABLE `sys_tables` ( + `table_id` bigint NOT NULL AUTO_INCREMENT, + `table_name` varchar(255) DEFAULT NULL, + `table_comment` varchar(255) DEFAULT NULL, + `class_name` varchar(255) DEFAULT NULL, + `tpl_category` varchar(255) DEFAULT NULL, + `package_name` varchar(255) DEFAULT NULL, + `module_name` varchar(255) DEFAULT NULL, + `module_front_name` varchar(255) DEFAULT NULL COMMENT '前端文件名', + `business_name` varchar(255) DEFAULT NULL, + `function_name` varchar(255) DEFAULT NULL, + `function_author` varchar(255) DEFAULT NULL, + `pk_column` varchar(255) DEFAULT NULL, + `pk_go_field` varchar(255) DEFAULT NULL, + `pk_json_field` varchar(255) DEFAULT NULL, + `options` varchar(255) DEFAULT NULL, + `tree_code` varchar(255) DEFAULT NULL, + `tree_parent_code` varchar(255) DEFAULT NULL, + `tree_name` varchar(255) DEFAULT NULL, + `tree` tinyint(1) DEFAULT '0', + `crud` tinyint(1) DEFAULT '1', + `remark` varchar(255) DEFAULT NULL, + `is_data_scope` tinyint DEFAULT NULL, + `is_actions` tinyint DEFAULT NULL, + `is_auth` tinyint DEFAULT NULL, + `is_logical_delete` varchar(1) DEFAULT NULL, + `logical_delete` tinyint(1) DEFAULT NULL, + `logical_delete_column` varchar(128) DEFAULT NULL, + `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间', + `updated_at` datetime(3) DEFAULT NULL COMMENT '最后更新时间', + `deleted_at` tinyint(1) NOT NULL DEFAULT '0' COMMENT '删除状态', + `create_by` bigint DEFAULT NULL COMMENT '创建者', + `update_by` bigint DEFAULT NULL COMMENT '更新者', + PRIMARY KEY (`table_id`), + KEY `idx_sys_tables_update_by` (`update_by`), + KEY `idx_sys_tables_deleted_at` (`deleted_at`), + KEY `idx_sys_tables_create_by` (`create_by`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + + +DROP TABLE IF EXISTS `sys_user`; +CREATE TABLE `sys_user` ( + `user_id` bigint NOT NULL AUTO_INCREMENT COMMENT '编码', + `username` varchar(64) DEFAULT NULL COMMENT '用户名', + `password` varchar(128) DEFAULT NULL COMMENT '密码', + `nick_name` varchar(128) DEFAULT NULL COMMENT '昵称', + `phone` varchar(11) DEFAULT NULL COMMENT '手机号', + `role_id` bigint DEFAULT NULL COMMENT '角色ID', + `salt` varchar(255) DEFAULT NULL COMMENT '加盐', + `avatar` varchar(255) DEFAULT NULL COMMENT '头像', + `sex` varchar(255) DEFAULT NULL COMMENT '性别', + `email` varchar(128) DEFAULT NULL COMMENT '邮箱', + `dept_id` bigint DEFAULT NULL COMMENT '部门', + `post_id` bigint DEFAULT NULL COMMENT '岗位', + `remark` varchar(255) DEFAULT NULL COMMENT '备注', + `status` varchar(4) DEFAULT NULL COMMENT '状态', + `create_by` bigint DEFAULT NULL COMMENT '创建者', + `update_by` bigint DEFAULT NULL COMMENT '更新者', + `created_at` datetime(3) DEFAULT NULL COMMENT '创建时间', + `updated_at` datetime(3) DEFAULT NULL COMMENT '最后更新时间', + `deleted_at` tinyint(1) NOT NULL DEFAULT '0' COMMENT '删除状态', + PRIMARY KEY (`user_id`), + KEY `idx_sys_user_deleted_at` (`deleted_at`), + KEY `idx_sys_user_create_by` (`create_by`), + KEY `idx_sys_user_update_by` (`update_by`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +INSERT INTO `sys_user` (`user_id`, `username`, `password`, `nick_name`, `phone`, `role_id`, `salt`, `avatar`, `sex`, `email`, `dept_id`, `post_id`, `remark`, `status`, `create_by`, `update_by`, `created_at`, `updated_at`, `deleted_at`) VALUES +(1, 'admin', '$2a$10$4OSTPXRkCVZV7JEZT27OIevOuKOs6k2kOKSh4phm.NXhHeVgC1nQG', 'admin', '13524084051', 1, '', '', '0', 'nice.lizhi@gmail.com', 1, 2, 'admin', '2', 1, 1, '2021-05-13 19:56:37.914', '2023-11-01 13:26:12.236', 0); + +-- 2023-11-05 02:47:37 \ No newline at end of file diff --git a/docs/guide/install/docker-composer.md b/docs/guide/install/docker-composer.md index 9c6b45a..da48f46 100644 --- a/docs/guide/install/docker-composer.md +++ b/docs/guide/install/docker-composer.md @@ -34,7 +34,7 @@ services: command: mysqld environment: - TZ=Asia/Shanghai - - MYSQL_ROOT_PASSWORD=GoAdmin + - MYSQL_ROOT_PASSWORD=EasyAdmin volumes: - /etc/localtime:/etc/localtime:ro - ./data:/var/lib/mysql/data diff --git a/go.mod b/go.mod index e23e153..1fd7df2 100644 --- a/go.mod +++ b/go.mod @@ -37,6 +37,7 @@ require ( gorm.io/driver/sqlite v1.5.4 gorm.io/driver/sqlserver v1.4.1 gorm.io/gorm v1.25.5 + gorm.io/plugin/soft_delete v1.2.1 ) require ( @@ -110,7 +111,6 @@ require ( github.com/nicelizhi/easy-admin-core/plugins/logger/zap v0.0.0-00010101000000-000000000000 // indirect github.com/nicksnyder/go-i18n/v2 v2.2.1 // indirect github.com/nsqio/go-nsq v1.0.8 // indirect - github.com/nxadm/tail v1.4.8 // indirect github.com/nyaruka/phonenumbers v1.0.55 // indirect github.com/pelletier/go-toml/v2 v2.0.9 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect diff --git a/template/api_migrate.template b/template/api_migrate.template index a4ac037..24119f6 100644 --- a/template/api_migrate.template +++ b/template/api_migrate.template @@ -1,7 +1,7 @@ package version import ( - "gorm.io/gorm" + "gorm.io/plugin/soft_delete" "runtime" "time" @@ -32,7 +32,7 @@ type Menu struct { IsFrame string `json:"isFrame" gorm:"size:1;DEFAULT:0;"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` - DeletedAt *time.Time `json:"deletedAt"` + DeletedAt soft_delete.DeletedAt `json:"deletedAt"` } func (Menu) TableName() string {