package com.bonus.canteen.core.allocation.canteen.controller;

import cn.hutool.core.lang.tree.Tree;
import com.bonus.canteen.core.allocation.canteen.service.AllocAreaService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController
@RequestMapping({"/api/v2/alloc/area"})
@Api(
   tags = {"lsh_食堂区域控制器"}
)
public class AllocAreaController {
   private static final Logger log = LoggerFactory.getLogger(AllocAreaController.class);
//   @Autowired
//   @Lazy
//   private AllocCanteenBusiness allocCanteenBusiness;
   @Autowired
   @Lazy
   private AllocAreaService allocAreaService;

//   @ApiOperation("分页查询区域列表")
//   @PostMapping({"/page"})
//   @RequiresGuest
//   public Page<AllocAreaVO> pageArea(@RequestBody LeRequest<AllocAreaParam> request) {
//      return this.allocAreaService.pageArea((AllocAreaParam)request.getContent());
//   }
//
//   @ApiOperation("系统区域树")
//   @PostMapping({"/system/tree"})
//   public List<Tree<Long>> getSystemAreaTree() {
//      return this.allocAreaService.getSystemAreaTree();
//   }

   @ApiOperation("系统区域权限树")
   @PostMapping({"/system-auth/tree"})
   public List<Tree<Long>> getSystemAuthAreaTree() {
      return this.allocAreaService.getSystemAuthAreaTree();
   }

//   @ApiOperation("根据区域id，查询区域名称")
//   @PostMapping({"/get-area-name"})
//   @RequiresGuest
//   public LeResponse<String> getAreaName(@RequestBody LeRequest<Long> request) {
//      return LeResponse.succ(this.allocAreaService.getAreaName((Long)request.getContent()));
//   }
//
//   @ApiOperation("新增区域")
//   @PostMapping({"/add"})
//   @RequiresGuest
//   public void addArea(@RequestBody @Valid LeRequest<AllocAreaAddDTO> request) {
//      this.allocAreaService.addArea((AllocAreaAddDTO)request.getContent());
//   }
//
//   @ApiOperation("修改区域")
//   @PostMapping({"/update"})
//   @RequiresGuest
//   public void updateArea(@RequestBody @Valid LeRequest<AllocAreaUpdateDTO> request) {
//      this.allocAreaService.updateArea((AllocAreaUpdateDTO)request.getContent());
//   }
//
//   @ApiOperation("删除区域")
//   @PostMapping({"/remove"})
//   @RequiresGuest
//   public void removeArea(@RequestBody @Valid LeRequest<Long> request) {
//      this.allocCanteenBusiness.removeArea((Long)request.getContent());
//   }
}
