Browse Source

Merge remote-tracking branch 'origin/master'

main
klausY 5 years ago
parent
commit
d81755b84a
  1. 2
      QMPlusServer/controller/api/exa_fileUploadAndDownload.go
  2. 4
      QMPlusServer/controller/api/sys_authority.go
  3. 4
      QMPlusServer/controller/api/sys_casbin.go
  4. 4
      QMPlusServer/controller/api/sys_system.go
  5. 2
      QMPlusServer/controller/api/sys_workFlow.go
  6. 10
      QMPlusServer/model/sysModel/sys_authority.go
  7. 8
      README.md

2
QMPlusServer/controller/api/exa_fileUploadAndDownload.go

@ -56,7 +56,7 @@ func UploadFile(c *gin.Context) {
// @Router /fileUploadAndDownload/deleteFile [post] // @Router /fileUploadAndDownload/deleteFile [post]
func DeleteFile(c *gin.Context) { func DeleteFile(c *gin.Context) {
var file dbModel.ExaFileUploadAndDownload var file dbModel.ExaFileUploadAndDownload
_ = c.ShouldBind(&file)
_ = c.ShouldBindJSON(&file)
err, f := file.FindFile() err, f := file.FindFile()
if err != nil { if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("删除失败,%v", err), gin.H{}) servers.ReportFormat(c, false, fmt.Sprintf("删除失败,%v", err), gin.H{})

4
QMPlusServer/controller/api/sys_authority.go

@ -23,7 +23,7 @@ type CreateAuthorityParams struct {
// @Router /authority/createAuthority [post] // @Router /authority/createAuthority [post]
func CreateAuthority(c *gin.Context) { func CreateAuthority(c *gin.Context) {
var auth sysModel.SysAuthority var auth sysModel.SysAuthority
_ = c.ShouldBind(&auth)
_ = c.ShouldBindJSON(&auth)
err, authBack := auth.CreateAuthority() err, authBack := auth.CreateAuthority()
if err != nil { if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("创建失败:%v", err), gin.H{ servers.ReportFormat(c, false, fmt.Sprintf("创建失败:%v", err), gin.H{
@ -94,7 +94,7 @@ func GetAuthorityList(c *gin.Context) {
// @Router /authority/setDataAuthority [post] // @Router /authority/setDataAuthority [post]
func SetDataAuthority(c *gin.Context) { func SetDataAuthority(c *gin.Context) {
var auth sysModel.SysAuthority var auth sysModel.SysAuthority
_ = c.ShouldBind(&auth)
_ = c.ShouldBindJSON(&auth)
err := auth.SetDataAuthority() err := auth.SetDataAuthority()
if err != nil { if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("设置关联失败,%v", err), gin.H{}) servers.ReportFormat(c, false, fmt.Sprintf("设置关联失败,%v", err), gin.H{})

4
QMPlusServer/controller/api/sys_casbin.go

@ -17,7 +17,7 @@ import (
// @Router /casbin/casbinPUpdata [post] // @Router /casbin/casbinPUpdata [post]
func CasbinPUpdata(c *gin.Context) { func CasbinPUpdata(c *gin.Context) {
var cmr sysModel.CasbinInReceive var cmr sysModel.CasbinInReceive
_ = c.ShouldBind(&cmr)
_ = c.ShouldBindJSON(&cmr)
err := new(sysModel.CasbinModel).CasbinPUpdata(cmr.AuthorityId, cmr.CasbinInfos) err := new(sysModel.CasbinModel).CasbinPUpdata(cmr.AuthorityId, cmr.CasbinInfos)
if err != nil { if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("添加规则失败,%v", err), gin.H{}) servers.ReportFormat(c, false, fmt.Sprintf("添加规则失败,%v", err), gin.H{})
@ -36,7 +36,7 @@ func CasbinPUpdata(c *gin.Context) {
// @Router /casbin/getPolicyPathByAuthorityId [post] // @Router /casbin/getPolicyPathByAuthorityId [post]
func GetPolicyPathByAuthorityId(c *gin.Context) { func GetPolicyPathByAuthorityId(c *gin.Context) {
var cmr sysModel.CasbinInReceive var cmr sysModel.CasbinInReceive
_ = c.ShouldBind(&cmr)
_ = c.ShouldBindJSON(&cmr)
paths := new(sysModel.CasbinModel).GetPolicyPathByAuthorityId(cmr.AuthorityId) paths := new(sysModel.CasbinModel).GetPolicyPathByAuthorityId(cmr.AuthorityId)
servers.ReportFormat(c, true, "获取规则成功", gin.H{"paths": paths}) servers.ReportFormat(c, true, "获取规则成功", gin.H{"paths": paths})
} }

4
QMPlusServer/controller/api/sys_system.go

@ -31,7 +31,7 @@ func GetSystemConfig(c *gin.Context) {
// @Router /system/setSystemConfig [post] // @Router /system/setSystemConfig [post]
func SetSystemConfig(c *gin.Context) { func SetSystemConfig(c *gin.Context) {
var sys sysModel.System var sys sysModel.System
_ = c.ShouldBind(&sys)
_ = c.ShouldBindJSON(&sys)
err := sys.SetSystemConfig() err := sys.SetSystemConfig()
if err != nil { if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("设置失败:%v", err), gin.H{}) servers.ReportFormat(c, false, fmt.Sprintf("设置失败:%v", err), gin.H{})
@ -49,7 +49,7 @@ func SetSystemConfig(c *gin.Context) {
// @Router /system/ReloadSystem [post] // @Router /system/ReloadSystem [post]
func ReloadSystem(c *gin.Context) { func ReloadSystem(c *gin.Context) {
var sys sysModel.System var sys sysModel.System
_ = c.ShouldBind(&sys)
_ = c.ShouldBindJSON(&sys)
err := sys.SetSystemConfig() err := sys.SetSystemConfig()
if err != nil { if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("设置失败:%v", err), gin.H{}) servers.ReportFormat(c, false, fmt.Sprintf("设置失败:%v", err), gin.H{})

2
QMPlusServer/controller/api/sys_workFlow.go

@ -15,7 +15,7 @@ import (
// @Router /workflow/createWorkFlow [post] // @Router /workflow/createWorkFlow [post]
func CreateWorkFlow(c *gin.Context) { func CreateWorkFlow(c *gin.Context) {
var wk sysModel.SysWorkflow var wk sysModel.SysWorkflow
_ = c.ShouldBind(&wk)
_ = c.ShouldBindJSON(&wk)
err := wk.Create() err := wk.Create()
if err != nil { if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("获取失败:%v", err), gin.H{}) servers.ReportFormat(c, false, fmt.Sprintf("获取失败:%v", err), gin.H{})

10
QMPlusServer/model/sysModel/sys_authority.go

@ -27,7 +27,7 @@ func (a *SysAuthority) CreateAuthority() (err error, authority *SysAuthority) {
func (a *SysAuthority) DeleteAuthority() (err error) { func (a *SysAuthority) DeleteAuthority() (err error) {
err = qmsql.DEFAULTDB.Where("authority_id = ?", a.AuthorityId).Find(&SysUser{}).Error err = qmsql.DEFAULTDB.Where("authority_id = ?", a.AuthorityId).Find(&SysUser{}).Error
if err != nil { if err != nil {
err = qmsql.DEFAULTDB.Where("parentId = ?", a.AuthorityId).Find(&SysAuthority{}).Error
err = qmsql.DEFAULTDB.Where("parent_id = ?", a.AuthorityId).Find(&SysAuthority{}).Error
if err != nil { if err != nil {
err = qmsql.DEFAULTDB.Where("authority_id = ?", a.AuthorityId).First(a).Unscoped().Delete(a).Error err = qmsql.DEFAULTDB.Where("authority_id = ?", a.AuthorityId).First(a).Unscoped().Delete(a).Error
new(CasbinModel).clearCasbin(0, a.AuthorityId) new(CasbinModel).clearCasbin(0, a.AuthorityId)
@ -75,7 +75,7 @@ func (a *SysAuthority) SetDataAuthority() error {
return err return err
} }
func (a *SysAuthority) GetAuthorityInfo() (err error,sa SysAuthority) {
err = qmsql.DEFAULTDB.Preload("DataAuthorityId").Where("authority_id = ?",a.AuthorityId).First(&sa).Error
return err,sa
}
func (a *SysAuthority) GetAuthorityInfo() (err error, sa SysAuthority) {
err = qmsql.DEFAULTDB.Preload("DataAuthorityId").Where("authority_id = ?", a.AuthorityId).First(&sa).Error
return err, sa
}

8
README.md

@ -10,6 +10,14 @@
<img src="https://img.shields.io/badge/gorm-1.9.10-red"/> <img src="https://img.shields.io/badge/gorm-1.9.10-red"/>
</div> </div>
# 开发者(贡献者)列表
| 开发者 | 功能 | 姓名 |
| ---- | ---- | ---- |
| [@piexlmax](https://github.com/piexlmax) | 项目发起者 | 蒋\*兆 |
| [@krank666](https://github.com/krank666) | 前端联合作者 | 尹\* |
| [@1319612909](https://github.com/1319612909) | 前端css优化 | 杜\*兰 |
| [@granty1](https://github.com/granty1) | 代码积极贡献者 | 印\*林 |
# gin-vue-admin gin+vue开源快速项目模板 # gin-vue-admin gin+vue开源快速项目模板
更新代码后如果遇到前端报错请执行 npm i 前端开发会不定期增加新的依赖 请注意更新 更新代码后如果遇到前端报错请执行 npm i 前端开发会不定期增加新的依赖 请注意更新

Loading…
Cancel
Save