urbanu hai 1 mes
pai
achega
6c80e562b5

+ 0 - 1
model/biz_modules/daytask/dt_material.go

@@ -6,7 +6,6 @@ type DtMaterial struct {
 	Name      string `json:"name" gorm:"column:name;type:varchar(128);not null;comment:文件名"`
 	Name      string `json:"name" gorm:"column:name;type:varchar(128);not null;comment:文件名"`
 	Path      string `json:"path" gorm:"column:path;type:varchar(512);not null;comment:文件路径"`
 	Path      string `json:"path" gorm:"column:path;type:varchar(512);not null;comment:文件路径"`
 	Url       string `json:"url" gorm:"column:url;type:varchar(512);not null;comment:访问URL"`
 	Url       string `json:"url" gorm:"column:url;type:varchar(512);not null;comment:访问URL"`
-	Cover     string `json:"cover" gorm:"column:cover;type:varchar(512);comment:封面图URL(视频/音频)"`
 	Type      string `json:"type" gorm:"column:type;type:varchar(32);not null;index:idx_type;comment:类型: image/video/audio/document"`
 	Type      string `json:"type" gorm:"column:type;type:varchar(32);not null;index:idx_type;comment:类型: image/video/audio/document"`
 	MimeType  string `json:"mimeType" gorm:"column:mime_type;type:varchar(128);comment:MIME类型"`
 	MimeType  string `json:"mimeType" gorm:"column:mime_type;type:varchar(128);comment:MIME类型"`
 	Size      int64  `json:"size" gorm:"column:size;type:bigint;default:0;comment:文件大小(字节)"`
 	Size      int64  `json:"size" gorm:"column:size;type:bigint;default:0;comment:文件大小(字节)"`

+ 4 - 0
service/daytask/dt_material.go

@@ -95,6 +95,7 @@ func (s *DtMaterialGroupService) Find(c *gin.Context) {
 		base.ListRequest[T]
 		base.ListRequest[T]
 		Id       *int64  `form:"id"`
 		Id       *int64  `form:"id"`
 		Name     *string `form:"name"`
 		Name     *string `form:"name"`
+		Code     *string `form:"code"`
 		ParentId *int64  `form:"parentId"`
 		ParentId *int64  `form:"parentId"`
 	}
 	}
 	req := new(request[model.DtMaterialGroup])
 	req := new(request[model.DtMaterialGroup])
@@ -109,6 +110,9 @@ func (s *DtMaterialGroupService) Find(c *gin.Context) {
 	if req.Name != nil && *req.Name != "" {
 	if req.Name != nil && *req.Name != "" {
 		db = db.Where("name LIKE ?", "%"+*req.Name+"%")
 		db = db.Where("name LIKE ?", "%"+*req.Name+"%")
 	}
 	}
+	if req.Code != nil && *req.Code != "" {
+		db = db.Where("code", req.Code)
+	}
 	if req.ParentId != nil {
 	if req.ParentId != nil {
 		db = db.Where("parent_id", req.ParentId)
 		db = db.Where("parent_id", req.ParentId)
 	}
 	}