@@ -34,10 +34,9 @@ public static JSONObject getChannelList(String clientId, String token, String is
3434 */
3535 public static JSONObject getChannelList (String authorization , String islandSourceId ) throws IOException {
3636 String url = "https://botopen.imdodo.com/api/v2/channel/list" ;
37- String param = "{" +
38- " \" islandSourceId\" : \" " + islandSourceId + "\" " +
39- "}" ;
40- return new JSONObject (NetUtil .sendRequest (param , url , authorization ));
37+ JSONObject jsonObject = new JSONObject ();
38+ jsonObject .put ("islandSourceId" , islandSourceId );
39+ return new JSONObject (NetUtil .sendRequest (jsonObject .toString (), url , authorization ));
4140 }
4241
4342 /**
@@ -63,10 +62,9 @@ public static JSONObject getChannelInfo(String clientId, String token, String ch
6362 */
6463 public static JSONObject getChannelInfo (String authorization , String channelId ) throws IOException {
6564 String url = "https://botopen.imdodo.com/api/v2/channel/info" ;
66- String param = "{" +
67- " \" channelId\" : \" " + channelId + "\" " +
68- "}" ;
69- return new JSONObject (NetUtil .sendRequest (param , url , authorization ));
65+ JSONObject jsonObject = new JSONObject ();
66+ jsonObject .put ("channelId" , channelId );
67+ return new JSONObject (NetUtil .sendRequest (jsonObject .toString (), url , authorization ));
7068 }
7169
7270 /**
@@ -96,12 +94,11 @@ public static JSONObject addChannel(String clientId, String token, String island
9694 */
9795 public static JSONObject addChannel (String authorization , String islandSourceId , String channelName , int channelType ) throws IOException {
9896 String url = "https://botopen.imdodo.com/api/v2/channel/add" ;
99- String param = "{" +
100- " \" islandSourceId\" : \" " + islandSourceId + "\" ," +
101- " \" channelName\" : \" " + channelName + "\" ," +
102- " \" channelType\" : " + channelType + "" +
103- "}" ;
104- return new JSONObject (NetUtil .sendRequest (param , url , authorization ));
97+ JSONObject jsonObject = new JSONObject ();
98+ jsonObject .put ("islandSourceId" , islandSourceId )
99+ .put ("channelName" , channelName )
100+ .put ("channelType" , channelType );
101+ return new JSONObject (NetUtil .sendRequest (jsonObject .toString (), url , authorization ));
105102 }
106103
107104 /**
@@ -131,12 +128,11 @@ public static JSONObject editChannel(String clientId, String token, String islan
131128 */
132129 public static JSONObject editChannel (String authorization , String islandSourceId , String channelName , String channelId ) throws IOException {
133130 String url = "https://botopen.imdodo.com/api/v2/channel/edit" ;
134- String param = "{" +
135- " \" islandSourceId\" : \" " + islandSourceId + "\" ," +
136- " \" channelId\" : \" " + channelId + "\" ," +
137- " \" channelName\" : \" " + channelName + "\" " +
138- "}" ;
139- return new JSONObject (NetUtil .sendRequest (param , url , authorization ));
131+ JSONObject jsonObject = new JSONObject ();
132+ jsonObject .put ("islandSourceId" , islandSourceId )
133+ .put ("channelName" , channelName )
134+ .put ("channelId" , channelId );
135+ return new JSONObject (NetUtil .sendRequest (jsonObject .toString (), url , authorization ));
140136 }
141137
142138 /**
@@ -164,10 +160,9 @@ public static JSONObject deleteChannel(String clientId, String token, String isl
164160 */
165161 public static JSONObject deleteChannel (String authorization , String islandSourceId , String channelId ) throws IOException {
166162 String url = "https://botopen.imdodo.com/api/v2/channel/remove" ;
167- String param = "{" +
168- " \" islandSourceId\" : \" " + islandSourceId + "\" ," +
169- " \" channelId\" : \" " + channelId + "\" " +
170- "}" ;
171- return new JSONObject (NetUtil .sendRequest (param , url , authorization ));
163+ JSONObject jsonObject = new JSONObject ();
164+ jsonObject .put ("islandSourceId" , islandSourceId )
165+ .put ("channelId" , channelId );
166+ return new JSONObject (NetUtil .sendRequest (jsonObject .toString (), url , authorization ));
172167 }
173168}
0 commit comments