package com.xhpc.user.controller;

import com.xhpc.common.core.web.controller.BaseController;
import com.xhpc.common.core.web.domain.AjaxResult;
import com.xhpc.user.dto.MechanismDto;
import com.xhpc.user.service.IMechanismService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author yuyang
 * @date 2021/12/23 16:20
 */
@RestController
@RequestMapping("/mechanism")
public class XhpcMechanismController extends BaseController {

    @Autowired
    private IMechanismService mechanismService;
    /**
     * 数据维度
     * @param status        0 地区 1.运营商 2. 运营商-地区 3 租户下所有运营商场站
     * @return
     */
    @GetMapping(value = "/getMechanism")
    public AjaxResult getMechanism(@RequestParam(value = "status")Integer status) {
        List<MechanismDto> mechanismDtos = mechanismService.dataList(status);
        return AjaxResult.success(mechanismDtos);
    }
}
