|
|
@@ -1,5 +1,6 @@
|
|
|
package cn.iocoder.yudao.module.guide.controller.admin.users;
|
|
|
|
|
|
+
|
|
|
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import jakarta.annotation.Resource;
|
|
|
@@ -43,14 +44,12 @@ public class UsersController {
|
|
|
|
|
|
@PostMapping("/create")
|
|
|
@Operation(summary = "创建导游信息")
|
|
|
- @PreAuthorize("@ss.hasPermission('guide:users:create')")
|
|
|
public CommonResult<Long> createUsers(@Valid @RequestBody UsersSaveReqVO createReqVO) {
|
|
|
return success(usersService.createUsers(createReqVO));
|
|
|
}
|
|
|
|
|
|
@PutMapping("/update")
|
|
|
@Operation(summary = "更新导游信息")
|
|
|
- @PreAuthorize("@ss.hasPermission('guide:users:update')")
|
|
|
public CommonResult<Boolean> updateUsers(@Valid @RequestBody UsersSaveReqVO updateReqVO) {
|
|
|
usersService.updateUsers(updateReqVO);
|
|
|
return success(true);
|
|
|
@@ -59,16 +58,20 @@ public class UsersController {
|
|
|
@DeleteMapping("/delete")
|
|
|
@Operation(summary = "删除导游信息")
|
|
|
@Parameter(name = "id", description = "编号", required = true)
|
|
|
- @PreAuthorize("@ss.hasPermission('guide:users:delete')")
|
|
|
public CommonResult<Boolean> deleteUsers(@RequestParam("id") Long id) {
|
|
|
usersService.deleteUsers(id);
|
|
|
return success(true);
|
|
|
}
|
|
|
|
|
|
+ @PutMapping("/update-password")
|
|
|
+ @Operation(summary = "重置用户密码")
|
|
|
+ public CommonResult<Boolean> updateUserPassword(@Valid @RequestBody UserUpdatePasswordReqVO reqVO) {
|
|
|
+ usersService.updateUserPassword(reqVO.getId(), reqVO.getPassword());
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
@GetMapping("/get")
|
|
|
@Operation(summary = "获得导游信息")
|
|
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
|
- @PreAuthorize("@ss.hasPermission('guide:users:query')")
|
|
|
public CommonResult<UsersRespVO> getUsers(@RequestParam("id") Long id) {
|
|
|
UsersDO users = usersService.getUsers(id);
|
|
|
return success(BeanUtils.toBean(users, UsersRespVO.class));
|
|
|
@@ -76,7 +79,6 @@ public class UsersController {
|
|
|
|
|
|
@GetMapping("/page")
|
|
|
@Operation(summary = "获得导游信息分页")
|
|
|
- @PreAuthorize("@ss.hasPermission('guide:users:query')")
|
|
|
public CommonResult<PageResult<UsersRespVO>> getUsersPage(@Valid UsersPageReqVO pageReqVO) {
|
|
|
PageResult<UsersDO> pageResult = usersService.getUsersPage(pageReqVO);
|
|
|
return success(BeanUtils.toBean(pageResult, UsersRespVO.class));
|
|
|
@@ -84,7 +86,6 @@ public class UsersController {
|
|
|
|
|
|
@GetMapping("/export-excel")
|
|
|
@Operation(summary = "导出导游信息 Excel")
|
|
|
- @PreAuthorize("@ss.hasPermission('guide:users:export')")
|
|
|
@ApiAccessLog(operateType = EXPORT)
|
|
|
public void exportUsersExcel(@Valid UsersPageReqVO pageReqVO,
|
|
|
HttpServletResponse response) throws IOException {
|
|
|
@@ -97,7 +98,6 @@ public class UsersController {
|
|
|
|
|
|
@GetMapping("/get-count")
|
|
|
@Operation(summary = "获得导游 count")
|
|
|
- @PreAuthorize("@ss.hasPermission('guide:users:query')")
|
|
|
public CommonResult<Long> getGuideCount() {
|
|
|
return success(usersService.getCount());
|
|
|
}
|
|
|
@@ -107,7 +107,6 @@ public class UsersController {
|
|
|
@GetMapping("/comment/page")
|
|
|
@Operation(summary = "获得导游评论分页")
|
|
|
@Parameter(name = "guideId", description = "导游编号,关联 AdminUserDO 的 id 编号")
|
|
|
- @PreAuthorize("@ss.hasPermission('guide:users:query')")
|
|
|
public CommonResult<PageResult<CommentDO>> getCommentPage(PageParam pageReqVO,
|
|
|
@RequestParam("guideId") Long guideId) {
|
|
|
return success(usersService.getCommentPage(pageReqVO, guideId));
|
|
|
@@ -115,14 +114,12 @@ public class UsersController {
|
|
|
|
|
|
@PostMapping("/comment/create")
|
|
|
@Operation(summary = "创建导游评论")
|
|
|
- @PreAuthorize("@ss.hasPermission('guide:users:create')")
|
|
|
public CommonResult<Long> createComment(@Valid @RequestBody CommentDO comment) {
|
|
|
return success(usersService.createComment(comment));
|
|
|
}
|
|
|
|
|
|
@PutMapping("/comment/update")
|
|
|
@Operation(summary = "更新导游评论")
|
|
|
- @PreAuthorize("@ss.hasPermission('guide:users:update')")
|
|
|
public CommonResult<Boolean> updateComment(@Valid @RequestBody CommentDO comment) {
|
|
|
usersService.updateComment(comment);
|
|
|
return success(true);
|
|
|
@@ -131,7 +128,6 @@ public class UsersController {
|
|
|
@DeleteMapping("/comment/delete")
|
|
|
@Parameter(name = "id", description = "编号", required = true)
|
|
|
@Operation(summary = "删除导游评论")
|
|
|
- @PreAuthorize("@ss.hasPermission('guide:users:delete')")
|
|
|
public CommonResult<Boolean> deleteComment(@RequestParam("id") Long id) {
|
|
|
usersService.deleteComment(id);
|
|
|
return success(true);
|
|
|
@@ -140,7 +136,6 @@ public class UsersController {
|
|
|
@GetMapping("/comment/get")
|
|
|
@Operation(summary = "获得导游评论")
|
|
|
@Parameter(name = "id", description = "编号", required = true)
|
|
|
- @PreAuthorize("@ss.hasPermission('guide:users:query')")
|
|
|
public CommonResult<CommentDO> getComment(@RequestParam("id") Long id) {
|
|
|
return success(usersService.getComment(id));
|
|
|
}
|
|
|
@@ -148,7 +143,6 @@ public class UsersController {
|
|
|
@GetMapping("/comment/self/get")
|
|
|
@Operation(summary = "获得导游自我评论")
|
|
|
// @Parameter(name = "guideId", description = "导游编号", required = true)
|
|
|
- @PreAuthorize("@ss.hasPermission('guide:users:query')")
|
|
|
public CommonResult<CommentDO> getSelfComment() {
|
|
|
// 获得用户基本信息
|
|
|
// AdminUserDO user = userService.getUser(getLoginUserId());
|