package com.bonus.core.customer.controller;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.tree.Tree;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.core.common.base.BaseController;
import com.bonus.core.customer.service.CustPlaceService;
import com.bonus.core.customer.vo.CustPlaceListVO;
import com.bonus.encrypt.RequiresGuest;
import com.google.gson.Gson;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Objects;

@RestController
@RequestMapping({"/custPlace"})
@Api(
   tags = {"customer-位置信息控制器"}
)
public class CustPlaceController extends BaseController {
   private static final Logger log = LoggerFactory.getLogger(CustPlaceController.class);

   @Resource
   private CustPlaceService custPlaceService;

   @ApiOperation(
           value = "根据id查询下级位置",
           notes = "根据id查询下级位置"
   )
   @PostMapping({"/queryChildPlaceById"})
   @RequiresGuest
   public AjaxResult ueryChildPlaceById(Long placeId) {
      List<CustPlaceListVO> custPlaceListVOList = this.custPlaceService.queryChildPlaceById(placeId);
      return AjaxResult.success(custPlaceListVOList);
   }


}
