| | |
| | | // client.WithOffset(offset),
|
| | | )
|
| | |
|
| | | if err != nil {
|
| | |
|
| | | }
|
| | |
|
| | | // 2. 提取ID和文件路径
|
| | | var ids []int64
|
| | | var imgPaths []string
|
| | |
| | | if err != nil {
|
| | | return 0, fmt.Errorf("failed to delete from Milvus: %v", err)
|
| | | }
|
| | | err = do.client.client.DeleteByPks(ctx, "smartrag", "", idField)
|
| | | if err != nil {
|
| | | return 0, fmt.Errorf("failed to delete from Milvus: %v", err)
|
| | | }
|
| | | }
|
| | |
|
| | | // 图片删除文件
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | //删除rag
|
| | | err = do.client.client.Delete(ctx, "smartrag", "", filterExpr)
|
| | | if err != nil {
|
| | | logger.Debug("delete rag failed!")
|
| | | }
|
| | |
|
| | | return deletedFiles, err
|
| | | }
|
| | |
|
| | |
| | | sqls = append(sqls, "INSERT INTO sys_menu(`id`,`parent_id`,`parent_ids`,`type`,`name`,`module`,`permission`,`sort`,`icon`,`url`,`enable`,`del_flag`) select '"+uuid.NewV4().String()+"', '"+a.Id+"', ',0,"+a.Id+",', 1, '键盘和语言', 'SETTINGS', 'settings:keyboard', 5, NULL, NULL, 1, 0 where not exists (select 1 from sys_menu where permission='settings:keyboard');") |
| | | sqls = append(sqls, "INSERT INTO sys_menu(`id`,`parent_id`,`parent_ids`,`type`,`name`,`module`,`permission`,`sort`,`icon`,`url`,`enable`,`del_flag`) select '"+uuid.NewV4().String()+"', '"+a.Id+"', ',0,"+a.Id+",', 1, '通用设置', 'SETTINGS', 'settings:common', 6, NULL, NULL, 1, 0 where not exists (select 1 from sys_menu where permission='settings:common');") |
| | | sqls = append(sqls, "INSERT INTO sys_menu(`id`,`parent_id`,`parent_ids`,`type`,`name`,`module`,`permission`,`sort`,`icon`,`url`,`enable`,`del_flag`) select '"+uuid.NewV4().String()+"', '"+a.Id+"', ',0,"+a.Id+",', 1, '设备信息', 'SETTINGS', 'settings:sysInfo', 7, NULL, NULL, 1, 0 where not exists (select 1 from sys_menu where permission='settings:sysInfo');") |
| | | sqls = append(sqls, "INSERT INTO sys_menu(`id`,`parent_id`,`parent_ids`,`type`,`name`,`module`,`permission`,`sort`,`icon`,`url`,`enable`,`del_flag`) select '"+uuid.NewV4().String()+"', '"+a.Id+"', ',0,"+a.Id+",', 1, '权限管理', 'SETTINGS', 'settings:permission', 8, NULL, NULL, 1, 0 where not exists (select 1 from sys_menu where permission='settings:permission');") |
| | | sqls = append(sqls, "INSERT INTO sys_menu(`id`,`parent_id`,`parent_ids`,`type`,`name`,`module`,`permission`,`sort`,`icon`,`url`,`enable`,`del_flag`) select '"+uuid.NewV4().String()+"', '"+a.Id+"', ',0,"+a.Id+",', 1, '授权管理', 'SETTINGS', 'settings:permission', 8, NULL, NULL, 1, 0 where not exists (select 1 from sys_menu where permission='settings:permission');") |
| | | sqls = append(sqls, "INSERT INTO sys_menu(`id`,`parent_id`,`parent_ids`,`type`,`name`,`module`,`permission`,`sort`,`icon`,`url`,`enable`,`del_flag`) select '"+uuid.NewV4().String()+"', '"+a.Id+"', ',0,"+a.Id+",', 1, '设备管理', 'SETTINGS', 'settings:device', 9, NULL, NULL, 1, 0 where not exists (select 1 from sys_menu where permission='settings:device');") |
| | | sqls = append(sqls, "INSERT INTO sys_menu(`id`,`parent_id`,`parent_ids`,`type`,`name`,`module`,`permission`,`sort`,`icon`,`url`,`enable`,`del_flag`) select '"+uuid.NewV4().String()+"', '"+a.Id+"', ',0,"+a.Id+",', 1, '检测内容', 'SETTINGS', 'settings:content', 10, NULL, NULL, 1, 0 where not exists (select 1 from sys_menu where permission='settings:content');") |
| | | sqls = append(sqls, "INSERT INTO sys_menu(`id`,`parent_id`,`parent_ids`,`type`,`name`,`module`,`permission`,`sort`,`icon`,`url`,`enable`,`del_flag`) select '"+uuid.NewV4().String()+"', '"+a.Id+"', ',0,"+a.Id+",', 1, '预警规则', 'SETTINGS', 'settings:rule', 11, NULL, NULL, 1, 0 where not exists (select 1 from sys_menu where permission='settings:rule');") |
| | |
| | | |
| | | } else if a.Package == "dataStack" { |
| | | sort = 13 |
| | | sqls = append(sqls, "INSERT INTO sys_menu(`id`,`parent_id`,`parent_ids`,`type`,`name`,`module`,`permission`,`sort`,`icon`,`url`,`enable`,`del_flag`) select '"+uuid.NewV4().String()+"', '"+a.Id+"', ',0,"+a.Id+",', 1, '数据栈配置', 'DATASTACK', 'dataStack:cameraInfo', 1, NULL, NULL, 1, 0 where not exists (select 1 from sys_menu where permission='dataStack:cameraInfo');") |
| | | sqls = append(sqls, "INSERT INTO sys_menu(`id`,`parent_id`,`parent_ids`,`type`,`name`,`module`,`permission`,`sort`,`icon`,`url`,`enable`,`del_flag`) select '"+uuid.NewV4().String()+"', '"+a.Id+"', ',0,"+a.Id+",', 1, '数据栈信息', 'DATASTACK', 'dataStack:selfRule', 2, NULL, NULL, 1, 0 where not exists (select 1 from sys_menu where permission='dataStack:selfRule');") |
| | | sqls = append(sqls, "INSERT INTO sys_menu(`id`,`parent_id`,`parent_ids`,`type`,`name`,`module`,`permission`,`sort`,`icon`,`url`,`enable`,`del_flag`) select '"+uuid.NewV4().String()+"', '"+a.Id+"', ',0,"+a.Id+",', 1, '数据栈信息', 'DATASTACK', 'dataStack:cameraInfo', 1, NULL, NULL, 1, 0 where not exists (select 1 from sys_menu where permission='dataStack:cameraInfo');") |
| | | sqls = append(sqls, "INSERT INTO sys_menu(`id`,`parent_id`,`parent_ids`,`type`,`name`,`module`,`permission`,`sort`,`icon`,`url`,`enable`,`del_flag`) select '"+uuid.NewV4().String()+"', '"+a.Id+"', ',0,"+a.Id+",', 1, '独立场景', 'DATASTACK', 'dataStack:selfRule', 2, NULL, NULL, 1, 0 where not exists (select 1 from sys_menu where permission='dataStack:selfRule');") |
| | | |
| | | } |
| | | |