123
This commit is contained in:
1 parent
f084d04808
commit
b8cea4af69
2 files changed
+21
-15
No files matched your search
@@ -12,4 +12,6 @@ public class DmOperateVo implements Serializable {
|
||||
private String winId;
|
||||
private Integer operateType;
|
||||
private Integer type;
|
||||
private Integer x;
|
||||
private Integer y;
|
||||
}
|
||||
+19
-15
@@ -179,34 +179,38 @@ public class DmPlayerentServiceImpl extends ServiceImpl<DmPlayerentMapper, DmPla
|
||||
|
||||
@Override
|
||||
public boolean operate(DmOperateVo vo) {
|
||||
if(vo.getType() == null){
|
||||
JSONObject params = new JSONObject();
|
||||
params.put("params", "");
|
||||
if (vo.getType() == null) {
|
||||
vo.setType(-1);
|
||||
}
|
||||
JSONObject params = new JSONObject();
|
||||
if (vo.getX() != null && vo.getY() != null) {
|
||||
params.put("params", vo.getX() + "|" + vo.getY());
|
||||
}
|
||||
if (vo.getAction() == 5) { //截图
|
||||
try {
|
||||
params.put("winId",vo.getWinId());
|
||||
params.put("playerId",vo.getPlayerId());
|
||||
String result = httpHelper.getlHttpResult("http://"+ this.serverIp +":"+serverPort+ "?cmd=6¶ms="+ URLEncoder.encode(JSONObject.toJSONString(params),"utf-8")
|
||||
,"get",new HashMap<>(),new HashMap<>());
|
||||
params.put("winId", vo.getWinId());
|
||||
params.put("playerId", vo.getPlayerId());
|
||||
String result = httpHelper.getlHttpResult("http://" + this.serverIp + ":" + serverPort + "?cmd=6¶ms=" + URLEncoder.encode(JSONObject.toJSONString(params), "utf-8")
|
||||
, "get", new HashMap<>(), new HashMap<>());
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
if(jsonObject.getString("code").equals("1")){
|
||||
if (jsonObject.getString("code").equals("1")) {
|
||||
return true;
|
||||
}
|
||||
System.out.println(result);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}else if(vo.getAction() == 6){
|
||||
} else if (vo.getAction() == 6) {
|
||||
try {
|
||||
params.put("winId",vo.getWinId());
|
||||
params.put("playerId",vo.getPlayerId());
|
||||
params.put("operateType",vo.getOperateType());
|
||||
params.put("type",vo.getType());
|
||||
String result = httpHelper.getlHttpResult("http://"+ this.serverIp +":"+serverPort+ "?cmd=7¶ms="+ URLEncoder.encode(JSONObject.toJSONString(params),"utf-8")
|
||||
,"get",new HashMap<>(),new HashMap<>());
|
||||
params.put("winId", vo.getWinId());
|
||||
params.put("playerId", vo.getPlayerId());
|
||||
params.put("operateType", vo.getOperateType());
|
||||
params.put("type", vo.getType());
|
||||
String result = httpHelper.getlHttpResult("http://" + this.serverIp + ":" + serverPort + "?cmd=7¶ms=" + URLEncoder.encode(JSONObject.toJSONString(params), "utf-8")
|
||||
, "get", new HashMap<>(), new HashMap<>());
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
if(jsonObject.getString("code").equals("1")){
|
||||
if (jsonObject.getString("code").equals("1")) {
|
||||
return true;
|
||||
}
|
||||
System.out.println(result);
|
||||
|
||||
Reference in new issue
Block a user