package com.zcloud.controller.app;

import com.alibaba.fastjson.JSON;
import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.PageData;
import com.zcloud.service.electronicFence.ElectronicFenceService;
import com.zcloud.util.Jurisdiction;
import com.zcloud.util.ReturnMap;
import com.zcloud.util.Tools;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 说明：TODO
 * 作者：wangxuan
 * 官网：www.zcloudchina.com
 */
@Controller
@RequestMapping("/app/electronicFence")
public class AppElectronicFenceController extends BaseController {
    @Autowired
    private ElectronicFenceService electronicFenceService;
    /**
     * @Description: 树
     * @Author: dearLin
     * @Date: 2024/1/30/030 9:38
     * @Param: [com.zcloud.entity.Page] [page]
     * @Return: java.lang.Object
     */
    @RequestMapping(value = "/listTree")
    @ResponseBody
    public Object listTree() {
        PageData pd = this.getPageData();
        pd.put("childKey", "children");
        return ReturnMap.ok().put("zTreeNodes", JSON.toJSONString(electronicFenceService.listTree(pd)));
    }
}
