T14 数据迁移工具 S1/S2 阶段: S1 基础设施: - source_app/migrate_task 建表 + 实体 + Mapper - TencentImClient 双密钥 callApiAs(老应用拉取,不走主应用限流,审计记 migrate) - 后台「老应用配置」页(CRUD + 测试连通) S2 用户迁移: - batchImport(multiaccount_import,每批≤100) - MigrateService.migrateUsers(前缀转换+导入+映射+校验,幂等) - 后台「数据迁移」页(上传清单文件/粘贴列表 + 任务记录) 联调通过:3用户清单→加sa前缀→腾讯导入OK→user_mapping→校验3/3/3。 Co-Authored-By: Claude <noreply@anthropic.com>
55 lines
1.2 KiB
Java
55 lines
1.2 KiB
Java
package com.imutil.service.impl;
|
|
|
|
import com.imutil.entity.SourceApp;
|
|
import com.imutil.mapper.SourceAppMapper;
|
|
import com.imutil.service.SourceAppService;
|
|
import org.noear.solon.annotation.Component;
|
|
import org.noear.solon.annotation.Inject;
|
|
|
|
import java.util.List;
|
|
|
|
/**
|
|
* 老应用配置服务实现
|
|
*
|
|
* @author imutil
|
|
*/
|
|
@Component
|
|
public class SourceAppServiceImpl implements SourceAppService {
|
|
|
|
@Inject
|
|
private SourceAppMapper sourceAppMapper;
|
|
|
|
@Override
|
|
public List<SourceApp> list() {
|
|
return sourceAppMapper.selectList(null);
|
|
}
|
|
|
|
@Override
|
|
public SourceApp getById(Long id) {
|
|
if (id == null) {
|
|
return null;
|
|
}
|
|
return sourceAppMapper.selectById(id);
|
|
}
|
|
|
|
@Override
|
|
public void save(SourceApp app) {
|
|
if (app.getId() == null) {
|
|
if (app.getStatus() == null) {
|
|
app.setStatus(1);
|
|
}
|
|
sourceAppMapper.insert(app);
|
|
} else {
|
|
sourceAppMapper.updateById(app);
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void toggle(Long id, Integer status) {
|
|
SourceApp app = new SourceApp();
|
|
app.setId(id);
|
|
app.setStatus(status == null ? 0 : status);
|
|
sourceAppMapper.updateById(app);
|
|
}
|
|
}
|