package com.ruoyi.web.work.api;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.web.work.api.config.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 科室介绍
 *
 * @author lsw
 * @date 2024-07-11
 */
@RestController
@RequestMapping("/app/department")
public class Api_DepartmentController extends BaseController {

    @Autowired
    private ISysDeptService deptService;

    @GetMapping("/list")
    public AjaxResult list() {
        return deptService.treeList();
    }

    @GetMapping(value = "/detail/{id}")
    public AjaxResult detail(@PathVariable("id") Long id) {
        return AjaxResult.success(deptService.getById(id));
    }
}
