Skip to content

Commit 7d8a334

Browse files
refactor(common): extract ConfigDaoHub for config JSON
Replace duplicated private DaoHub inner classes in ConfigHttpServer, ConfigSettingsWriter, and ConfigIO with a shared DTO type. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 35bc5d1 commit 7d8a334

1 file changed

Lines changed: 1 addition & 18 deletions

File tree

src/main/java/core/packetproxy/common/ConfigSettingsWriter.java

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,13 @@
1616
package packetproxy.common;
1717

1818
import com.google.gson.Gson;
19-
import com.google.gson.annotations.SerializedName;
20-
import java.util.List;
2119
import packetproxy.model.*;
2220

2321
/** リモート設定 JSON を DB に反映する。 */
2422
public class ConfigSettingsWriter {
2523

26-
private static class DaoHub {
27-
28-
@SerializedName(value = "listenPorts")
29-
List<ListenPort> listenPortList;
30-
31-
@SerializedName(value = "servers")
32-
List<Server> serverList;
33-
34-
@SerializedName(value = "modifications")
35-
List<Modification> modificationList;
36-
37-
@SerializedName(value = "sslPassThroughs")
38-
List<SSLPassThrough> sslPassThroughList;
39-
}
40-
4124
public void applyFromJson(String json) throws Exception {
42-
var daoHub = new Gson().fromJson(json, DaoHub.class);
25+
var daoHub = new Gson().fromJson(json, ConfigDaoHub.class);
4326

4427
Database.getInstance().dropConfigs();
4528

0 commit comments

Comments
 (0)