Commit b3613ab6 by huluobin

# 更新

parent 8e361801
package com.blt.other.module.sys.controller;
import com.bailuntec.cost.api.response.CostResult;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blt.other.module.sys.model.Role;
import com.blt.other.module.sys.service.IRoleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* <p>
* 前端控制器
* 前端控制器
* </p>
*
* @author robbendev
* @since 2021-03-10
*/
@Api(tags = "角色接口")
@RestController
@RequestMapping("/role")
public class RoleController {
@Resource
IRoleService roleService;
@ApiOperation("新增角色")
@PostMapping("/save")
public CostResult<Void> save(@RequestBody Role role) {
roleService.save(role);
return CostResult.success();
}
@ApiOperation("分页查询")
@PostMapping("/page")
public CostResult<Page<Role>> page(@RequestBody Page<Role> page) {
return CostResult.success(roleService.page(page));
}
// @ApiOperation("删除角色")
// @PostMapping("/removeById")
// public CostResult<Void> remove(@RequestParam Integer id) {
// roleService.removeById(id);
// return CostResult.success();
// }
@ApiOperation("更新角色")
@PostMapping("/updateById")
public CostResult<Void> updateById(@RequestBody Role role) {
roleService.updateById(role);
return CostResult.success();
}
}
package com.blt.other.module.sys.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.bailuntec.cost.api.response.CostResult;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blt.other.module.sys.model.Role;
import com.blt.other.module.sys.model.RoleCostCompanyBinding;
import com.blt.other.module.sys.service.IRoleCostCompanyBindingService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Collection;
/**
* <p>
......@@ -13,8 +20,47 @@ import org.springframework.web.bind.annotation.RestController;
* @author robbendev
* @since 2021-03-10
*/
@ApiOperation("角色和主体权限绑定关系接口")
@RestController
@RequestMapping("/roleCostCompanyBinding")
public class RoleCostCompanyBindingController {
@Resource
IRoleCostCompanyBindingService roleCostCompanyBindingService;
@ApiOperation("新增角色和主体权限绑定")
@PostMapping("/save")
public CostResult<Void> save(@RequestBody RoleCostCompanyBinding roleCostCompanyBinding) {
roleCostCompanyBindingService.save(roleCostCompanyBinding);
return CostResult.success();
}
@ApiOperation("批量新增角色和主体权限绑定")
@PostMapping("/save")
public CostResult<Void> save(@RequestBody Collection<RoleCostCompanyBinding> collection) {
roleCostCompanyBindingService.saveBatch(collection);
return CostResult.success();
}
@ApiOperation("分页查询角色和主体权限绑定")
@PostMapping("/page")
public CostResult<Page<RoleCostCompanyBinding>> page(@RequestBody Page<RoleCostCompanyBinding> page) {
return CostResult.success(roleCostCompanyBindingService.page(page));
}
@ApiOperation("删除角色和主体权限绑定")
@GetMapping("/removeById")
public CostResult<Void> remove(@RequestParam Integer id) {
roleCostCompanyBindingService.removeById(id);
return CostResult.success();
}
@ApiOperation("更新角色和主体权限绑定")
@PostMapping("/updateById")
public CostResult<Void> updateById(@RequestBody RoleCostCompanyBinding roleCostCompanyBinding) {
roleCostCompanyBindingService.updateById(roleCostCompanyBinding);
return CostResult.success();
}
}
package com.blt.other.module.sys.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.bailuntec.cost.api.response.CostResult;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blt.other.module.sys.model.UserRoleBinding;
import com.blt.other.module.sys.service.IUserRoleBindingService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Collection;
/**
* <p>
* 前端控制器
* 前端控制器
* </p>
*
* @author robbendev
* @since 2021-03-10
*/
@ApiOperation("用户角色绑定关系接口")
@RestController
@RequestMapping("/userRoleBinding")
public class UserRoleBindingController {
@Resource
IUserRoleBindingService userRoleBindingService;
@ApiOperation("新增用户角色绑定关系")
@PostMapping("/save")
public CostResult<Void> save(@RequestBody UserRoleBinding userRoleBinding) {
userRoleBindingService.save(userRoleBinding);
return CostResult.success();
}
@ApiOperation("批量新增用户角色绑定关系")
@PostMapping("/save")
public CostResult<Void> save(@RequestBody Collection<UserRoleBinding> collection) {
userRoleBindingService.saveBatch(collection);
return CostResult.success();
}
@ApiOperation("分页查询用户角色绑定关系")
@PostMapping("/page")
public CostResult<Page<UserRoleBinding>> page(@RequestBody Page<UserRoleBinding> page) {
return CostResult.success(userRoleBindingService.page(page));
}
@ApiOperation("删除用户角色绑定关系")
@GetMapping("/removeById")
public CostResult<Void> remove(@RequestParam Integer id) {
userRoleBindingService.removeById(id);
return CostResult.success();
}
@ApiOperation("更新用户角色绑定关系")
@PostMapping("/updateById")
public CostResult<Void> updateById(@RequestBody UserRoleBinding userRoleBinding) {
userRoleBindingService.updateById(userRoleBinding);
return CostResult.success();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment