Skip to content

Commit c26211d

Browse files
committed
objectbox debug
1 parent d975aaa commit c26211d

File tree

8 files changed

+184
-76
lines changed

8 files changed

+184
-76
lines changed

objectbox-models/default.json

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,70 +4,83 @@
44
"_note3": "If you have VCS merge conflicts, you must resolve them according to ObjectBox docs.",
55
"entities": [
66
{
7-
"id": "1:5106563832689104204",
8-
"lastPropertyId": "6:289187461763749700",
7+
"id": "3:2723635283541883978",
8+
"lastPropertyId": "6:8160730505161662463",
99
"name": "ApiBean",
1010
"properties": [
1111
{
12-
"id": "1:7111733236036987178",
12+
"id": "1:1009586835923650810",
1313
"name": "id"
1414
},
1515
{
16-
"id": "2:5476738677424130682",
16+
"id": "2:1819075072616422547",
1717
"name": "method"
1818
},
1919
{
20-
"id": "3:4426015197720182937",
21-
"indexId": "1:6428961294737086977",
20+
"id": "3:5840363995880335334",
21+
"indexId": "4:7528299978526598631",
2222
"name": "url"
2323
},
2424
{
25-
"id": "4:384325182237240164",
25+
"id": "4:6535976958538309078",
2626
"name": "parameMap"
2727
},
2828
{
29-
"id": "5:8679731387982128062",
29+
"id": "5:1685148069388043356",
3030
"name": "encryptType"
3131
},
3232
{
33-
"id": "6:289187461763749700",
34-
"indexId": "2:8874929421314312625",
33+
"id": "6:8160730505161662463",
34+
"indexId": "5:6124672461106652585",
3535
"name": "projectId"
3636
}
3737
],
3838
"relations": []
3939
},
4040
{
41-
"id": "2:2818616999448140139",
42-
"lastPropertyId": "3:1844758545186169842",
41+
"id": "4:5597683018629263095",
42+
"lastPropertyId": "3:6639654376183909253",
4343
"name": "ProjectBean",
4444
"properties": [
4545
{
46-
"id": "1:7849693985632742549",
46+
"id": "1:4867889443599709479",
4747
"name": "id"
4848
},
4949
{
50-
"id": "2:3979305607409224008",
51-
"indexId": "3:3289518476068271070",
50+
"id": "2:5918761106478195164",
51+
"indexId": "6:1848496440789613274",
5252
"name": "name"
5353
},
5454
{
55-
"id": "3:1844758545186169842",
55+
"id": "3:6639654376183909253",
5656
"name": "baseUrlList"
5757
}
5858
],
5959
"relations": []
6060
}
6161
],
62-
"lastEntityId": "2:2818616999448140139",
63-
"lastIndexId": "3:3289518476068271070",
62+
"lastEntityId": "4:5597683018629263095",
63+
"lastIndexId": "6:1848496440789613274",
6464
"lastRelationId": "0:0",
6565
"lastSequenceId": "0:0",
6666
"modelVersion": 4,
6767
"modelVersionParserMinimum": 4,
68-
"retiredEntityUids": [],
69-
"retiredIndexUids": [],
70-
"retiredPropertyUids": [],
68+
"retiredEntityUids": [
69+
5987127870826382314,
70+
1500598098346202356
71+
],
72+
"retiredIndexUids": [
73+
8831818031265963749,
74+
4740578009850574679,
75+
4774298913206605671
76+
],
77+
"retiredPropertyUids": [
78+
8021379061043155619,
79+
2767558341465927091,
80+
885506218844556077,
81+
9206744007162437147,
82+
7796476320872320559
83+
],
7184
"retiredRelationUids": [],
7285
"version": 1
7386
}

