NutzCN Logo
问答 一句sql代码,为什么执行Sql两次?
发布于 1635天前 作者 wx_jjn2ia9qvotogktb45bf 1367 次浏览 复制 上一个帖子 下一个帖子
标签: ssdb
public List<hp_public_video> hpPublicVideoBasicList(){
        Sql sql = Sqls.create("select video_device_coding,video_name,camera_type,video_lng,video_lat,camera_position_type,manager_phonenumber,video_installation_height from hp_public_video limit 0,1000");
        sql.setEntity(dao().getEntity(hp_public_video.class));
        sql.setCallback(Sqls.callback.entities());
        dao().execute(sql);
        List<hp_public_video> list = sql.getList(hp_public_video.class);
        return list;

    }
@At("/hpPublicVideo/videoBasicMessage")
    @Ok("json")
    public Object GethpPublicVideoList(){
        List<hp_public_video> hpVideoBasicList = null;
        try{
            if(huPublicVideoService.hpPublicVideoBasicList() != null){
                hpVideoBasicList = huPublicVideoService.hpPublicVideoBasicList();
                return hpVideoBasicList;
            }else{
                return "暂无数据或传输出错";
            }

        }catch (Exception e){
            e.printStackTrace();
            return "传输错误";
        }
    }

为什么通过网址访问locallhost:8080//hpPublicVideo/videoBasicMessage? hpPublicVideoBasicList()此 方法会执行2次?

1 回复

知道了,controller中执行了2次 额。。。

添加回复
请先登陆
回到顶部