This commit is contained in:
Yutousama 2020-01-20 18:02:45 +08:00
parent 93c2461a60
commit 10740191a1
3 changed files with 37 additions and 9 deletions

View File

@ -3,12 +3,16 @@ package com.yutou.controller.MapTop;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yutou.enums.UserEnum;
import com.yutou.jianrdb.Bean.GameInfoLog;
import com.yutou.jianrdb.Bean.MapNode;
import com.yutou.jianrdb.Mapper.MapNodeService;
import com.yutou.maptop.Bean.MapTop;
import com.yutou.maptop.Bean.UserTeam;
import com.yutou.maptop.services.MapTopService;
import com.yutou.maptop.services.UserTeamService;
import com.yutou.mybatis.ZsShipType;
import com.yutou.mybatis.ZsShipTypeExample;
import com.yutou.mybatis.dao.ZsShipTypeMapper;
import com.yutou.utlis.Tools;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@ -21,12 +25,11 @@ import java.util.List;
@Controller
public class AndroidMapController {
@Resource
UserTeamService userTeamService;
@Resource
MapTopService mapTopService;
@Resource
MapNodeService mapNodeService;
@Resource
ZsShipTypeMapper jianTypeMapper;
/**
* 全部数据
@ -90,7 +93,7 @@ public class AndroidMapController {
}
int count=50;
List<UserTeam> list=mapNodeService.selectNodeByMid(node,limit,count);
List<GameInfoLog> list=mapNodeService.selectNodeByMid(node,limit,count);
json.put("count",list.size());
json.put("data", JSONArray.toJSON(list));
if(list.size()==count){
@ -100,5 +103,19 @@ public class AndroidMapController {
}
return json.toJSONString();
}
@ResponseBody
@RequestMapping("/android/ship/type.do")
public String getShipType(HttpServletRequest request){
JSONObject json=new JSONObject();
if(Tools.getUidOfToken(request)<=0){
json.put("msg",UserEnum.LOGIN_NOT_LOGIN.msg);
json.put("code", UserEnum.LOGIN_NOT_LOGIN.code);
return json.toString();
}
List<ZsShipType> list=mapNodeService.selectAllShipType();
json.put("count",list.size());
json.put("data", JSONArray.toJSON(list));
return json.toJSONString();
}
}

View File

@ -1,7 +1,9 @@
package com.yutou.jianrdb.Dao;
import com.yutou.jianrdb.Bean.GameInfoLog;
import com.yutou.jianrdb.Bean.MapNode;
import com.yutou.maptop.Bean.UserTeam;
import com.yutou.mybatis.ZsShipType;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Qualifier;
@ -22,6 +24,9 @@ public interface MapNodeDao {
@Select("SELECT * FROM jrmbdb.zs_node_info where chapter_name=#{chapterName} and level_name=#{lievelName};")
List<MapNode> selectMapByNode(@Param("chapterName")String chapterName,@Param("lievelName")String levelName);
@Select("SELECT * FROM jrmbdb.game_info_log where `type`='DealNode' and ext like '%pve%' and ext like '%#{nid}%' order by id desc limit #{limit},#{count};")
List<UserTeam> selectNodeByMid(@Param("nid")int nodeId,@Param("limit")int limit,@Param("count")int count);
@Select("SELECT * FROM jrmbdb.game_info_log where `type`='DealNode' and message like '%warReport%' and ext like '%pve%' and ext like #{nid} order by id desc limit #{limit},#{count};")
List<GameInfoLog> selectNodeByMid(@Param("nid")String nodeId, @Param("limit")int limit, @Param("count")int count);
@Select("SELECT * FROM jrmbdb.zs_ship_type;")
List<ZsShipType> selectAllShipType();
}

View File

@ -1,8 +1,10 @@
package com.yutou.jianrdb.Mapper;
import com.yutou.jianrdb.Bean.GameInfoLog;
import com.yutou.jianrdb.Bean.MapNode;
import com.yutou.jianrdb.Dao.MapNodeDao;
import com.yutou.maptop.Bean.UserTeam;
import com.yutou.mybatis.ZsShipType;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -29,8 +31,12 @@ public class MapNodeService {
return dao.selectMapByNode(chapterName, levelName);
}
public List<UserTeam> selectNodeByMid(int nodeId, int limit, int count) {
return dao.selectNodeByMid(nodeId, limit, count);
public List<GameInfoLog> selectNodeByMid(int nodeId, int limit, int count) {
return dao.selectNodeByMid("%"+nodeId+"%", limit, count);
}
public List<ZsShipType> selectAllShipType(){
return dao.selectAllShipType();
}
}