src/main/java/com/longforus/apidebugger/ui/MainPanel.form

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@
1616
<colspec value="left:4dlu:noGrow"/>
1717
<colspec value="fill:d:noGrow"/>
1818
<colspec value="left:4dlu:noGrow"/>
19+
<colspec value="fill:max(d;4px):noGrow"/>
20+
<colspec value="left:4dlu:noGrow"/>
1921
<colspec value="fill:d:noGrow"/>
2022
<colspec value="left:4dlu:noGrow"/>
2123
<colspec value="fill:d:noGrow"/>
2224
<colspec value="left:4dlu:noGrow"/>
2325
<colspec value="fill:max(p;600px):grow"/>
2426
<constraints>
25-
<xy x="20" y="20" width="1241" height="959"/>
27+
<xy x="20" y="20" width="1327" height="959"/>
2628
</constraints>
2729
<properties>
2830
<name value="Api debugger"/>
@@ -87,7 +89,7 @@
8789
</component>
8890
<scrollpane id="13be7">
8991
<constraints>
90-
<grid row="5" column="0" row-span="1" col-span="9" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
92+
<grid row="5" column="0" row-span="1" col-span="11" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
9193
<forms defaultalign-horz="false" defaultalign-vert="false"/>
9294
</constraints>
9395
<properties/>
@@ -103,7 +105,7 @@
103105
</scrollpane>
104106
<scrollpane id="86e31">
105107
<constraints>
106-
<grid row="7" column="0" row-span="1" col-span="9" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
108+
<grid row="7" column="0" row-span="1" col-span="11" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
107109
<forms defaultalign-horz="false" defaultalign-vert="false"/>
108110
</constraints>
109111
<properties/>
@@ -119,7 +121,7 @@
119121
</scrollpane>
120122
<component id="8b0f0" class="javax.swing.JLabel" binding="lbStatus">
121123
<constraints>
122-
<grid row="8" column="0" row-span="1" col-span="9" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
124+
<grid row="8" column="0" row-span="1" col-span="11" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
123125
<forms/>
124126
</constraints>
125127
<properties>
@@ -128,7 +130,7 @@
128130
</component>
129131
<scrollpane id="c35dd">
130132
<constraints>
131-
<grid row="0" column="10" row-span="5" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
133+
<grid row="0" column="12" row-span="6" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
132134
<forms defaultalign-horz="false" defaultalign-vert="false"/>
133135
</constraints>
134136
<properties/>
@@ -144,13 +146,38 @@
144146
<rowspec value="center:d:grow"/>
145147
<colspec value="fill:d:grow"/>
146148
<constraints>
147-
<grid row="5" column="10" row-span="3" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
149+
<grid row="6" column="12" row-span="2" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
148150
<forms/>
149151
</constraints>
150152
<properties/>
151153
<border type="none" title="Json Tree"/>
152154
<children/>
153155
</grid>
156+
<component id="4ba05" class="javax.swing.JLabel">
157+
<constraints>
158+
<grid row="1" column="8" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
159+
<forms/>
160+
</constraints>
161+
<properties>
162+
<text value="Encryption:"/>
163+
</properties>
164+
</component>
165+
<component id="a1a29" class="javax.swing.JComboBox" binding="mCbEncrypt">
166+
<constraints>
167+
<grid row="1" column="10" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
168+
<forms/>
169+
</constraints>
170+
<properties/>
171+
</component>
172+
<component id="beac7" class="javax.swing.JButton" binding="btnDelUrl">
173+
<constraints>
174+
<grid row="1" column="6" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
175+
<forms/>
176+
</constraints>
177+
<properties>
178+
<text value="Delete"/>
179+
</properties>
180+
</component>
154181
<component id="1e7e4" class="javax.swing.JButton" binding="mBtnSaveApi">
155182
<constraints>
156183
<grid row="3" column="6" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
@@ -169,22 +196,15 @@
169196
<text value="Copy New"/>
170197
</properties>
171198
</component>
172-
<component id="4ba05" class="javax.swing.JLabel">
199+
<component id="e47f" class="javax.swing.JButton" binding="btnDelApi">
173200
<constraints>
174-
<grid row="1" column="6" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
201+
<grid row="3" column="10" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
175202
<forms/>
176203
</constraints>
177204
<properties>
178-
<text value="Encryption:"/>
205+
<text value="Delete"/>
179206
</properties>
180207
</component>
181-
<component id="a1a29" class="javax.swing.JComboBox" binding="mCbEncrypt">
182-
<constraints>
183-
<grid row="1" column="8" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
184-
<forms/>
185-
</constraints>
186-
<properties/>
187-
</component>
188208
</children>
189209
</grid>
190210
</form>

