//package com.inkasso.kafubao.system.user.controller;
//
//import com.inkasso.auth.interfaces.Permissions;
//import com.inkasso.auth.interfaces.PermissionAndCheck;
//import com.inkasso.adapter.page.PageResult;
//import com.inkasso.kafubao.system.user.model.dto.UserRoleDTO;
//import com.inkasso.kafubao.system.user.model.request.AddUserRoleRequest;
//import com.inkasso.kafubao.system.user.model.request.EditUserRoleRequest;
//import com.inkasso.kafubao.system.user.model.request.QueryUserRoleRequest;
//import com.inkasso.kafubao.system.user.service.UserRoleService;
//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 = "userrole")
//@Permissions(name="用户-角色",code = "userroleManage")
//public class UserRoleController {
//
//    @Autowired
//    private UserRoleService userRoleService;
//
//
//
//    @PostMapping(path = "userrole")
//    @PermissionAndCheck(name="添加用户-角色",code="UserRoleController:add")
//    public ResponseData add(@Validated @RequestBody AddUserRoleRequest addUserRoleRequest) {
//
//        userRoleService.addUserRole(addUserRoleRequest);
//        return ResponseData.success();
//
//    }
//
//    @PutMapping(path = "userrole")
//    @PermissionAndCheck(name="更新用户-角色",code="UserRoleController:update")
//    public ResponseData edit(@Validated @RequestBody EditUserRoleRequest editUserRoleRequest) {
//        userRoleService.editUserRole(editUserRoleRequest);
//        return ResponseData.success();
//    }
//
//    @GetMapping(path = "userrole/{id}")
//    @PermissionAndCheck(name = "查询用户-角色详细信息", code="UserRoleController:detail")
//    public ResponseData getById(@PathVariable("id") Long id){
//        if(id==null){
//            throw new ServiceException(400, KafubaoExceptionEnum.SYSTEM_DATE_ERROR);
//        }
//        UserRoleDTO userRoleDTO = userRoleService.getById(id);
//        return ResponseData.success(userRoleDTO);
//
//    }
//
//
//    @DeleteMapping(path = "userrole/{id}")
//    @PermissionAndCheck(name = "删除用户-角色", code="UserRoleController:delete")
//    public ResponseData deleteById(@PathVariable("id") Long id){
//        if(id==null){
//            throw new ServiceException(400, KafubaoExceptionEnum.SYSTEM_DATE_ERROR);
//        }
//        userRoleService.deleteUserRole(id);
//        return ResponseData.success();
//    }
//}