Commit 20978507 by 陶光胜

配置表

parent f2256ee2
......@@ -28,7 +28,7 @@ import java.util.*;
public class CustomSettingApiServiceImpl implements CustomSettingApiService {
private static final Logger log = LogManager.getLogger(CustomSettingApiServiceImpl.class);
private static final String DATABASENAME = "custom_table";
private static final String PRIMARYKEY = "_id";
private static final String PRIMARYKEY = "id";
@Autowired
private MongoOperApiService mongoOperApiService;
@Autowired
......@@ -78,7 +78,7 @@ public class CustomSettingApiServiceImpl implements CustomSettingApiService {
//更新
map.put("update_time", date);
MongoUpdateDTO mongoUpdateDTO = new MongoUpdateDTO();
mongoUpdateDTO.setDataBaseAndCollectionName(DATABASENAME, tableName);
mongoUpdateDTO.setDataBaseAndCollectionName(DATABASENAME, tableName, PRIMARYKEY);
mongoUpdateDTO.setData(map);
ServiceResponse<Integer> update = mongoOperApiService.update(mongoUpdateDTO);
log.info("update:{},{}", JSON.toJSONString(map), JSON.toJSONString(update));
......@@ -87,7 +87,7 @@ public class CustomSettingApiServiceImpl implements CustomSettingApiService {
map.put("create_time", date);
MongoSaveDTO mongoSaveDTO = new MongoSaveDTO();
map.put(PRIMARYKEY, ToolUtil.randomUUID());
mongoSaveDTO.setDataBaseAndCollectionName(DATABASENAME, tableName);
mongoSaveDTO.setDataBaseAndCollectionName(DATABASENAME, tableName, PRIMARYKEY);
mongoSaveDTO.setData(map);
ServiceResponse<String> save = mongoOperApiService.save(mongoSaveDTO);
log.info("save:{}", JSON.toJSONString(save));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment