From 3677e93deafbdf0731f317dca936df0d753a7fe2 Mon Sep 17 00:00:00 2001 From: SliverHorn <503551462@qq.com> Date: Mon, 31 Aug 2020 16:10:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=B5=8B=E8=AF=95=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...7\243\346\265\213\350\257\225\346\226\207\346\241\243.md" | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git "a/server/GORMV2\346\216\245\345\217\243\346\265\213\350\257\225\346\226\207\346\241\243.md" "b/server/GORMV2\346\216\245\345\217\243\346\265\213\350\257\225\346\226\207\346\241\243.md" index 1e926003..a7876005 100644 --- "a/server/GORMV2\346\216\245\345\217\243\346\265\213\350\257\225\346\226\207\346\241\243.md" +++ "b/server/GORMV2\346\216\245\345\217\243\346\265\213\350\257\225\346\226\207\346\241\243.md" @@ -38,7 +38,6 @@ | /customer/customer | 删除客户 | √ | SliverHorn | | /customer/customer | 获取单一客户 | √ | SliverHorn | | /customer/customerList | 获取客户列表 | √ | SliverHorn | -| /casbin/casbinTest/:pathParam | RESTFUL模式测试 | | | | /autoCode/createTemp | 自动化代码 | √ | SliverHorn | | /authority/updateAuthority | 更新角色信息 | √ | SliverHorn | | /authority/copyAuthority | 拷贝角色 | √ | SliverHorn | @@ -55,7 +54,6 @@ | /sysDictionary/getSysDictionaryList | 获取字典列表 | √ | SliverHorn | | /sysOperationRecord/createSysOperationRecord | 新增操作记录 | √ | SliverHorn | | /sysOperationRecord/deleteSysOperationRecord | 删除操作记录 | √ | SliverHorn | -| /sysOperationRecord/updateSysOperationRecord | 更新操作记录 | | | | /sysOperationRecord/findSysOperationRecord | 根据ID获取操作记录 | √ | SliverHorn | | /sysOperationRecord/getSysOperationRecordList | 获取操作记录列表 | √ | SliverHorn | | /autoCode/getTables | 获取数据库表 | √ | SliverHorn | @@ -85,7 +83,7 @@ db.Where("name IN (?)", []string{"jinzhu", "jinzhu 2"}).Find(&users) ```go // V2版本代码(https://github.com/flipped-aurora/gin-vue-admin/blob/gva_gormv2_dev/server/service/sys_user.go) func Register(u model.SysUser) (err error, userInter model.SysUser) { - var user model.SysUser + var user model.SysUser if !errors.Is(global.GVA_DB.Where("username = ?", u.Username).First(&user).Error, gorm.ErrRecordNotFound){ // 判断用户名是否注册 return errors.New("用户名已注册"), userInter } @@ -95,6 +93,7 @@ func Register(u model.SysUser) (err error, userInter model.SysUser) { err = global.GVA_DB.Create(&u).Error return err, u } + // V1版本Register(https://github.com/flipped-aurora/gin-vue-admin/blob/master/server/service/sys_user.go) func Register(u model.SysUser) (err error, userInter model.SysUser) { var user model.SysUser -- GitLab