//package com.inkasso.kafubao.system.role.controller;
//
//import com.inkasso.auth.interfaces.Permissions;
//import com.inkasso.auth.interfaces.PermissionAndCheck;
//import com.inkasso.adapter.page.PageResult;
//import com.inkasso.kafubao.system.role.model.dto.RoleDTO;
//import com.inkasso.kafubao.system.role.model.request.AddRoleRequest;
//import com.inkasso.kafubao.system.role.model.request.EditRoleRequest;
//import com.inkasso.kafubao.system.role.model.request.QueryRoleRequest;
//import com.inkasso.kafubao.system.role.service.RoleService;
//import com.inkasso.adapter.exception.ServiceException;
//import com.inkasso.adapter.response.ResponseData;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.PathVariable;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RestController;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.PutMapping;
//import org.springframework.web.bind.annotation.DeleteMapping;
//import org.springframework.web.bind.annotation.GetMapping;
//import com.inkasso.adapter.exception.enums.KafubaoExceptionEnum;
//
//
//import java.util.List;
//
///**
// * @author 张超
// * @date  2023-08-15
// */
//@RestController
//@RequestMapping(path = "system")
//@Permissions(name="角色",code = "roleManage")
//public class RoleController {
//
//    @Autowired
//    private RoleService roleService;
//
//
//
//    @PostMapping(path = "role")
//    @PermissionAndCheck(name="添加角色",code="RoleController:add")
//    public ResponseData add(@Validated @RequestBody AddRoleRequest addRoleRequest) {
//
//        roleService.addRole(addRoleRequest);
//        return ResponseData.success();
//
//    }
//
//    @PutMapping(path = "role")
//    @PermissionAndCheck(name="更新角色",code="RoleController:update")
//    public ResponseData edit(@Validated @RequestBody EditRoleRequest editRoleRequest) {
//        roleService.editRole(editRoleRequest);
//        return ResponseData.success();
//    }
//
//    @GetMapping(path = "role/{id}")
//    @PermissionAndCheck(name = "查询角色详细信息", code="RoleController:detail")
//    public ResponseData getById(@PathVariable("id") Long id){
//        if(id==null){
//            throw new ServiceException(400, KafubaoExceptionEnum.SYSTEM_DATE_ERROR);
//        }
//        RoleDTO roleDTO = roleService.getRoleDtoById(id);
//        return ResponseData.success(roleDTO);
//
//    }
//
//
//    @DeleteMapping(path = "role/{id}")
//    @PermissionAndCheck(name = "删除角色", code="RoleController:delete")
//    public ResponseData deleteById(@PathVariable("id") Long id){
//        if(id==null){
//            throw new ServiceException(400, KafubaoExceptionEnum.SYSTEM_DATE_ERROR);
//        }
//        roleService.deleteRole(id);
//        return ResponseData.success();
//    }
//}