package com.zzsn.knowbase.controller;


import com.zzsn.knowbase.entity.KbRole;
import com.zzsn.knowbase.service.KbRoleService;
import com.zzsn.knowbase.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author obcy
 * @since 2024-01-04
 */
@RestController
@RequestMapping("/api/role")
public class KbRoleController {
    @Autowired
    KbRoleService roleService;

    @PostMapping("/add")
    public Result add(@RequestBody KbRole role){
        return Result.OK(roleService.save(role));
    }
    @GetMapping("/list")
    public  Result list (){
        return  Result.OK(roleService.list());
    }
}
