//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.RoleResourceDTO;
//import com.inkasso.kafubao.system.role.model.request.AddRoleResourceRequest;
//import com.inkasso.kafubao.system.role.model.request.EditRoleResourceRequest;
//import com.inkasso.kafubao.system.role.model.request.QueryRoleResourceRequest;
//import com.inkasso.kafubao.system.role.service.RoleResourceService;
//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-19
// */
//@RestController
//@RequestMapping(path = "roleresource")
//@Permissions(name="角色-资源",code = "roleresourceManage")
//public class RoleResourceController {
//
//    @Autowired
//    private RoleResourceService roleResourceService;
//
//
//
//    @PostMapping(path = "roleresource")
//    @PermissionAndCheck(name="添加角色-资源",code="RoleResourceController:add")
//    public ResponseData add(@Validated @RequestBody AddRoleResourceRequest addRoleResourceRequest) {
//
//        roleResourceService.addRoleResource(addRoleResourceRequest);
//        return ResponseData.success();
//
//    }
//
//    @PutMapping(path = "roleresource")
//    @PermissionAndCheck(name="更新角色-资源",code="RoleResourceController:update")
//    public ResponseData edit(@Validated @RequestBody EditRoleResourceRequest editRoleResourceRequest) {
//        roleResourceService.editRoleResource(editRoleResourceRequest);
//        return ResponseData.success();
//    }
//
//    @GetMapping(path = "roleresource/{id}")
//    @PermissionAndCheck(name = "查询角色-资源详细信息", code="RoleResourceController:detail")
//    public ResponseData getById(@PathVariable("id") Long id){
//        if(id==null){
//            throw new ServiceException(400, KafubaoExceptionEnum.SYSTEM_DATE_ERROR);
//        }
//        RoleResourceDTO roleResourceDTO = roleResourceService.getById(id);
//        return ResponseData.success(roleResourceDTO);
//
//    }
//
//
//    @DeleteMapping(path = "roleresource/{id}")
//    @PermissionAndCheck(name = "删除角色-资源", code="RoleResourceController:delete")
//    public ResponseData deleteById(@PathVariable("id") Long id){
//        if(id==null){
//            throw new ServiceException(400, KafubaoExceptionEnum.SYSTEM_DATE_ERROR);
//        }
//        roleResourceService.deleteRoleResource(id);
//        return ResponseData.success();
//    }
//}