Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bailuntec-cost
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
huluobin
bailuntec-cost
Commits
b3613ab6
Commit
b3613ab6
authored
Mar 10, 2021
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
# 更新
parent
8e361801
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
138 additions
and
7 deletions
+138
-7
RoleController.java
...a/com/blt/other/module/sys/controller/RoleController.java
+42
-2
RoleCostCompanyBindingController.java
...dule/sys/controller/RoleCostCompanyBindingController.java
+48
-2
UserRoleBindingController.java
...ther/module/sys/controller/UserRoleBindingController.java
+48
-3
No files found.
cost-service/src/main/java/com/blt/other/module/sys/controller/RoleController.java
View file @
b3613ab6
package
com
.
blt
.
other
.
module
.
sys
.
controller
;
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.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
/**
/**
* <p>
* <p>
*
前端控制器
* 前端控制器
* </p>
* </p>
*
*
* @author robbendev
* @author robbendev
* @since 2021-03-10
* @since 2021-03-10
*/
*/
@Api
(
tags
=
"角色接口"
)
@RestController
@RestController
@RequestMapping
(
"/role"
)
@RequestMapping
(
"/role"
)
public
class
RoleController
{
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
();
}
}
}
cost-service/src/main/java/com/blt/other/module/sys/controller/RoleCostCompanyBindingController.java
View file @
b3613ab6
package
com
.
blt
.
other
.
module
.
sys
.
controller
;
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>
* <p>
...
@@ -13,8 +20,47 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -13,8 +20,47 @@ import org.springframework.web.bind.annotation.RestController;
* @author robbendev
* @author robbendev
* @since 2021-03-10
* @since 2021-03-10
*/
*/
@ApiOperation
(
"角色和主体权限绑定关系接口"
)
@RestController
@RestController
@RequestMapping
(
"/roleCostCompanyBinding"
)
@RequestMapping
(
"/roleCostCompanyBinding"
)
public
class
RoleCostCompanyBindingController
{
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
();
}
}
}
cost-service/src/main/java/com/blt/other/module/sys/controller/UserRoleBindingController.java
View file @
b3613ab6
package
com
.
blt
.
other
.
module
.
sys
.
controller
;
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>
*
前端控制器
* 前端控制器
* </p>
* </p>
*
*
* @author robbendev
* @author robbendev
* @since 2021-03-10
* @since 2021-03-10
*/
*/
@ApiOperation
(
"用户角色绑定关系接口"
)
@RestController
@RestController
@RequestMapping
(
"/userRoleBinding"
)
@RequestMapping
(
"/userRoleBinding"
)
public
class
UserRoleBindingController
{
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
();
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment