feat(admin): 添加账号批量调度开关功能
- 后端:支持批量更新账号的 schedulable 字段 - 在 BulkUpdateAccountsRequest 中添加 schedulable 参数 - 在 AccountBulkUpdate 中添加 schedulable 字段支持 - 更新 repository 层批量更新 SQL 逻辑 - 前端:在账号管理页面添加批量调度控制 - 新增"批量启用调度"和"批量停止调度"按钮 - 添加 handleBulkToggleSchedulable 处理函数 - 显示具体的成功提示信息(包含操作账号数量) - 国际化:添加批量调度相关中英文翻译 - 优化:添加 search 参数标准化和验证(account_handler)
This commit is contained in:
@@ -831,6 +831,11 @@ func (r *accountRepository) BulkUpdate(ctx context.Context, ids []int64, updates
|
||||
args = append(args, *updates.Status)
|
||||
idx++
|
||||
}
|
||||
if updates.Schedulable != nil {
|
||||
setClauses = append(setClauses, "schedulable = $"+itoa(idx))
|
||||
args = append(args, *updates.Schedulable)
|
||||
idx++
|
||||
}
|
||||
// JSONB 需要合并而非覆盖,使用 raw SQL 保持旧行为。
|
||||
if len(updates.Credentials) > 0 {
|
||||
payload, err := json.Marshal(updates.Credentials)
|
||||
|
||||
Reference in New Issue
Block a user