|
@@ -1,14 +1,15 @@
|
|
|
-package cn.newfeifan.mall.module.distri.controller.admin.usercollectbefore;
|
|
|
+package cn.newfeifan.mall.module.distri.controller.app.usercollectbefore;
|
|
|
|
|
|
+import cn.newfeifan.mall.module.distri.controller.app.usercollectbefore.vo.UserCollectBeforePageReqVO;
|
|
|
+import cn.newfeifan.mall.module.distri.controller.app.usercollectbefore.vo.UserCollectBeforeRespVO;
|
|
|
+import cn.newfeifan.mall.module.distri.controller.app.usercollectbefore.vo.UserCollectBeforeSaveReqVO;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import javax.annotation.Resource;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
|
|
-import javax.validation.constraints.*;
|
|
|
import javax.validation.*;
|
|
|
import javax.servlet.http.*;
|
|
|
import java.util.*;
|
|
@@ -25,11 +26,10 @@ import cn.newfeifan.mall.framework.excel.core.util.ExcelUtils;
|
|
|
import cn.newfeifan.mall.framework.operatelog.core.annotations.OperateLog;
|
|
|
import static cn.newfeifan.mall.framework.operatelog.core.enums.OperateTypeEnum.*;
|
|
|
|
|
|
-import cn.newfeifan.mall.module.distri.controller.admin.usercollectbefore.vo.*;
|
|
|
import cn.newfeifan.mall.module.distri.dal.dataobject.usercollectbefore.UserCollectBeforeDO;
|
|
|
import cn.newfeifan.mall.module.distri.service.usercollectbefore.UserCollectBeforeService;
|
|
|
|
|
|
-@Tag(name = "管理后台 - 用户曾经收藏过什么商品的")
|
|
|
+@Tag(name = "用户APP - 用户曾经收藏过什么商品的")
|
|
|
@RestController
|
|
|
@RequestMapping("/distri/user-collect-before")
|
|
|
@Validated
|
|
@@ -40,14 +40,12 @@ public class UserCollectBeforeController {
|
|
|
|
|
|
@PostMapping("/create")
|
|
|
@Operation(summary = "创建用户曾经收藏过什么商品的")
|
|
|
- @PreAuthorize("@ss.hasPermission('distri:user-collect-before:create')")
|
|
|
public CommonResult<Long> createUserCollectBefore(@Valid @RequestBody UserCollectBeforeSaveReqVO createReqVO) {
|
|
|
return success(userCollectBeforeService.createUserCollectBefore(createReqVO));
|
|
|
}
|
|
|
|
|
|
@PutMapping("/update")
|
|
|
@Operation(summary = "更新用户曾经收藏过什么商品的")
|
|
|
- @PreAuthorize("@ss.hasPermission('distri:user-collect-before:update')")
|
|
|
public CommonResult<Boolean> updateUserCollectBefore(@Valid @RequestBody UserCollectBeforeSaveReqVO updateReqVO) {
|
|
|
userCollectBeforeService.updateUserCollectBefore(updateReqVO);
|
|
|
return success(true);
|
|
@@ -56,7 +54,6 @@ public class UserCollectBeforeController {
|
|
|
@DeleteMapping("/delete")
|
|
|
@Operation(summary = "删除用户曾经收藏过什么商品的")
|
|
|
@Parameter(name = "id", description = "编号", required = true)
|
|
|
- @PreAuthorize("@ss.hasPermission('distri:user-collect-before:delete')")
|
|
|
public CommonResult<Boolean> deleteUserCollectBefore(@RequestParam("id") Long id) {
|
|
|
userCollectBeforeService.deleteUserCollectBefore(id);
|
|
|
return success(true);
|
|
@@ -65,7 +62,6 @@ public class UserCollectBeforeController {
|
|
|
@GetMapping("/get")
|
|
|
@Operation(summary = "获得用户曾经收藏过什么商品的")
|
|
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
|
- @PreAuthorize("@ss.hasPermission('distri:user-collect-before:query')")
|
|
|
public CommonResult<UserCollectBeforeRespVO> getUserCollectBefore(@RequestParam("id") Long id) {
|
|
|
UserCollectBeforeDO userCollectBefore = userCollectBeforeService.getUserCollectBefore(id);
|
|
|
return success(BeanUtils.toBean(userCollectBefore, UserCollectBeforeRespVO.class));
|
|
@@ -73,7 +69,6 @@ public class UserCollectBeforeController {
|
|
|
|
|
|
@GetMapping("/page")
|
|
|
@Operation(summary = "获得用户曾经收藏过什么商品的分页")
|
|
|
- @PreAuthorize("@ss.hasPermission('distri:user-collect-before:query')")
|
|
|
public CommonResult<PageResult<UserCollectBeforeRespVO>> getUserCollectBeforePage(@Valid UserCollectBeforePageReqVO pageReqVO) {
|
|
|
PageResult<UserCollectBeforeDO> pageResult = userCollectBeforeService.getUserCollectBeforePage(pageReqVO);
|
|
|
return success(BeanUtils.toBean(pageResult, UserCollectBeforeRespVO.class));
|
|
@@ -81,7 +76,6 @@ public class UserCollectBeforeController {
|
|
|
|
|
|
@GetMapping("/export-excel")
|
|
|
@Operation(summary = "导出用户曾经收藏过什么商品的 Excel")
|
|
|
- @PreAuthorize("@ss.hasPermission('distri:user-collect-before:export')")
|
|
|
@OperateLog(type = EXPORT)
|
|
|
public void exportUserCollectBeforeExcel(@Valid UserCollectBeforePageReqVO pageReqVO,
|
|
|
HttpServletResponse response) throws IOException {
|