123456789101112131415161718192021222324252627 |
- package models
- import (
- "github.com/beego/beego/v2/client/orm"
- "time"
- )
- type MediaPermissionMapping struct {
- Id int `orm:"pk" description:"id"` // 主键
- PermissionId int `description:"权限ID"` // 权限 ID
- MediaId int `description:"媒体ID"` // 媒体 ID
- MediaType MediaType `description:"媒体类型"` // 媒体类型
- Deleted int `description:"是否删除"`
- CreatedTime time.Time `description:"创建时间"`
- UpdatedTime time.Time `description:"更新时间"`
- }
- // TableName returns the table name for this model.
- func (mp *MediaPermissionMapping) TableName() string {
- return "media_permission_mappings"
- }
- func DeleteMappingsById(mediaId int) (err error) {
- o := orm.NewOrm()
- _, err = o.QueryTable(new(MediaPermissionMapping)).Filter("media_id", mediaId).Update(orm.Params{"deleted": 1})
- return
- }
|