package com.casic.missiles.modular.system.controller;

import com.casic.missiles.core.base.controller.BaseController;
import com.casic.missiles.modular.system.model.DeptPermission;
import com.casic.missiles.modular.system.service.DeptPermissionConfigService;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/deptPermission")
public class DeptPermissionController extends BaseController {

    private final DeptPermissionConfigService deptPermissionService;

    public DeptPermissionController(DeptPermissionConfigService deptPermissionService) {
        this.deptPermissionService = deptPermissionService;
    }

    /**
     * 获取分页列表SMI
     */
    @RequestMapping(value = "/list")
    @ResponseBody
    public Object deviceDeptPermissionList(String deptid) {
        return deptPermissionService.deviceDeptPermissionList(deptid);
    }

    /**
     * 新增SMI
     */
    @RequestMapping(value = "/add")
    @ResponseBody
    public Object addDeptPermission(@RequestBody DeptPermission deviceImei) {
        return deptPermissionService.addDeptPermission(deviceImei);
    }

    /**
     * 更新SMI
     */
    @RequestMapping(value = "/update")
    @ResponseBody
    public Object editDeptPermission(@RequestBody DeptPermission deviceImei) {
        return deptPermissionService.editDeptPermission(deviceImei);
    }

    /**
     * 删除imei
     */
    @RequestMapping(value = "/delete/{id}")
    @ResponseBody
    public Object deleteDeptPermission(@PathVariable("id") Long id) {
        return deptPermissionService.deleteDeptPermission(id);
    }

}