src/main/java/com/longforus/apidebugger/ui/MainPanel.java

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ public class MainPanel extends JFrame {
3838
private JButton mBtnNewApi;
3939
private JLabel lbStatus;
4040
private JPanel baseP;
41+
private JButton btnDelUrl;
42+
private JButton btnDelApi;
4143

4244
public JTable getTbParame() {
4345
return mTbParame;
@@ -78,8 +80,10 @@ public MainPanel(String title) throws HeadlessException {
7880
setContentPane(baseP);
7981
setJMenuBar(UILifecycleHandler.INSTANCE.getMenuBar());
8082
mTbParame.setModel(new DefaultTableModel(new Object[] { "key", "value" }, 15));
81-
mBtnSaveBaseUrl.addActionListener(e -> UIActionHandler.INSTANCE.onSaveBaseUrl());
82-
mBtnSaveApi.addActionListener(e -> UIActionHandler.INSTANCE.onSaveApi());
83+
mBtnSaveBaseUrl.addActionListener(e -> UIActionHandler.INSTANCE.onSaveBaseUrl(mCbBaseUrl.getModel().getSelectedItem()));
84+
btnDelUrl.addActionListener(e -> UIActionHandler.INSTANCE.onDelBaseUrl(mCbBaseUrl.getModel().getSelectedItem()));
85+
btnDelApi.addActionListener(e -> UIActionHandler.INSTANCE.onDelApiUrl(mCbApiUrl.getModel().getSelectedItem()));
86+
mBtnSaveApi.addActionListener(e -> UIActionHandler.INSTANCE.onSaveApi(mCbApiUrl.getModel().getSelectedItem()));
8387
mBtnNewApi.addActionListener(e -> UIActionHandler.INSTANCE.onNewApi());
8488
mBtnSend.addActionListener(e -> UIActionHandler.INSTANCE.onSend());
8589
pack();
@@ -105,8 +109,8 @@ private void createUIComponents() {
105109
createUIComponents();
106110
baseP = new JPanel();
107111
baseP.setLayout(new FormLayout(
108-
"fill:d:noGrow,left:4dlu:noGrow,fill:300px:noGrow,left:4dlu:noGrow,fill:d:noGrow,left:4dlu:noGrow,fill:d:noGrow,left:4dlu:noGrow,fill:d:noGrow,left:4dlu:noGrow," +
109-
"fill:max(p;600px):grow",
112+
"fill:d:noGrow,left:4dlu:noGrow,fill:300px:noGrow,left:4dlu:noGrow,fill:d:noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:d:noGrow," +
113+
"left:4dlu:noGrow,fill:d:noGrow,left:4dlu:noGrow,fill:max(p;600px):grow",
110114
"center:d:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:200px:noGrow,top:4dlu:noGrow,center:max(p;600px):grow," +
111115
"center:max(d;4px):noGrow"));
112116
baseP.setName("Api debugger");
@@ -131,38 +135,44 @@ private void createUIComponents() {
131135
mBtnSend.setText("Send");
132136
baseP.add(mBtnSend, cc.xy(5, 4));
133137
final JScrollPane scrollPane1 = new JScrollPane();
134-
baseP.add(scrollPane1, cc.xyw(1, 6, 9, CellConstraints.FILL, CellConstraints.FILL));
138+
baseP.add(scrollPane1, cc.xyw(1, 6, 11, CellConstraints.FILL, CellConstraints.FILL));
135139
scrollPane1.setBorder(BorderFactory.createTitledBorder("Request Parameter"));
136140
mTbParame = new JTable();
137141
mTbParame.setRowHeight(25);
138142
scrollPane1.setViewportView(mTbParame);
139143
final JScrollPane scrollPane2 = new JScrollPane();
140-
baseP.add(scrollPane2, cc.xyw(1, 8, 9, CellConstraints.FILL, CellConstraints.FILL));
144+
baseP.add(scrollPane2, cc.xyw(1, 8, 11, CellConstraints.FILL, CellConstraints.FILL));
141145
scrollPane2.setBorder(BorderFactory.createTitledBorder("Response"));
142146
mTpResponse = new JTextPane();
143147
mTpResponse.setPreferredSize(new Dimension(500, 600));
144148
scrollPane2.setViewportView(mTpResponse);
145149
lbStatus = new JLabel();
146150
lbStatus.setText("Status:");
147-
baseP.add(lbStatus, cc.xyw(1, 9, 9));
151+
baseP.add(lbStatus, cc.xyw(1, 9, 11));
148152
final JScrollPane scrollPane3 = new JScrollPane();
149-
baseP.add(scrollPane3, cc.xywh(11, 1, 1, 5, CellConstraints.FILL, CellConstraints.FILL));
153+
baseP.add(scrollPane3, cc.xywh(13, 1, 1, 6, CellConstraints.FILL, CellConstraints.FILL));
150154
scrollPane3.setBorder(BorderFactory.createTitledBorder("Request Information"));
151155
mTpInfo = new JTextPane();
152156
scrollPane3.setViewportView(mTpInfo);
153-
baseP.add(mJep, cc.xywh(11, 6, 1, 3));
157+
baseP.add(mJep, cc.xywh(13, 7, 1, 2));
154158
mJep.setBorder(BorderFactory.createTitledBorder("Json Tree"));
159+
final JLabel label3 = new JLabel();
160+
label3.setText("Encryption:");
161+
baseP.add(label3, cc.xy(9, 2));
162+
mCbEncrypt = new JComboBox();
163+
baseP.add(mCbEncrypt, cc.xy(11, 2));
164+
btnDelUrl = new JButton();
165+
btnDelUrl.setText("Delete");
166+
baseP.add(btnDelUrl, cc.xy(7, 2));
155167
mBtnSaveApi = new JButton();
156168
mBtnSaveApi.setText("Save");
157169
baseP.add(mBtnSaveApi, cc.xy(7, 4));
158170
mBtnNewApi = new JButton();
159171
mBtnNewApi.setText("Copy New");
160172
baseP.add(mBtnNewApi, cc.xy(9, 4));
161-
final JLabel label3 = new JLabel();
162-
label3.setText("Encryption:");
163-
baseP.add(label3, cc.xy(7, 2));
164-
mCbEncrypt = new JComboBox();
165-
baseP.add(mCbEncrypt, cc.xy(9, 2));
173+
btnDelApi = new JButton();
174+
btnDelApi.setText("Delete");
175+
baseP.add(btnDelApi, cc.xy(11, 4));
166176
}
167177

168178
/** @noinspection ALL */

src/main/kotlin/com/longforus/apidebugger/HttpManage.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ object HttpManage {
9797

9898

9999

100-
var SERVER_IP: String = ""
100+
101101

102102
/**
103103
* 根据相对路径获取全路径
104104
*
105105
* @param relativeUrl 相对路径
106106
*/
107-
private fun getAbsoluteUrl(relativeUrl: String) = SERVER_IP + relativeUrl
107+
private fun getAbsoluteUrl(relativeUrl: String) = MyValueHandler.curBaseUrl + relativeUrl
108108
}

src/main/kotlin/com/longforus/apidebugger/MyValueHandler.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ object MyValueHandler {
2222
if (value == field) {
2323
return
2424
}
25+
field = value
2526
value?.let {
2627
UILifecycleHandler.initProject(it, mainPanel)
2728
}
28-
field = value
2929
}
3030

3131

0 commit comments

Comments
 (0)