50 lines
1.4 KiB
Java
50 lines
1.4 KiB
Java
package com.hivekion.system.controller;
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
import com.hivekion.common.exception.BusinessException;
|
|
import com.hivekion.system.domain.SysCsRole;
|
|
import com.hivekion.system.domain.vo.syscsrole.SysCsRoleEditInputVo;
|
|
import com.hivekion.system.service.ISysCsRoleService;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import java.util.List;
|
|
import springfox.documentation.annotations.ApiIgnore;
|
|
|
|
/**
|
|
* @auth 薛海宁
|
|
* @date 2022/10/18 10:56
|
|
**/
|
|
@RestController
|
|
@RequestMapping("/cssystem/role")
|
|
@ApiIgnore
|
|
public class SysCsRoleController {
|
|
@Autowired
|
|
ISysCsRoleService roleService;
|
|
|
|
@GetMapping("/getList")
|
|
public List<SysCsRole> getList(){
|
|
return roleService.list();
|
|
}
|
|
|
|
@GetMapping("/getInfo")
|
|
public SysCsRole getInfo(String id){
|
|
SysCsRole role = roleService.getById(id);
|
|
if(ObjectUtils.isEmpty(role)){
|
|
throw new BusinessException(500,"未查询到该条信息");
|
|
}
|
|
return role;
|
|
}
|
|
|
|
@PutMapping("/edit")
|
|
public boolean edit(@RequestBody SysCsRoleEditInputVo vo){
|
|
SysCsRole role = new SysCsRole();
|
|
BeanUtils.copyProperties(vo,role);
|
|
return roleService.updateById(role);
|
|
}
|
|
|
|
}
|