Explorar o código

报告添加主键

xyxie hai 2 meses
pai
achega
098cda95a1
Modificáronse 2 ficheiros con 2 adicións e 2 borrados
  1. 1 1
      models/report/report_chapter_grant.go
  2. 1 1
      models/report/report_grant.go

+ 1 - 1
models/report/report_chapter_grant.go

@@ -9,7 +9,7 @@ import (
 // ReportChapterGrant
 // @Description: 报告章节授权用户表
 type ReportChapterGrant struct {
-	GrantId         int       `orm:"column(grant_id)"` // 授权id
+	GrantId         int       `orm:"column(grant_id)" gorm:"column:grant_id;primaryKey"` // 授权id
 	ReportChapterId int       `description:"报告章节id"`
 	AdminId         int       `description:"授权的用户id"`
 	CreateTime      time.Time `description:"授权时间"`

+ 1 - 1
models/report/report_grant.go

@@ -9,7 +9,7 @@ import (
 // ReportGrant
 // @Description: 报告授权用户表
 type ReportGrant struct {
-	GrantId    int       `orm:"column(grant_id)"` // 授权id
+	GrantId    int       `orm:"column(grant_id)" gorm:"column:grant_id;primaryKey"` // 授权id
 	ReportId   int       `description:"报告id"`
 	AdminId    int       `description:"授权的用户id"`
 	CreateTime time.Time `description:"授权时间"`