Commit 8fd0f7292594d7582bc97382808c717676812968
1 parent
e8e1f14c
【功能调整】全局:默认 /app-api/* 需要登录,和 /admin-api/* 保持一致,降低大家理解成本
Showing
51 changed files
with
115 additions
and
181 deletions
yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoSecurityAutoConfiguration.java
| 1 | 1 | package cn.iocoder.yudao.framework.security.config; |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.framework.security.core.aop.PreAuthenticatedAspect; | |
| 4 | 3 | import cn.iocoder.yudao.framework.security.core.context.TransmittableThreadLocalSecurityContextHolderStrategy; |
| 5 | 4 | import cn.iocoder.yudao.framework.security.core.filter.TokenAuthenticationFilter; |
| 6 | 5 | import cn.iocoder.yudao.framework.security.core.handler.AccessDeniedHandlerImpl; |
| ... | ... | @@ -39,14 +38,6 @@ public class YudaoSecurityAutoConfiguration { |
| 39 | 38 | private SecurityProperties securityProperties; |
| 40 | 39 | |
| 41 | 40 | /** |
| 42 | - * 处理用户未登录拦截的切面的 Bean | |
| 43 | - */ | |
| 44 | - @Bean | |
| 45 | - public PreAuthenticatedAspect preAuthenticatedAspect() { | |
| 46 | - return new PreAuthenticatedAspect(); | |
| 47 | - } | |
| 48 | - | |
| 49 | - /** | |
| 50 | 41 | * 认证失败处理类 Bean |
| 51 | 42 | */ |
| 52 | 43 | @Bean | ... | ... |
yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java
| ... | ... | @@ -138,8 +138,6 @@ public class YudaoWebSecurityConfigurerAdapter { |
| 138 | 138 | .requestMatchers(HttpMethod.PATCH, permitAllUrls.get(HttpMethod.PATCH).toArray(new String[0])).permitAll() |
| 139 | 139 | // 1.2 基于 yudao.security.permit-all-urls 无需认证 |
| 140 | 140 | .requestMatchers(securityProperties.getPermitAllUrls().toArray(new String[0])).permitAll() |
| 141 | - // 1.3 设置 App API 无需认证 | |
| 142 | - .requestMatchers(buildAppApi("/**")).permitAll() | |
| 143 | 141 | ) |
| 144 | 142 | // ②:每个项目的自定义规则 |
| 145 | 143 | .authorizeHttpRequests(c -> authorizeRequestsCustomizers.forEach(customizer -> customizer.customize(c))) | ... | ... |
yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/annotations/PreAuthenticated.java deleted
| 1 | -package cn.iocoder.yudao.framework.security.core.annotations; | |
| 2 | - | |
| 3 | -import java.lang.annotation.*; | |
| 4 | - | |
| 5 | -/** | |
| 6 | - * 声明用户需要登录 | |
| 7 | - * | |
| 8 | - * 为什么不使用 {@link org.springframework.security.access.prepost.PreAuthorize} 注解,原因是不通过时,抛出的是认证不通过,而不是未登录 | |
| 9 | - * | |
| 10 | - * @author 芋道源码 | |
| 11 | - */ | |
| 12 | -@Target({ElementType.METHOD}) | |
| 13 | -@Retention(RetentionPolicy.RUNTIME) | |
| 14 | -@Inherited | |
| 15 | -@Documented | |
| 16 | -public @interface PreAuthenticated { | |
| 17 | -} |
yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/aop/PreAuthenticatedAspect.java deleted
| 1 | -package cn.iocoder.yudao.framework.security.core.aop; | |
| 2 | - | |
| 3 | -import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; | |
| 4 | -import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; | |
| 5 | -import lombok.extern.slf4j.Slf4j; | |
| 6 | -import org.aspectj.lang.ProceedingJoinPoint; | |
| 7 | -import org.aspectj.lang.annotation.Around; | |
| 8 | -import org.aspectj.lang.annotation.Aspect; | |
| 9 | - | |
| 10 | -import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.UNAUTHORIZED; | |
| 11 | -import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 12 | - | |
| 13 | -@Aspect | |
| 14 | -@Slf4j | |
| 15 | -public class PreAuthenticatedAspect { | |
| 16 | - | |
| 17 | - @Around("@annotation(preAuthenticated)") | |
| 18 | - public Object around(ProceedingJoinPoint joinPoint, PreAuthenticated preAuthenticated) throws Throwable { | |
| 19 | - if (SecurityFrameworkUtils.getLoginUser() == null) { | |
| 20 | - throw exception(UNAUTHORIZED); | |
| 21 | - } | |
| 22 | - return joinPoint.proceed(); | |
| 23 | - } | |
| 24 | - | |
| 25 | -} |
yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/app/file/AppFileController.java
| ... | ... | @@ -9,6 +9,7 @@ import cn.iocoder.yudao.module.infra.service.file.FileService; |
| 9 | 9 | import io.swagger.v3.oas.annotations.Operation; |
| 10 | 10 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 11 | 11 | import jakarta.annotation.Resource; |
| 12 | +import jakarta.annotation.security.PermitAll; | |
| 12 | 13 | import jakarta.validation.Valid; |
| 13 | 14 | import lombok.extern.slf4j.Slf4j; |
| 14 | 15 | import org.springframework.validation.annotation.Validated; |
| ... | ... | @@ -29,6 +30,7 @@ public class AppFileController { |
| 29 | 30 | |
| 30 | 31 | @PostMapping("/upload") |
| 31 | 32 | @Operation(summary = "上传文件") |
| 33 | + @PermitAll | |
| 32 | 34 | public CommonResult<String> uploadFile(AppFileUploadReqVO uploadReqVO) throws Exception { |
| 33 | 35 | MultipartFile file = uploadReqVO.getFile(); |
| 34 | 36 | String path = uploadReqVO.getPath(); |
| ... | ... | @@ -37,12 +39,14 @@ public class AppFileController { |
| 37 | 39 | |
| 38 | 40 | @GetMapping("/presigned-url") |
| 39 | 41 | @Operation(summary = "获取文件预签名地址", description = "模式二:前端上传文件:用于前端直接上传七牛、阿里云 OSS 等文件存储器") |
| 42 | + @PermitAll | |
| 40 | 43 | public CommonResult<FilePresignedUrlRespVO> getFilePresignedUrl(@RequestParam("path") String path) throws Exception { |
| 41 | 44 | return success(fileService.getFilePresignedUrl(path)); |
| 42 | 45 | } |
| 43 | 46 | |
| 44 | 47 | @PostMapping("/create") |
| 45 | 48 | @Operation(summary = "创建文件", description = "模式二:前端上传文件:配合 presigned-url 接口,记录上传了上传的文件") |
| 49 | + @PermitAll | |
| 46 | 50 | public CommonResult<Long> createFile(@Valid @RequestBody FileCreateReqVO createReqVO) { |
| 47 | 51 | return success(fileService.createFile(createReqVO)); |
| 48 | 52 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/category/AppCategoryController.java
| ... | ... | @@ -9,15 +9,14 @@ import cn.iocoder.yudao.module.product.service.category.ProductCategoryService; |
| 9 | 9 | import io.swagger.v3.oas.annotations.Operation; |
| 10 | 10 | import io.swagger.v3.oas.annotations.Parameter; |
| 11 | 11 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 12 | +import jakarta.annotation.Resource; | |
| 13 | +import jakarta.annotation.security.PermitAll; | |
| 12 | 14 | import org.springframework.validation.annotation.Validated; |
| 13 | 15 | import org.springframework.web.bind.annotation.GetMapping; |
| 14 | 16 | import org.springframework.web.bind.annotation.RequestMapping; |
| 15 | 17 | import org.springframework.web.bind.annotation.RequestParam; |
| 16 | 18 | import org.springframework.web.bind.annotation.RestController; |
| 17 | 19 | |
| 18 | -import jakarta.annotation.Resource; | |
| 19 | - | |
| 20 | -import java.util.Collection; | |
| 21 | 20 | import java.util.Collections; |
| 22 | 21 | import java.util.Comparator; |
| 23 | 22 | import java.util.List; |
| ... | ... | @@ -35,6 +34,7 @@ public class AppCategoryController { |
| 35 | 34 | |
| 36 | 35 | @GetMapping("/list") |
| 37 | 36 | @Operation(summary = "获得商品分类列表") |
| 37 | + @PermitAll | |
| 38 | 38 | public CommonResult<List<AppCategoryRespVO>> getProductCategoryList() { |
| 39 | 39 | List<ProductCategoryDO> list = categoryService.getEnableCategoryList(); |
| 40 | 40 | list.sort(Comparator.comparing(ProductCategoryDO::getSort)); |
| ... | ... | @@ -44,6 +44,7 @@ public class AppCategoryController { |
| 44 | 44 | @GetMapping("/list-by-ids") |
| 45 | 45 | @Operation(summary = "获得商品分类列表,指定编号") |
| 46 | 46 | @Parameter(name = "ids", description = "商品分类编号数组", required = true) |
| 47 | + @PermitAll | |
| 47 | 48 | public CommonResult<List<AppCategoryRespVO>> getProductCategoryList(@RequestParam("ids") List<Long> ids) { |
| 48 | 49 | if (CollUtil.isEmpty(ids)) { |
| 49 | 50 | return success(Collections.emptyList()); | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/comment/AppProductCommentController.java
| ... | ... | @@ -11,6 +11,7 @@ import cn.iocoder.yudao.module.product.service.comment.ProductCommentService; |
| 11 | 11 | import io.swagger.v3.oas.annotations.Operation; |
| 12 | 12 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 13 | 13 | import jakarta.annotation.Resource; |
| 14 | +import jakarta.annotation.security.PermitAll; | |
| 14 | 15 | import jakarta.validation.Valid; |
| 15 | 16 | import org.springframework.validation.annotation.Validated; |
| 16 | 17 | import org.springframework.web.bind.annotation.GetMapping; |
| ... | ... | @@ -30,6 +31,7 @@ public class AppProductCommentController { |
| 30 | 31 | |
| 31 | 32 | @GetMapping("/page") |
| 32 | 33 | @Operation(summary = "获得商品评价分页") |
| 34 | + @PermitAll | |
| 33 | 35 | public CommonResult<PageResult<AppProductCommentRespVO>> getCommentPage(@Valid AppCommentPageReqVO pageVO) { |
| 34 | 36 | // 查询评论分页 |
| 35 | 37 | PageResult<ProductCommentDO> pageResult = productCommentService.getCommentPage(pageVO, Boolean.TRUE); | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/favorite/AppFavoriteController.java
| ... | ... | @@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.product.controller.app.favorite; |
| 3 | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 5 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | -import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; | |
| 7 | -import cn.iocoder.yudao.module.product.controller.app.favorite.vo.AppFavoriteBatchReqVO; | |
| 8 | 6 | import cn.iocoder.yudao.module.product.controller.app.favorite.vo.AppFavoritePageReqVO; |
| 9 | 7 | import cn.iocoder.yudao.module.product.controller.app.favorite.vo.AppFavoriteReqVO; |
| 10 | 8 | import cn.iocoder.yudao.module.product.controller.app.favorite.vo.AppFavoriteRespVO; |
| ... | ... | @@ -15,10 +13,10 @@ import cn.iocoder.yudao.module.product.service.favorite.ProductFavoriteService; |
| 15 | 13 | import cn.iocoder.yudao.module.product.service.spu.ProductSpuService; |
| 16 | 14 | import io.swagger.v3.oas.annotations.Operation; |
| 17 | 15 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 18 | -import org.springframework.web.bind.annotation.*; | |
| 19 | - | |
| 20 | 16 | import jakarta.annotation.Resource; |
| 21 | 17 | import jakarta.validation.Valid; |
| 18 | +import org.springframework.web.bind.annotation.*; | |
| 19 | + | |
| 22 | 20 | import java.util.List; |
| 23 | 21 | |
| 24 | 22 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| ... | ... | @@ -37,14 +35,12 @@ public class AppFavoriteController { |
| 37 | 35 | |
| 38 | 36 | @PostMapping(value = "/create") |
| 39 | 37 | @Operation(summary = "添加商品收藏") |
| 40 | - @PreAuthenticated | |
| 41 | 38 | public CommonResult<Long> createFavorite(@RequestBody @Valid AppFavoriteReqVO reqVO) { |
| 42 | 39 | return success(productFavoriteService.createFavorite(getLoginUserId(), reqVO.getSpuId())); |
| 43 | 40 | } |
| 44 | 41 | |
| 45 | 42 | @DeleteMapping(value = "/delete") |
| 46 | 43 | @Operation(summary = "取消单个商品收藏") |
| 47 | - @PreAuthenticated | |
| 48 | 44 | public CommonResult<Boolean> deleteFavorite(@RequestBody @Valid AppFavoriteReqVO reqVO) { |
| 49 | 45 | productFavoriteService.deleteFavorite(getLoginUserId(), reqVO.getSpuId()); |
| 50 | 46 | return success(Boolean.TRUE); |
| ... | ... | @@ -52,7 +48,6 @@ public class AppFavoriteController { |
| 52 | 48 | |
| 53 | 49 | @GetMapping(value = "/page") |
| 54 | 50 | @Operation(summary = "获得商品收藏分页") |
| 55 | - @PreAuthenticated | |
| 56 | 51 | public CommonResult<PageResult<AppFavoriteRespVO>> getFavoritePage(AppFavoritePageReqVO reqVO) { |
| 57 | 52 | PageResult<ProductFavoriteDO> favoritePage = productFavoriteService.getFavoritePage(getLoginUserId(), reqVO); |
| 58 | 53 | if (CollUtil.isEmpty(favoritePage.getList())) { |
| ... | ... | @@ -72,7 +67,6 @@ public class AppFavoriteController { |
| 72 | 67 | |
| 73 | 68 | @GetMapping(value = "/exits") |
| 74 | 69 | @Operation(summary = "检查是否收藏过商品") |
| 75 | - @PreAuthenticated | |
| 76 | 70 | public CommonResult<Boolean> isFavoriteExists(AppFavoriteReqVO reqVO) { |
| 77 | 71 | ProductFavoriteDO favorite = productFavoriteService.getFavorite(getLoginUserId(), reqVO.getSpuId()); |
| 78 | 72 | return success(favorite != null); |
| ... | ... | @@ -80,7 +74,6 @@ public class AppFavoriteController { |
| 80 | 74 | |
| 81 | 75 | @GetMapping(value = "/get-count") |
| 82 | 76 | @Operation(summary = "获得商品收藏数量") |
| 83 | - @PreAuthenticated | |
| 84 | 77 | public CommonResult<Long> getFavoriteCount() { |
| 85 | 78 | return success(productFavoriteService.getFavoriteCount(getLoginUserId())); |
| 86 | 79 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/history/AppProductBrowseHistoryController.java
| ... | ... | @@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollUtil; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 5 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | 6 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 7 | -import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; | |
| 8 | 7 | import cn.iocoder.yudao.module.product.controller.admin.history.vo.ProductBrowseHistoryPageReqVO; |
| 9 | 8 | import cn.iocoder.yudao.module.product.controller.app.history.vo.AppProductBrowseHistoryDeleteReqVO; |
| 10 | 9 | import cn.iocoder.yudao.module.product.controller.app.history.vo.AppProductBrowseHistoryPageReqVO; |
| ... | ... | @@ -40,7 +39,6 @@ public class AppProductBrowseHistoryController { |
| 40 | 39 | |
| 41 | 40 | @DeleteMapping(value = "/delete") |
| 42 | 41 | @Operation(summary = "删除商品浏览记录") |
| 43 | - @PreAuthenticated | |
| 44 | 42 | public CommonResult<Boolean> deleteBrowseHistory(@RequestBody @Valid AppProductBrowseHistoryDeleteReqVO reqVO) { |
| 45 | 43 | productBrowseHistoryService.hideUserBrowseHistory(getLoginUserId(), reqVO.getSpuIds()); |
| 46 | 44 | return success(Boolean.TRUE); |
| ... | ... | @@ -48,7 +46,6 @@ public class AppProductBrowseHistoryController { |
| 48 | 46 | |
| 49 | 47 | @DeleteMapping(value = "/clean") |
| 50 | 48 | @Operation(summary = "清空商品浏览记录") |
| 51 | - @PreAuthenticated | |
| 52 | 49 | public CommonResult<Boolean> deleteBrowseHistory() { |
| 53 | 50 | productBrowseHistoryService.hideUserBrowseHistory(getLoginUserId(), null); |
| 54 | 51 | return success(Boolean.TRUE); |
| ... | ... | @@ -56,7 +53,6 @@ public class AppProductBrowseHistoryController { |
| 56 | 53 | |
| 57 | 54 | @GetMapping(value = "/page") |
| 58 | 55 | @Operation(summary = "获得商品浏览记录分页") |
| 59 | - @PreAuthenticated | |
| 60 | 56 | public CommonResult<PageResult<AppProductBrowseHistoryRespVO>> getBrowseHistoryPage(AppProductBrowseHistoryPageReqVO reqVO) { |
| 61 | 57 | ProductBrowseHistoryPageReqVO pageReqVO = BeanUtils.toBean(reqVO, ProductBrowseHistoryPageReqVO.class) |
| 62 | 58 | .setUserId(getLoginUserId()) | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/AppProductSpuController.java
| ... | ... | @@ -17,6 +17,7 @@ import io.swagger.v3.oas.annotations.Operation; |
| 17 | 17 | import io.swagger.v3.oas.annotations.Parameter; |
| 18 | 18 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 19 | 19 | import jakarta.annotation.Resource; |
| 20 | +import jakarta.annotation.security.PermitAll; | |
| 20 | 21 | import jakarta.validation.Valid; |
| 21 | 22 | import org.springframework.validation.annotation.Validated; |
| 22 | 23 | import org.springframework.web.bind.annotation.GetMapping; |
| ... | ... | @@ -50,6 +51,7 @@ public class AppProductSpuController { |
| 50 | 51 | @GetMapping("/list-by-ids") |
| 51 | 52 | @Operation(summary = "获得商品 SPU 列表") |
| 52 | 53 | @Parameter(name = "ids", description = "编号列表", required = true) |
| 54 | + @PermitAll | |
| 53 | 55 | public CommonResult<List<AppProductSpuRespVO>> getSpuList(@RequestParam("ids") Set<Long> ids) { |
| 54 | 56 | List<ProductSpuDO> list = productSpuService.getSpuList(ids); |
| 55 | 57 | if (CollUtil.isEmpty(list)) { |
| ... | ... | @@ -64,6 +66,7 @@ public class AppProductSpuController { |
| 64 | 66 | |
| 65 | 67 | @GetMapping("/page") |
| 66 | 68 | @Operation(summary = "获得商品 SPU 分页") |
| 69 | + @PermitAll | |
| 67 | 70 | public CommonResult<PageResult<AppProductSpuRespVO>> getSpuPage(@Valid AppProductSpuPageReqVO pageVO) { |
| 68 | 71 | PageResult<ProductSpuDO> pageResult = productSpuService.getSpuPage(pageVO); |
| 69 | 72 | if (CollUtil.isEmpty(pageResult.getList())) { |
| ... | ... | @@ -79,6 +82,7 @@ public class AppProductSpuController { |
| 79 | 82 | @GetMapping("/get-detail") |
| 80 | 83 | @Operation(summary = "获得商品 SPU 明细") |
| 81 | 84 | @Parameter(name = "id", description = "编号", required = true) |
| 85 | + @PermitAll | |
| 82 | 86 | public CommonResult<AppProductSpuDetailRespVO> getSpuDetail(@RequestParam("id") Long id) { |
| 83 | 87 | // 获得商品 SPU |
| 84 | 88 | ProductSpuDO spu = productSpuService.getSpu(id); | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/activity/AppActivityController.java
| ... | ... | @@ -13,6 +13,7 @@ import io.swagger.v3.oas.annotations.Operation; |
| 13 | 13 | import io.swagger.v3.oas.annotations.Parameter; |
| 14 | 14 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 15 | 15 | import jakarta.annotation.Resource; |
| 16 | +import jakarta.annotation.security.PermitAll; | |
| 16 | 17 | import org.springframework.validation.annotation.Validated; |
| 17 | 18 | import org.springframework.web.bind.annotation.GetMapping; |
| 18 | 19 | import org.springframework.web.bind.annotation.RequestMapping; |
| ... | ... | @@ -40,6 +41,7 @@ public class AppActivityController { |
| 40 | 41 | @GetMapping("/list-by-spu-id") |
| 41 | 42 | @Operation(summary = "获得单个商品,进行中的拼团、秒杀、砍价活动信息", description = "每种活动,只返回一个") |
| 42 | 43 | @Parameter(name = "spuId", description = "商品编号", required = true) |
| 44 | + @PermitAll | |
| 43 | 45 | public CommonResult<List<AppActivityRespVO>> getActivityListBySpuId(@RequestParam("spuId") Long spuId) { |
| 44 | 46 | List<AppActivityRespVO> activityVOList = new ArrayList<>(); |
| 45 | 47 | // 1. 拼团活动 | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/article/AppArticleController.java
| ... | ... | @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.Operation; |
| 12 | 12 | import io.swagger.v3.oas.annotations.Parameter; |
| 13 | 13 | import io.swagger.v3.oas.annotations.Parameters; |
| 14 | 14 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 15 | +import jakarta.annotation.security.PermitAll; | |
| 15 | 16 | import org.springframework.validation.annotation.Validated; |
| 16 | 17 | import org.springframework.web.bind.annotation.PutMapping; |
| 17 | 18 | import org.springframework.web.bind.annotation.RequestMapping; |
| ... | ... | @@ -38,6 +39,7 @@ public class AppArticleController { |
| 38 | 39 | @Parameter(name = "recommendHot", description = "是否热门", example = "false"), // 场景一:查看指定的文章 |
| 39 | 40 | @Parameter(name = "recommendBanner", description = "是否轮播图", example = "false") // 场景二:查看指定的文章 |
| 40 | 41 | }) |
| 42 | + @PermitAll | |
| 41 | 43 | public CommonResult<List<AppArticleRespVO>> getArticleList( |
| 42 | 44 | @RequestParam(value = "recommendHot", required = false) Boolean recommendHot, |
| 43 | 45 | @RequestParam(value = "recommendBanner", required = false) Boolean recommendBanner) { |
| ... | ... | @@ -47,6 +49,7 @@ public class AppArticleController { |
| 47 | 49 | |
| 48 | 50 | @RequestMapping("/page") |
| 49 | 51 | @Operation(summary = "获得文章详情分页") |
| 52 | + @PermitAll | |
| 50 | 53 | public CommonResult<PageResult<AppArticleRespVO>> getArticlePage(AppArticlePageReqVO pageReqVO) { |
| 51 | 54 | return success(ArticleConvert.INSTANCE.convertPage02(articleService.getArticlePage(pageReqVO))); |
| 52 | 55 | } |
| ... | ... | @@ -57,6 +60,7 @@ public class AppArticleController { |
| 57 | 60 | @Parameter(name = "id", description = "文章编号", example = "1024"), |
| 58 | 61 | @Parameter(name = "title", description = "文章标题", example = "1024"), |
| 59 | 62 | }) |
| 63 | + @PermitAll | |
| 60 | 64 | public CommonResult<AppArticleRespVO> getArticle(@RequestParam(value = "id", required = false) Long id, |
| 61 | 65 | @RequestParam(value = "title", required = false) String title) { |
| 62 | 66 | ArticleDO article = id != null ? articleService.getArticle(id) |
| ... | ... | @@ -67,6 +71,7 @@ public class AppArticleController { |
| 67 | 71 | @PutMapping("/add-browse-count") |
| 68 | 72 | @Operation(summary = "增加文章浏览量") |
| 69 | 73 | @Parameter(name = "id", description = "文章编号", example = "1024") |
| 74 | + @PermitAll | |
| 70 | 75 | public CommonResult<Boolean> addBrowseCount(@RequestParam("id") Long id) { |
| 71 | 76 | articleService.addArticleBrowseCount(id); |
| 72 | 77 | return success(true); | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/banner/AppBannerController.java
| ... | ... | @@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.promotion.service.banner.BannerService; |
| 8 | 8 | import io.swagger.v3.oas.annotations.Operation; |
| 9 | 9 | import io.swagger.v3.oas.annotations.Parameter; |
| 10 | 10 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 11 | +import jakarta.annotation.security.PermitAll; | |
| 11 | 12 | import org.springframework.validation.annotation.Validated; |
| 12 | 13 | import org.springframework.web.bind.annotation.*; |
| 13 | 14 | |
| ... | ... | @@ -28,6 +29,7 @@ public class AppBannerController { |
| 28 | 29 | @GetMapping("/list") |
| 29 | 30 | @Operation(summary = "获得 banner 列表") |
| 30 | 31 | @Parameter(name = "position", description = "Banner position", example = "1") |
| 32 | + @PermitAll | |
| 31 | 33 | public CommonResult<List<AppBannerRespVO>> getBannerList(@RequestParam("position") Integer position) { |
| 32 | 34 | List<BannerDO> bannerList = bannerService.getBannerListByPosition(position); |
| 33 | 35 | return success(BannerConvert.INSTANCE.convertList01(bannerList)); |
| ... | ... | @@ -36,6 +38,7 @@ public class AppBannerController { |
| 36 | 38 | @PutMapping("/add-browse-count") |
| 37 | 39 | @Operation(summary = "增加 Banner 点击量") |
| 38 | 40 | @Parameter(name = "id", description = "Banner 编号", example = "1024") |
| 41 | + @PermitAll | |
| 39 | 42 | public CommonResult<Boolean> addBrowseCount(@RequestParam("id") Long id) { |
| 40 | 43 | bannerService.addBannerBrowseCount(id); |
| 41 | 44 | return success(true); | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/bargain/AppBargainActivityController.java
| ... | ... | @@ -18,6 +18,7 @@ import com.google.common.cache.LoadingCache; |
| 18 | 18 | import io.swagger.v3.oas.annotations.Operation; |
| 19 | 19 | import io.swagger.v3.oas.annotations.Parameter; |
| 20 | 20 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 21 | +import jakarta.annotation.security.PermitAll; | |
| 21 | 22 | import org.springframework.validation.annotation.Validated; |
| 22 | 23 | import org.springframework.web.bind.annotation.GetMapping; |
| 23 | 24 | import org.springframework.web.bind.annotation.RequestMapping; |
| ... | ... | @@ -63,6 +64,7 @@ public class AppBargainActivityController { |
| 63 | 64 | @GetMapping("/list") |
| 64 | 65 | @Operation(summary = "获得砍价活动列表", description = "用于小程序首页") |
| 65 | 66 | @Parameter(name = "count", description = "需要展示的数量", example = "6") |
| 67 | + @PermitAll | |
| 66 | 68 | public CommonResult<List<AppBargainActivityRespVO>> getBargainActivityList( |
| 67 | 69 | @RequestParam(name = "count", defaultValue = "6") Integer count) { |
| 68 | 70 | return success(bargainActivityListCache.getUnchecked(count)); |
| ... | ... | @@ -80,6 +82,7 @@ public class AppBargainActivityController { |
| 80 | 82 | |
| 81 | 83 | @GetMapping("/page") |
| 82 | 84 | @Operation(summary = "获得砍价活动分页") |
| 85 | + @PermitAll | |
| 83 | 86 | public CommonResult<PageResult<AppBargainActivityRespVO>> getBargainActivityPage(PageParam pageReqVO) { |
| 84 | 87 | PageResult<BargainActivityDO> result = bargainActivityService.getBargainActivityPage(pageReqVO); |
| 85 | 88 | if (CollUtil.isEmpty(result.getList())) { |
| ... | ... | @@ -93,6 +96,7 @@ public class AppBargainActivityController { |
| 93 | 96 | @GetMapping("/get-detail") |
| 94 | 97 | @Operation(summary = "获得砍价活动详情") |
| 95 | 98 | @Parameter(name = "id", description = "活动编号", example = "1") |
| 99 | + @PermitAll | |
| 96 | 100 | public CommonResult<AppBargainActivityDetailRespVO> getBargainActivityDetail(@RequestParam("id") Long id) { |
| 97 | 101 | BargainActivityDO activity = bargainActivityService.getBargainActivity(id); |
| 98 | 102 | if (activity == null) { | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/bargain/AppBargainRecordController.java
| ... | ... | @@ -5,7 +5,6 @@ import cn.hutool.core.lang.Assert; |
| 5 | 5 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 6 | 6 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 7 | 7 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 8 | -import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; | |
| 9 | 8 | import cn.iocoder.yudao.module.member.api.user.MemberUserApi; |
| 10 | 9 | import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; |
| 11 | 10 | import cn.iocoder.yudao.module.product.api.spu.ProductSpuApi; |
| ... | ... | @@ -27,10 +26,11 @@ import io.swagger.v3.oas.annotations.Operation; |
| 27 | 26 | import io.swagger.v3.oas.annotations.Parameter; |
| 28 | 27 | import io.swagger.v3.oas.annotations.Parameters; |
| 29 | 28 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 29 | +import jakarta.annotation.Resource; | |
| 30 | +import jakarta.annotation.security.PermitAll; | |
| 30 | 31 | import org.springframework.validation.annotation.Validated; |
| 31 | 32 | import org.springframework.web.bind.annotation.*; |
| 32 | 33 | |
| 33 | -import jakarta.annotation.Resource; | |
| 34 | 34 | import java.util.Collections; |
| 35 | 35 | import java.util.List; |
| 36 | 36 | import java.util.Map; |
| ... | ... | @@ -61,6 +61,7 @@ public class AppBargainRecordController { |
| 61 | 61 | |
| 62 | 62 | @GetMapping("/get-summary") |
| 63 | 63 | @Operation(summary = "获得砍价记录的概要信息", description = "用于小程序首页") |
| 64 | + @PermitAll | |
| 64 | 65 | public CommonResult<AppBargainRecordSummaryRespVO> getBargainRecordSummary() { |
| 65 | 66 | // 砍价成功的用户数量 |
| 66 | 67 | Integer successUserCount = bargainRecordService.getBargainRecordUserCount( |
| ... | ... | @@ -86,6 +87,7 @@ public class AppBargainRecordController { |
| 86 | 87 | @Parameter(name = "id", description = "砍价记录编号", example = "111"), // 场景一:查看指定的砍价记录 |
| 87 | 88 | @Parameter(name = "activityId", description = "砍价活动编号", example = "222") // 场景二:查看指定的砍价活动 |
| 88 | 89 | }) |
| 90 | + @PermitAll | |
| 89 | 91 | public CommonResult<AppBargainRecordDetailRespVO> getBargainRecordDetail( |
| 90 | 92 | @RequestParam(value = "id", required = false) Long id, |
| 91 | 93 | @RequestParam(value = "activityId", required = false) Long activityId) { |
| ... | ... | @@ -153,7 +155,6 @@ public class AppBargainRecordController { |
| 153 | 155 | |
| 154 | 156 | @PostMapping("/create") |
| 155 | 157 | @Operation(summary = "创建砍价记录", description = "参与砍价活动") |
| 156 | - @PreAuthenticated | |
| 157 | 158 | public CommonResult<Long> createBargainRecord(@RequestBody AppBargainRecordCreateReqVO reqVO) { |
| 158 | 159 | Long recordId = bargainRecordService.createBargainRecord(getLoginUserId(), reqVO); |
| 159 | 160 | return success(recordId); | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationActivityController.java
| ... | ... | @@ -18,6 +18,7 @@ import io.swagger.v3.oas.annotations.Operation; |
| 18 | 18 | import io.swagger.v3.oas.annotations.Parameter; |
| 19 | 19 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 20 | 20 | import jakarta.annotation.Resource; |
| 21 | +import jakarta.annotation.security.PermitAll; | |
| 21 | 22 | import org.springframework.validation.annotation.Validated; |
| 22 | 23 | import org.springframework.web.bind.annotation.GetMapping; |
| 23 | 24 | import org.springframework.web.bind.annotation.RequestMapping; |
| ... | ... | @@ -44,6 +45,7 @@ public class AppCombinationActivityController { |
| 44 | 45 | |
| 45 | 46 | @GetMapping("/page") |
| 46 | 47 | @Operation(summary = "获得拼团活动分页") |
| 48 | + @PermitAll | |
| 47 | 49 | public CommonResult<PageResult<AppCombinationActivityRespVO>> getCombinationActivityPage(PageParam pageParam) { |
| 48 | 50 | PageResult<CombinationActivityDO> pageResult = activityService.getCombinationActivityPage(pageParam); |
| 49 | 51 | if (CollUtil.isEmpty(pageResult.getList())) { |
| ... | ... | @@ -59,6 +61,7 @@ public class AppCombinationActivityController { |
| 59 | 61 | @GetMapping("/list-by-ids") |
| 60 | 62 | @Operation(summary = "获得拼团活动列表,基于活动编号数组") |
| 61 | 63 | @Parameter(name = "ids", description = "活动编号数组", required = true, example = "[1024, 1025]") |
| 64 | + @PermitAll | |
| 62 | 65 | public CommonResult<List<AppCombinationActivityRespVO>> getCombinationActivityListByIds(@RequestParam("ids") List<Long> ids) { |
| 63 | 66 | // 1. 获得开启的活动列表 |
| 64 | 67 | List<CombinationActivityDO> activityList = activityService.getCombinationActivityListByIds(ids); |
| ... | ... | @@ -76,6 +79,7 @@ public class AppCombinationActivityController { |
| 76 | 79 | @GetMapping("/get-detail") |
| 77 | 80 | @Operation(summary = "获得拼团活动明细") |
| 78 | 81 | @Parameter(name = "id", description = "活动编号", required = true, example = "1024") |
| 82 | + @PermitAll | |
| 79 | 83 | public CommonResult<AppCombinationActivityDetailRespVO> getCombinationActivityDetail(@RequestParam("id") Long id) { |
| 80 | 84 | // 1. 获取活动 |
| 81 | 85 | CombinationActivityDO activity = activityService.getCombinationActivity(id); | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationRecordController.java
| ... | ... | @@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.promotion.controller.app.combination; |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 5 | 5 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 6 | -import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; | |
| 7 | 6 | import cn.iocoder.yudao.module.promotion.controller.app.combination.vo.record.AppCombinationRecordDetailRespVO; |
| 8 | 7 | import cn.iocoder.yudao.module.promotion.controller.app.combination.vo.record.AppCombinationRecordPageReqVO; |
| 9 | 8 | import cn.iocoder.yudao.module.promotion.controller.app.combination.vo.record.AppCombinationRecordRespVO; |
| ... | ... | @@ -16,6 +15,7 @@ import io.swagger.v3.oas.annotations.Parameter; |
| 16 | 15 | import io.swagger.v3.oas.annotations.Parameters; |
| 17 | 16 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 18 | 17 | import jakarta.annotation.Resource; |
| 18 | +import jakarta.annotation.security.PermitAll; | |
| 19 | 19 | import jakarta.validation.Valid; |
| 20 | 20 | import jakarta.validation.constraints.Max; |
| 21 | 21 | import org.springframework.validation.annotation.Validated; |
| ... | ... | @@ -43,6 +43,7 @@ public class AppCombinationRecordController { |
| 43 | 43 | |
| 44 | 44 | @GetMapping("/get-summary") |
| 45 | 45 | @Operation(summary = "获得拼团记录的概要信息", description = "用于小程序首页") |
| 46 | + @PermitAll | |
| 46 | 47 | public CommonResult<AppCombinationRecordSummaryRespVO> getCombinationRecordSummary() { |
| 47 | 48 | AppCombinationRecordSummaryRespVO summary = new AppCombinationRecordSummaryRespVO(); |
| 48 | 49 | // 1. 获得拼团参与用户数量 |
| ... | ... | @@ -68,6 +69,7 @@ public class AppCombinationRecordController { |
| 68 | 69 | @Parameter(name = "status", description = "拼团状态"), // 对应 CombinationRecordStatusEnum 枚举 |
| 69 | 70 | @Parameter(name = "count", description = "数量") |
| 70 | 71 | }) |
| 72 | + @PermitAll | |
| 71 | 73 | public CommonResult<List<AppCombinationRecordRespVO>> getHeadCombinationRecordList( |
| 72 | 74 | @RequestParam(value = "activityId", required = false) Long activityId, |
| 73 | 75 | @RequestParam("status") Integer status, |
| ... | ... | @@ -78,7 +80,6 @@ public class AppCombinationRecordController { |
| 78 | 80 | |
| 79 | 81 | @GetMapping("/page") |
| 80 | 82 | @Operation(summary = "获得我的拼团记录分页") |
| 81 | - @PreAuthenticated | |
| 82 | 83 | public CommonResult<PageResult<AppCombinationRecordRespVO>> getCombinationRecordPage( |
| 83 | 84 | @Valid AppCombinationRecordPageReqVO pageReqVO) { |
| 84 | 85 | PageResult<CombinationRecordDO> pageResult = combinationRecordService.getCombinationRecordPage( |
| ... | ... | @@ -89,6 +90,7 @@ public class AppCombinationRecordController { |
| 89 | 90 | @GetMapping("/get-detail") |
| 90 | 91 | @Operation(summary = "获得拼团记录明细") |
| 91 | 92 | @Parameter(name = "id", description = "拼团记录编号", required = true, example = "1024") |
| 93 | + @PermitAll | |
| 92 | 94 | public CommonResult<AppCombinationRecordDetailRespVO> getCombinationRecordDetail(@RequestParam("id") Long id) { |
| 93 | 95 | // 1. 查找这条拼团记录 |
| 94 | 96 | CombinationRecordDO record = combinationRecordService.getCombinationRecordById(id); | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/coupon/AppCouponController.java
| ... | ... | @@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollUtil; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 5 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | 6 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 7 | -import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; | |
| 8 | 7 | import cn.iocoder.yudao.module.promotion.controller.app.coupon.vo.coupon.AppCouponPageReqVO; |
| 9 | 8 | import cn.iocoder.yudao.module.promotion.controller.app.coupon.vo.coupon.AppCouponRespVO; |
| 10 | 9 | import cn.iocoder.yudao.module.promotion.controller.app.coupon.vo.coupon.AppCouponTakeReqVO; |
| ... | ... | @@ -41,7 +40,6 @@ public class AppCouponController { |
| 41 | 40 | @PostMapping("/take") |
| 42 | 41 | @Operation(summary = "领取优惠劵") |
| 43 | 42 | @Parameter(name = "templateId", description = "优惠券模板编号", required = true, example = "1024") |
| 44 | - @PreAuthenticated | |
| 45 | 43 | public CommonResult<Boolean> takeCoupon(@Valid @RequestBody AppCouponTakeReqVO reqVO) { |
| 46 | 44 | // 1. 领取优惠劵 |
| 47 | 45 | Long userId = getLoginUserId(); |
| ... | ... | @@ -59,7 +57,6 @@ public class AppCouponController { |
| 59 | 57 | |
| 60 | 58 | @GetMapping("/page") |
| 61 | 59 | @Operation(summary = "我的优惠劵列表") |
| 62 | - @PreAuthenticated | |
| 63 | 60 | public CommonResult<PageResult<AppCouponRespVO>> getCouponPage(AppCouponPageReqVO pageReqVO) { |
| 64 | 61 | PageResult<CouponDO> pageResult = couponService.getCouponPage( |
| 65 | 62 | CouponConvert.INSTANCE.convert(pageReqVO, Collections.singleton(getLoginUserId()))); |
| ... | ... | @@ -69,7 +66,6 @@ public class AppCouponController { |
| 69 | 66 | @GetMapping("/get") |
| 70 | 67 | @Operation(summary = "获得优惠劵") |
| 71 | 68 | @Parameter(name = "id", description = "优惠劵编号", required = true, example = "1024") |
| 72 | - @PreAuthenticated | |
| 73 | 69 | public CommonResult<AppCouponRespVO> getCoupon(@RequestParam("id") Long id) { |
| 74 | 70 | CouponDO coupon = couponService.getCoupon(getLoginUserId(), id); |
| 75 | 71 | return success(BeanUtils.toBean(coupon, AppCouponRespVO.class)); |
| ... | ... | @@ -77,7 +73,6 @@ public class AppCouponController { |
| 77 | 73 | |
| 78 | 74 | @GetMapping(value = "/get-unused-count") |
| 79 | 75 | @Operation(summary = "获得未使用的优惠劵数量") |
| 80 | - @PreAuthenticated | |
| 81 | 76 | public CommonResult<Long> getUnusedCouponCount() { |
| 82 | 77 | return success(couponService.getUnusedCouponCount(getLoginUserId())); |
| 83 | 78 | } | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/coupon/AppCouponTemplateController.java
| ... | ... | @@ -19,6 +19,7 @@ import io.swagger.v3.oas.annotations.Parameter; |
| 19 | 19 | import io.swagger.v3.oas.annotations.Parameters; |
| 20 | 20 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 21 | 21 | import jakarta.annotation.Resource; |
| 22 | +import jakarta.annotation.security.PermitAll; | |
| 22 | 23 | import org.springframework.validation.annotation.Validated; |
| 23 | 24 | import org.springframework.web.bind.annotation.GetMapping; |
| 24 | 25 | import org.springframework.web.bind.annotation.RequestMapping; |
| ... | ... | @@ -48,6 +49,7 @@ public class AppCouponTemplateController { |
| 48 | 49 | @GetMapping("/get") |
| 49 | 50 | @Operation(summary = "获得优惠劵模版") |
| 50 | 51 | @Parameter(name = "id", description = "优惠券模板编号", required = true, example = "1024") |
| 52 | + @PermitAll | |
| 51 | 53 | public CommonResult<AppCouponTemplateRespVO> getCouponTemplate(Long id) { |
| 52 | 54 | CouponTemplateDO template = couponTemplateService.getCouponTemplate(id); |
| 53 | 55 | if (template == null) { |
| ... | ... | @@ -66,6 +68,7 @@ public class AppCouponTemplateController { |
| 66 | 68 | @Parameter(name = "productScope", description = "使用类型"), |
| 67 | 69 | @Parameter(name = "count", description = "数量", required = true) |
| 68 | 70 | }) |
| 71 | + @PermitAll | |
| 69 | 72 | public CommonResult<List<AppCouponTemplateRespVO>> getCouponTemplateList( |
| 70 | 73 | @RequestParam(value = "spuId", required = false) Long spuId, |
| 71 | 74 | @RequestParam(value = "productScope", required = false) Integer productScope, |
| ... | ... | @@ -88,6 +91,7 @@ public class AppCouponTemplateController { |
| 88 | 91 | @GetMapping("/list-by-ids") |
| 89 | 92 | @Operation(summary = "获得优惠劵模版列表") |
| 90 | 93 | @Parameter(name = "ids", description = "优惠券模板编号列表") |
| 94 | + @PermitAll | |
| 91 | 95 | public CommonResult<List<AppCouponTemplateRespVO>> getCouponTemplateList( |
| 92 | 96 | @RequestParam(value = "ids", required = false) Set<Long> ids) { |
| 93 | 97 | // 1. 查询 |
| ... | ... | @@ -101,6 +105,7 @@ public class AppCouponTemplateController { |
| 101 | 105 | |
| 102 | 106 | @GetMapping("/page") |
| 103 | 107 | @Operation(summary = "获得优惠劵模版分页") |
| 108 | + @PermitAll | |
| 104 | 109 | public CommonResult<PageResult<AppCouponTemplateRespVO>> getCouponTemplatePage(AppCouponTemplatePageReqVO pageReqVO) { |
| 105 | 110 | // 1.1 处理查询条件:商品范围编号 |
| 106 | 111 | Long productScopeValue = getProductScopeValue(pageReqVO.getProductScope(), pageReqVO.getSpuId()); | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/diy/AppDiyPageController.java
| ... | ... | @@ -9,6 +9,7 @@ import io.swagger.v3.oas.annotations.Operation; |
| 9 | 9 | import io.swagger.v3.oas.annotations.Parameter; |
| 10 | 10 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 11 | 11 | import jakarta.annotation.Resource; |
| 12 | +import jakarta.annotation.security.PermitAll; | |
| 12 | 13 | import org.springframework.validation.annotation.Validated; |
| 13 | 14 | import org.springframework.web.bind.annotation.GetMapping; |
| 14 | 15 | import org.springframework.web.bind.annotation.RequestMapping; |
| ... | ... | @@ -29,6 +30,7 @@ public class AppDiyPageController { |
| 29 | 30 | @GetMapping("/get") |
| 30 | 31 | @Operation(summary = "获得装修页面") |
| 31 | 32 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 33 | + @PermitAll | |
| 32 | 34 | public CommonResult<AppDiyPagePropertyRespVO> getDiyPage(@RequestParam("id") Long id) { |
| 33 | 35 | DiyPageDO diyPage = diyPageService.getDiyPage(id); |
| 34 | 36 | return success(BeanUtils.toBean(diyPage, AppDiyPagePropertyRespVO.class)); | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/diy/AppDiyTemplateController.java
| ... | ... | @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.Operation; |
| 12 | 12 | import io.swagger.v3.oas.annotations.Parameter; |
| 13 | 13 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 14 | 14 | import jakarta.annotation.Resource; |
| 15 | +import jakarta.annotation.security.PermitAll; | |
| 15 | 16 | import org.springframework.validation.annotation.Validated; |
| 16 | 17 | import org.springframework.web.bind.annotation.GetMapping; |
| 17 | 18 | import org.springframework.web.bind.annotation.RequestMapping; |
| ... | ... | @@ -37,6 +38,7 @@ public class AppDiyTemplateController { |
| 37 | 38 | // TODO @疯狂:要不要把 used 和 get 接口合并哈;不传递 id,直接拿默认; |
| 38 | 39 | @GetMapping("/used") |
| 39 | 40 | @Operation(summary = "使用中的装修模板") |
| 41 | + @PermitAll | |
| 40 | 42 | public CommonResult<AppDiyTemplatePropertyRespVO> getUsedDiyTemplate() { |
| 41 | 43 | DiyTemplateDO diyTemplate = diyTemplateService.getUsedDiyTemplate(); |
| 42 | 44 | return success(buildVo(diyTemplate)); |
| ... | ... | @@ -45,6 +47,7 @@ public class AppDiyTemplateController { |
| 45 | 47 | @GetMapping("/get") |
| 46 | 48 | @Operation(summary = "获得装修模板") |
| 47 | 49 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 50 | + @PermitAll | |
| 48 | 51 | public CommonResult<AppDiyTemplatePropertyRespVO> getDiyTemplate(@RequestParam("id") Long id) { |
| 49 | 52 | DiyTemplateDO diyTemplate = diyTemplateService.getDiyTemplate(id); |
| 50 | 53 | return success(buildVo(diyTemplate)); | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/kefu/AppKeFuMessageController.java
| ... | ... | @@ -4,7 +4,6 @@ import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 5 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | 6 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 7 | -import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; | |
| 8 | 7 | import cn.iocoder.yudao.module.promotion.controller.admin.kefu.vo.message.KeFuMessageRespVO; |
| 9 | 8 | import cn.iocoder.yudao.module.promotion.controller.app.kefu.vo.message.AppKeFuMessagePageReqVO; |
| 10 | 9 | import cn.iocoder.yudao.module.promotion.controller.app.kefu.vo.message.AppKeFuMessageSendReqVO; |
| ... | ... | @@ -32,7 +31,6 @@ public class AppKeFuMessageController { |
| 32 | 31 | |
| 33 | 32 | @PostMapping("/send") |
| 34 | 33 | @Operation(summary = "发送客服消息") |
| 35 | - @PreAuthenticated | |
| 36 | 34 | public CommonResult<Long> sendKefuMessage(@Valid @RequestBody AppKeFuMessageSendReqVO sendReqVO) { |
| 37 | 35 | sendReqVO.setSenderId(getLoginUserId()).setSenderType(UserTypeEnum.MEMBER.getValue()); // 设置用户编号和类型 |
| 38 | 36 | return success(kefuMessageService.sendKefuMessage(sendReqVO)); |
| ... | ... | @@ -41,7 +39,6 @@ public class AppKeFuMessageController { |
| 41 | 39 | @PutMapping("/update-read-status") |
| 42 | 40 | @Operation(summary = "更新客服消息已读状态") |
| 43 | 41 | @Parameter(name = "conversationId", description = "会话编号", required = true) |
| 44 | - @PreAuthenticated | |
| 45 | 42 | public CommonResult<Boolean> updateKefuMessageReadStatus(@RequestParam("conversationId") Long conversationId) { |
| 46 | 43 | kefuMessageService.updateKeFuMessageReadStatus(conversationId, getLoginUserId(), UserTypeEnum.MEMBER.getValue()); |
| 47 | 44 | return success(true); |
| ... | ... | @@ -49,7 +46,6 @@ public class AppKeFuMessageController { |
| 49 | 46 | |
| 50 | 47 | @GetMapping("/page") |
| 51 | 48 | @Operation(summary = "获得客服消息分页") |
| 52 | - @PreAuthenticated | |
| 53 | 49 | public CommonResult<PageResult<KeFuMessageRespVO>> getKefuMessagePage(@Valid AppKeFuMessagePageReqVO pageReqVO) { |
| 54 | 50 | PageResult<KeFuMessageDO> pageResult = kefuMessageService.getKeFuMessagePage(pageReqVO, getLoginUserId()); |
| 55 | 51 | return success(BeanUtils.toBean(pageResult, KeFuMessageRespVO.class)); | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/point/AppPointActivityController.java
| ... | ... | @@ -19,6 +19,7 @@ import io.swagger.v3.oas.annotations.Operation; |
| 19 | 19 | import io.swagger.v3.oas.annotations.Parameter; |
| 20 | 20 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 21 | 21 | import jakarta.annotation.Resource; |
| 22 | +import jakarta.annotation.security.PermitAll; | |
| 22 | 23 | import org.springframework.validation.annotation.Validated; |
| 23 | 24 | import org.springframework.web.bind.annotation.GetMapping; |
| 24 | 25 | import org.springframework.web.bind.annotation.RequestMapping; |
| ... | ... | @@ -47,6 +48,7 @@ public class AppPointActivityController { |
| 47 | 48 | |
| 48 | 49 | @GetMapping("/page") |
| 49 | 50 | @Operation(summary = "获得积分商城活动分页") |
| 51 | + @PermitAll | |
| 50 | 52 | public CommonResult<PageResult<AppPointActivityRespVO>> getPointActivityPage(AppPointActivityPageReqVO pageReqVO) { |
| 51 | 53 | // 1. 查询满足当前阶段的活动 |
| 52 | 54 | PageResult<PointActivityDO> pageResult = pointActivityService.getPointActivityPage( |
| ... | ... | @@ -63,6 +65,7 @@ public class AppPointActivityController { |
| 63 | 65 | @GetMapping("/get-detail") |
| 64 | 66 | @Operation(summary = "获得积分商城活动明细") |
| 65 | 67 | @Parameter(name = "id", description = "活动编号", required = true, example = "1024") |
| 68 | + @PermitAll | |
| 66 | 69 | public CommonResult<AppPointActivityDetailRespVO> getPointActivity(@RequestParam("id") Long id) { |
| 67 | 70 | // 1. 获取活动 |
| 68 | 71 | PointActivityDO activity = pointActivityService.getPointActivity(id); |
| ... | ... | @@ -81,6 +84,7 @@ public class AppPointActivityController { |
| 81 | 84 | @GetMapping("/list-by-ids") |
| 82 | 85 | @Operation(summary = "获得积分商城活动列表,基于活动编号数组") |
| 83 | 86 | @Parameter(name = "ids", description = "活动编号数组", required = true, example = "[1024, 1025]") |
| 87 | + @PermitAll | |
| 84 | 88 | public CommonResult<List<AppPointActivityRespVO>> getCombinationActivityListByIds(@RequestParam("ids") List<Long> ids) { |
| 85 | 89 | // 1. 获得开启的活动列表 |
| 86 | 90 | List<PointActivityDO> activityList = pointActivityService.getPointActivityListByIds(ids); | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/reward/AppRewardActivityController.java
| ... | ... | @@ -9,6 +9,7 @@ import io.swagger.v3.oas.annotations.Operation; |
| 9 | 9 | import io.swagger.v3.oas.annotations.Parameter; |
| 10 | 10 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 11 | 11 | import jakarta.annotation.Resource; |
| 12 | +import jakarta.annotation.security.PermitAll; | |
| 12 | 13 | import org.springframework.validation.annotation.Validated; |
| 13 | 14 | import org.springframework.web.bind.annotation.GetMapping; |
| 14 | 15 | import org.springframework.web.bind.annotation.RequestMapping; |
| ... | ... | @@ -29,6 +30,7 @@ public class AppRewardActivityController { |
| 29 | 30 | @GetMapping("/get") |
| 30 | 31 | @Operation(summary = "获得满减送活动") |
| 31 | 32 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 33 | + @PermitAll | |
| 32 | 34 | public CommonResult<AppRewardActivityRespVO> getRewardActivity(@RequestParam("id") Long id) { |
| 33 | 35 | RewardActivityDO activity = rewardActivityService.getRewardActivity(id); |
| 34 | 36 | if (activity == null) { | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/seckill/AppSeckillActivityController.java
| ... | ... | @@ -24,6 +24,7 @@ import io.swagger.v3.oas.annotations.Operation; |
| 24 | 24 | import io.swagger.v3.oas.annotations.Parameter; |
| 25 | 25 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 26 | 26 | import jakarta.annotation.Resource; |
| 27 | +import jakarta.annotation.security.PermitAll; | |
| 27 | 28 | import org.springframework.context.annotation.Lazy; |
| 28 | 29 | import org.springframework.validation.annotation.Validated; |
| 29 | 30 | import org.springframework.web.bind.annotation.GetMapping; |
| ... | ... | @@ -74,6 +75,7 @@ public class AppSeckillActivityController { |
| 74 | 75 | |
| 75 | 76 | @GetMapping("/get-now") |
| 76 | 77 | @Operation(summary = "获得当前秒杀活动", description = "获取当前正在进行的活动,提供给首页使用") |
| 78 | + @PermitAll | |
| 77 | 79 | public CommonResult<AppSeckillActivityNowRespVO> getNowSeckillActivity() { |
| 78 | 80 | return success(nowSeckillActivityCache.getUnchecked("")); // 缓存 |
| 79 | 81 | } |
| ... | ... | @@ -96,6 +98,7 @@ public class AppSeckillActivityController { |
| 96 | 98 | |
| 97 | 99 | @GetMapping("/page") |
| 98 | 100 | @Operation(summary = "获得秒杀活动分页") |
| 101 | + @PermitAll | |
| 99 | 102 | public CommonResult<PageResult<AppSeckillActivityRespVO>> getSeckillActivityPage(AppSeckillActivityPageReqVO pageReqVO) { |
| 100 | 103 | // 1. 查询满足当前阶段的活动 |
| 101 | 104 | PageResult<SeckillActivityDO> pageResult = activityService.getSeckillActivityAppPageByConfigId(pageReqVO); |
| ... | ... | @@ -113,6 +116,7 @@ public class AppSeckillActivityController { |
| 113 | 116 | @GetMapping("/get-detail") |
| 114 | 117 | @Operation(summary = "获得秒杀活动明细") |
| 115 | 118 | @Parameter(name = "id", description = "活动编号", required = true, example = "1024") |
| 119 | + @PermitAll | |
| 116 | 120 | public CommonResult<AppSeckillActivityDetailRespVO> getSeckillActivity(@RequestParam("id") Long id) { |
| 117 | 121 | // 1. 获取活动 |
| 118 | 122 | SeckillActivityDO activity = activityService.getSeckillActivity(id); |
| ... | ... | @@ -153,6 +157,7 @@ public class AppSeckillActivityController { |
| 153 | 157 | @GetMapping("/list-by-ids") |
| 154 | 158 | @Operation(summary = "获得秒杀活动列表,基于活动编号数组") |
| 155 | 159 | @Parameter(name = "ids", description = "活动编号数组", required = true, example = "[1024, 1025]") |
| 160 | + @PermitAll | |
| 156 | 161 | public CommonResult<List<AppSeckillActivityRespVO>> getCombinationActivityListByIds(@RequestParam("ids") List<Long> ids) { |
| 157 | 162 | // 1. 获得开启的活动列表 |
| 158 | 163 | List<SeckillActivityDO> activityList = activityService.getSeckillActivityListByIds(ids); | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/seckill/AppSeckillConfigController.java
| ... | ... | @@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.SeckillConfigDO; |
| 8 | 8 | import cn.iocoder.yudao.module.promotion.service.seckill.SeckillConfigService; |
| 9 | 9 | import io.swagger.v3.oas.annotations.Operation; |
| 10 | 10 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 11 | +import jakarta.annotation.security.PermitAll; | |
| 11 | 12 | import org.springframework.validation.annotation.Validated; |
| 12 | 13 | import org.springframework.web.bind.annotation.GetMapping; |
| 13 | 14 | import org.springframework.web.bind.annotation.RequestMapping; |
| ... | ... | @@ -28,6 +29,7 @@ public class AppSeckillConfigController { |
| 28 | 29 | |
| 29 | 30 | @GetMapping("/list") |
| 30 | 31 | @Operation(summary = "获得秒杀时间段列表") |
| 32 | + @PermitAll | |
| 31 | 33 | public CommonResult<List<AppSeckillConfigRespVO>> getSeckillConfigList() { |
| 32 | 34 | List<SeckillConfigDO> list = configService.getSeckillConfigListByStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 33 | 35 | return success(SeckillConfigConvert.INSTANCE.convertList2(list)); | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/aftersale/AppAfterSaleController.java
| ... | ... | @@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.trade.controller.app.aftersale; |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 5 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | -import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; | |
| 7 | 6 | import cn.iocoder.yudao.module.trade.controller.app.aftersale.vo.AppAfterSaleCreateReqVO; |
| 8 | 7 | import cn.iocoder.yudao.module.trade.controller.app.aftersale.vo.AppAfterSaleDeliveryReqVO; |
| 9 | 8 | import cn.iocoder.yudao.module.trade.controller.app.aftersale.vo.AppAfterSaleRespVO; |
| ... | ... | @@ -32,7 +31,6 @@ public class AppAfterSaleController { |
| 32 | 31 | |
| 33 | 32 | @GetMapping(value = "/page") |
| 34 | 33 | @Operation(summary = "获得售后分页") |
| 35 | - @PreAuthenticated | |
| 36 | 34 | public CommonResult<PageResult<AppAfterSaleRespVO>> getAfterSalePage(PageParam pageParam) { |
| 37 | 35 | return success(AfterSaleConvert.INSTANCE.convertPage02( |
| 38 | 36 | afterSaleService.getAfterSalePage(getLoginUserId(), pageParam))); |
| ... | ... | @@ -41,21 +39,18 @@ public class AppAfterSaleController { |
| 41 | 39 | @GetMapping(value = "/get") |
| 42 | 40 | @Operation(summary = "获得售后订单") |
| 43 | 41 | @Parameter(name = "id", description = "售后编号", required = true, example = "1") |
| 44 | - @PreAuthenticated | |
| 45 | 42 | public CommonResult<AppAfterSaleRespVO> getAfterSale(@RequestParam("id") Long id) { |
| 46 | 43 | return success(AfterSaleConvert.INSTANCE.convert(afterSaleService.getAfterSale(getLoginUserId(), id))); |
| 47 | 44 | } |
| 48 | 45 | |
| 49 | 46 | @PostMapping(value = "/create") |
| 50 | 47 | @Operation(summary = "申请售后") |
| 51 | - @PreAuthenticated | |
| 52 | 48 | public CommonResult<Long> createAfterSale(@RequestBody AppAfterSaleCreateReqVO createReqVO) { |
| 53 | 49 | return success(afterSaleService.createAfterSale(getLoginUserId(), createReqVO)); |
| 54 | 50 | } |
| 55 | 51 | |
| 56 | 52 | @PutMapping(value = "/delivery") |
| 57 | 53 | @Operation(summary = "退回货物") |
| 58 | - @PreAuthenticated | |
| 59 | 54 | public CommonResult<Boolean> deliveryAfterSale(@RequestBody AppAfterSaleDeliveryReqVO deliveryReqVO) { |
| 60 | 55 | afterSaleService.deliveryAfterSale(getLoginUserId(), deliveryReqVO); |
| 61 | 56 | return success(true); |
| ... | ... | @@ -64,7 +59,6 @@ public class AppAfterSaleController { |
| 64 | 59 | @DeleteMapping(value = "/cancel") |
| 65 | 60 | @Operation(summary = "取消售后") |
| 66 | 61 | @Parameter(name = "id", description = "售后编号", required = true, example = "1") |
| 67 | - @PreAuthenticated | |
| 68 | 62 | public CommonResult<Boolean> cancelAfterSale(@RequestParam("id") Long id) { |
| 69 | 63 | afterSaleService.cancelAfterSale(getLoginUserId(), id); |
| 70 | 64 | return success(true); | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/aftersale/AppAfterSaleLogController.java
| ... | ... | @@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.trade.controller.app.aftersale; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 5 | -import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; | |
| 6 | 5 | import cn.iocoder.yudao.module.trade.controller.app.aftersale.vo.log.AppAfterSaleLogRespVO; |
| 7 | 6 | import cn.iocoder.yudao.module.trade.dal.dataobject.aftersale.AfterSaleLogDO; |
| 8 | 7 | import cn.iocoder.yudao.module.trade.service.aftersale.AfterSaleLogService; |
| ... | ... | @@ -34,7 +33,6 @@ public class AppAfterSaleLogController { |
| 34 | 33 | @GetMapping("/list") |
| 35 | 34 | @Operation(summary = "获得售后日志列表") |
| 36 | 35 | @Parameter(name = "afterSaleId", description = "售后编号", required = true, example = "1") |
| 37 | - @PreAuthenticated | |
| 38 | 36 | public CommonResult<List<AppAfterSaleLogRespVO>> getAfterSaleLogList( |
| 39 | 37 | @RequestParam("afterSaleId") Long afterSaleId) { |
| 40 | 38 | List<AfterSaleLogDO> logs = afterSaleLogService.getAfterSaleLogList(afterSaleId); | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/brokerage/AppBrokerageRecordController.java
| ... | ... | @@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.trade.controller.app.brokerage; |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 5 | 5 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 6 | -import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; | |
| 7 | 6 | import cn.iocoder.yudao.module.trade.controller.app.brokerage.vo.record.AppBrokerageProductPriceRespVO; |
| 8 | 7 | import cn.iocoder.yudao.module.trade.controller.app.brokerage.vo.record.AppBrokerageRecordPageReqVO; |
| 9 | 8 | import cn.iocoder.yudao.module.trade.controller.app.brokerage.vo.record.AppBrokerageRecordRespVO; |
| ... | ... | @@ -12,6 +11,8 @@ import cn.iocoder.yudao.module.trade.dal.dataobject.brokerage.BrokerageRecordDO; |
| 12 | 11 | import cn.iocoder.yudao.module.trade.service.brokerage.BrokerageRecordService; |
| 13 | 12 | import io.swagger.v3.oas.annotations.Operation; |
| 14 | 13 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 14 | +import jakarta.annotation.Resource; | |
| 15 | +import jakarta.validation.Valid; | |
| 15 | 16 | import lombok.extern.slf4j.Slf4j; |
| 16 | 17 | import org.springframework.validation.annotation.Validated; |
| 17 | 18 | import org.springframework.web.bind.annotation.GetMapping; |
| ... | ... | @@ -19,9 +20,6 @@ import org.springframework.web.bind.annotation.RequestMapping; |
| 19 | 20 | import org.springframework.web.bind.annotation.RequestParam; |
| 20 | 21 | import org.springframework.web.bind.annotation.RestController; |
| 21 | 22 | |
| 22 | -import jakarta.annotation.Resource; | |
| 23 | -import jakarta.validation.Valid; | |
| 24 | - | |
| 25 | 23 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 26 | 24 | import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLoginUserId; |
| 27 | 25 | |
| ... | ... | @@ -36,7 +34,6 @@ public class AppBrokerageRecordController { |
| 36 | 34 | |
| 37 | 35 | @GetMapping("/page") |
| 38 | 36 | @Operation(summary = "获得分销记录分页") |
| 39 | - @PreAuthenticated | |
| 40 | 37 | public CommonResult<PageResult<AppBrokerageRecordRespVO>> getBrokerageRecordPage(@Valid AppBrokerageRecordPageReqVO pageReqVO) { |
| 41 | 38 | PageResult<BrokerageRecordDO> pageResult = brokerageRecordService.getBrokerageRecordPage( |
| 42 | 39 | BrokerageRecordConvert.INSTANCE.convert(pageReqVO, getLoginUserId())); |
| ... | ... | @@ -45,7 +42,6 @@ public class AppBrokerageRecordController { |
| 45 | 42 | |
| 46 | 43 | @GetMapping("/get-product-brokerage-price") |
| 47 | 44 | @Operation(summary = "获得商品的分销金额") |
| 48 | - @PreAuthenticated | |
| 49 | 45 | public CommonResult<AppBrokerageProductPriceRespVO> getProductBrokeragePrice(@RequestParam("spuId") Long spuId) { |
| 50 | 46 | return success(brokerageRecordService.calculateProductBrokeragePrice(getLoginUserId(), spuId)); |
| 51 | 47 | } | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/brokerage/AppBrokerageUserController.java
| ... | ... | @@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.trade.controller.app.brokerage; |
| 3 | 3 | import cn.hutool.core.date.LocalDateTimeUtil; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 5 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | -import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; | |
| 7 | 6 | import cn.iocoder.yudao.module.member.api.user.MemberUserApi; |
| 8 | 7 | import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; |
| 9 | 8 | import cn.iocoder.yudao.module.trade.controller.app.brokerage.vo.user.*; |
| ... | ... | @@ -55,7 +54,6 @@ public class AppBrokerageUserController { |
| 55 | 54 | |
| 56 | 55 | @GetMapping("/get") |
| 57 | 56 | @Operation(summary = "获得个人分销信息") |
| 58 | - @PreAuthenticated | |
| 59 | 57 | public CommonResult<AppBrokerageUserRespVO> getBrokerageUser() { |
| 60 | 58 | Optional<BrokerageUserDO> user = Optional.ofNullable(brokerageUserService.getOrCreateBrokerageUser(getLoginUserId())); |
| 61 | 59 | // 返回数据 |
| ... | ... | @@ -68,14 +66,12 @@ public class AppBrokerageUserController { |
| 68 | 66 | |
| 69 | 67 | @PutMapping("/bind") |
| 70 | 68 | @Operation(summary = "绑定推广员") |
| 71 | - @PreAuthenticated | |
| 72 | 69 | public CommonResult<Boolean> bindBrokerageUser(@Valid @RequestBody AppBrokerageUserBindReqVO reqVO) { |
| 73 | 70 | return success(brokerageUserService.bindBrokerageUser(getLoginUserId(), reqVO.getBindUserId())); |
| 74 | 71 | } |
| 75 | 72 | |
| 76 | 73 | @GetMapping("/get-summary") |
| 77 | 74 | @Operation(summary = "获得个人分销统计") |
| 78 | - @PreAuthenticated | |
| 79 | 75 | public CommonResult<AppBrokerageUserMySummaryRespVO> getBrokerageUserSummary() { |
| 80 | 76 | // 查询当前登录用户信息 |
| 81 | 77 | Long userId = getLoginUserId(); |
| ... | ... | @@ -101,7 +97,6 @@ public class AppBrokerageUserController { |
| 101 | 97 | |
| 102 | 98 | @GetMapping("/rank-page-by-user-count") |
| 103 | 99 | @Operation(summary = "获得分销用户排行分页(基于用户量)") |
| 104 | - @PreAuthenticated | |
| 105 | 100 | public CommonResult<PageResult<AppBrokerageUserRankByUserCountRespVO>> getBrokerageUserRankPageByUserCount(AppBrokerageUserRankPageReqVO pageReqVO) { |
| 106 | 101 | // 分页查询 |
| 107 | 102 | PageResult<AppBrokerageUserRankByUserCountRespVO> pageResult = brokerageUserService.getBrokerageUserRankPageByUserCount(pageReqVO); |
| ... | ... | @@ -112,7 +107,6 @@ public class AppBrokerageUserController { |
| 112 | 107 | |
| 113 | 108 | @GetMapping("/rank-page-by-price") |
| 114 | 109 | @Operation(summary = "获得分销用户排行分页(基于佣金)") |
| 115 | - @PreAuthenticated | |
| 116 | 110 | public CommonResult<PageResult<AppBrokerageUserRankByPriceRespVO>> getBrokerageUserChildSummaryPageByPrice(AppBrokerageUserRankPageReqVO pageReqVO) { |
| 117 | 111 | // 分页查询 |
| 118 | 112 | PageResult<AppBrokerageUserRankByPriceRespVO> pageResult = brokerageRecordService.getBrokerageUserChildSummaryPageByPrice(pageReqVO); |
| ... | ... | @@ -123,7 +117,6 @@ public class AppBrokerageUserController { |
| 123 | 117 | |
| 124 | 118 | @GetMapping("/child-summary-page") |
| 125 | 119 | @Operation(summary = "获得下级分销统计分页") |
| 126 | - @PreAuthenticated | |
| 127 | 120 | public CommonResult<PageResult<AppBrokerageUserChildSummaryRespVO>> getBrokerageUserChildSummaryPage( |
| 128 | 121 | AppBrokerageUserChildSummaryPageReqVO pageReqVO) { |
| 129 | 122 | PageResult<AppBrokerageUserChildSummaryRespVO> pageResult = brokerageUserService.getBrokerageUserChildSummaryPage(pageReqVO, getLoginUserId()); |
| ... | ... | @@ -133,7 +126,6 @@ public class AppBrokerageUserController { |
| 133 | 126 | @GetMapping("/get-rank-by-price") |
| 134 | 127 | @Operation(summary = "获得分销用户排行(基于佣金)") |
| 135 | 128 | @Parameter(name = "times", description = "时间段", required = true) |
| 136 | - @PreAuthenticated | |
| 137 | 129 | public CommonResult<Integer> getRankByPrice( |
| 138 | 130 | @RequestParam("times") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) LocalDateTime[] times) { |
| 139 | 131 | return success(brokerageRecordService.getUserRankByPrice(getLoginUserId(), times)); | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/brokerage/AppBrokerageWithdrawController.java
| ... | ... | @@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.trade.controller.app.brokerage; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 5 | -import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; | |
| 6 | 5 | import cn.iocoder.yudao.module.trade.controller.app.brokerage.vo.withdraw.AppBrokerageWithdrawCreateReqVO; |
| 7 | 6 | import cn.iocoder.yudao.module.trade.controller.app.brokerage.vo.withdraw.AppBrokerageWithdrawPageReqVO; |
| 8 | 7 | import cn.iocoder.yudao.module.trade.controller.app.brokerage.vo.withdraw.AppBrokerageWithdrawRespVO; |
| ... | ... | @@ -11,13 +10,12 @@ import cn.iocoder.yudao.module.trade.dal.dataobject.brokerage.BrokerageWithdrawD |
| 11 | 10 | import cn.iocoder.yudao.module.trade.service.brokerage.BrokerageWithdrawService; |
| 12 | 11 | import io.swagger.v3.oas.annotations.Operation; |
| 13 | 12 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 13 | +import jakarta.annotation.Resource; | |
| 14 | +import jakarta.validation.Valid; | |
| 14 | 15 | import lombok.extern.slf4j.Slf4j; |
| 15 | 16 | import org.springframework.validation.annotation.Validated; |
| 16 | 17 | import org.springframework.web.bind.annotation.*; |
| 17 | 18 | |
| 18 | -import jakarta.annotation.Resource; | |
| 19 | -import jakarta.validation.Valid; | |
| 20 | - | |
| 21 | 19 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 22 | 20 | import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLoginUserId; |
| 23 | 21 | |
| ... | ... | @@ -33,7 +31,6 @@ public class AppBrokerageWithdrawController { |
| 33 | 31 | |
| 34 | 32 | @GetMapping("/page") |
| 35 | 33 | @Operation(summary = "获得分销提现分页") |
| 36 | - @PreAuthenticated | |
| 37 | 34 | public CommonResult<PageResult<AppBrokerageWithdrawRespVO>> getBrokerageWithdrawPage(AppBrokerageWithdrawPageReqVO pageReqVO) { |
| 38 | 35 | PageResult<BrokerageWithdrawDO> pageResult = brokerageWithdrawService.getBrokerageWithdrawPage( |
| 39 | 36 | BrokerageWithdrawConvert.INSTANCE.convert(pageReqVO, getLoginUserId())); |
| ... | ... | @@ -42,7 +39,6 @@ public class AppBrokerageWithdrawController { |
| 42 | 39 | |
| 43 | 40 | @PostMapping("/create") |
| 44 | 41 | @Operation(summary = "创建分销提现") |
| 45 | - @PreAuthenticated | |
| 46 | 42 | public CommonResult<Long> createBrokerageWithdraw(@RequestBody @Valid AppBrokerageWithdrawCreateReqVO createReqVO) { |
| 47 | 43 | return success(brokerageWithdrawService.createBrokerageWithdraw(getLoginUserId(), createReqVO)); |
| 48 | 44 | } | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/AppCartController.java
| 1 | 1 | package cn.iocoder.yudao.module.trade.controller.app.cart; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | -import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; | |
| 5 | 4 | import cn.iocoder.yudao.module.trade.controller.app.cart.vo.*; |
| 6 | 5 | import cn.iocoder.yudao.module.trade.service.cart.CartService; |
| 7 | 6 | import io.swagger.v3.oas.annotations.Operation; |
| 8 | 7 | import io.swagger.v3.oas.annotations.Parameter; |
| 9 | 8 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 9 | +import jakarta.annotation.Resource; | |
| 10 | +import jakarta.validation.Valid; | |
| 10 | 11 | import lombok.RequiredArgsConstructor; |
| 11 | 12 | import lombok.extern.slf4j.Slf4j; |
| 12 | 13 | import org.springframework.validation.annotation.Validated; |
| 13 | 14 | import org.springframework.web.bind.annotation.*; |
| 14 | 15 | |
| 15 | -import jakarta.annotation.Resource; | |
| 16 | -import jakarta.validation.Valid; | |
| 17 | 16 | import java.util.List; |
| 18 | 17 | |
| 19 | 18 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| ... | ... | @@ -32,14 +31,12 @@ public class AppCartController { |
| 32 | 31 | |
| 33 | 32 | @PostMapping("/add") |
| 34 | 33 | @Operation(summary = "添加购物车商品") |
| 35 | - @PreAuthenticated | |
| 36 | 34 | public CommonResult<Long> addCart(@Valid @RequestBody AppCartAddReqVO addCountReqVO) { |
| 37 | 35 | return success(cartService.addCart(getLoginUserId(), addCountReqVO)); |
| 38 | 36 | } |
| 39 | 37 | |
| 40 | 38 | @PutMapping("/update-count") |
| 41 | 39 | @Operation(summary = "更新购物车商品数量") |
| 42 | - @PreAuthenticated | |
| 43 | 40 | public CommonResult<Boolean> updateCartCount(@Valid @RequestBody AppCartUpdateCountReqVO updateReqVO) { |
| 44 | 41 | cartService.updateCartCount(getLoginUserId(), updateReqVO); |
| 45 | 42 | return success(true); |
| ... | ... | @@ -47,7 +44,6 @@ public class AppCartController { |
| 47 | 44 | |
| 48 | 45 | @PutMapping("/update-selected") |
| 49 | 46 | @Operation(summary = "更新购物车商品选中") |
| 50 | - @PreAuthenticated | |
| 51 | 47 | public CommonResult<Boolean> updateCartSelected(@Valid @RequestBody AppCartUpdateSelectedReqVO updateReqVO) { |
| 52 | 48 | cartService.updateCartSelected(getLoginUserId(), updateReqVO); |
| 53 | 49 | return success(true); |
| ... | ... | @@ -55,7 +51,6 @@ public class AppCartController { |
| 55 | 51 | |
| 56 | 52 | @PutMapping("/reset") |
| 57 | 53 | @Operation(summary = "重置购物车商品") |
| 58 | - @PreAuthenticated | |
| 59 | 54 | public CommonResult<Boolean> resetCart(@Valid @RequestBody AppCartResetReqVO updateReqVO) { |
| 60 | 55 | cartService.resetCart(getLoginUserId(), updateReqVO); |
| 61 | 56 | return success(true); |
| ... | ... | @@ -64,7 +59,6 @@ public class AppCartController { |
| 64 | 59 | @DeleteMapping("/delete") |
| 65 | 60 | @Operation(summary = "删除购物车商品") |
| 66 | 61 | @Parameter(name = "ids", description = "购物车商品编号", required = true, example = "1024,2048") |
| 67 | - @PreAuthenticated | |
| 68 | 62 | public CommonResult<Boolean> deleteCart(@RequestParam("ids") List<Long> ids) { |
| 69 | 63 | cartService.deleteCart(getLoginUserId(), ids); |
| 70 | 64 | return success(true); |
| ... | ... | @@ -72,14 +66,12 @@ public class AppCartController { |
| 72 | 66 | |
| 73 | 67 | @GetMapping("get-count") |
| 74 | 68 | @Operation(summary = "查询用户在购物车中的商品数量") |
| 75 | - @PreAuthenticated | |
| 76 | 69 | public CommonResult<Integer> getCartCount() { |
| 77 | 70 | return success(cartService.getCartCount(getLoginUserId())); |
| 78 | 71 | } |
| 79 | 72 | |
| 80 | 73 | @GetMapping("/list") |
| 81 | 74 | @Operation(summary = "查询用户的购物车列表") |
| 82 | - @PreAuthenticated | |
| 83 | 75 | public CommonResult<AppCartListRespVO> getCartList() { |
| 84 | 76 | return success(cartService.getCartList(getLoginUserId())); |
| 85 | 77 | } | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/config/AppTradeConfigController.java
| ... | ... | @@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.trade.dal.dataobject.config.TradeConfigDO; |
| 8 | 8 | import cn.iocoder.yudao.module.trade.service.config.TradeConfigService; |
| 9 | 9 | import io.swagger.v3.oas.annotations.Operation; |
| 10 | 10 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 11 | +import jakarta.annotation.security.PermitAll; | |
| 11 | 12 | import lombok.RequiredArgsConstructor; |
| 12 | 13 | import lombok.extern.slf4j.Slf4j; |
| 13 | 14 | import org.springframework.beans.factory.annotation.Value; |
| ... | ... | @@ -36,6 +37,7 @@ public class AppTradeConfigController { |
| 36 | 37 | |
| 37 | 38 | @GetMapping("/get") |
| 38 | 39 | @Operation(summary = "获得交易配置") |
| 40 | + @PermitAll | |
| 39 | 41 | public CommonResult<AppTradeConfigRespVO> getTradeConfig() { |
| 40 | 42 | TradeConfigDO config = ObjUtil.defaultIfNull(tradeConfigService.getTradeConfig(), new TradeConfigDO()); |
| 41 | 43 | return success(TradeConfigConvert.INSTANCE.convert02(config).setTencentLbsKey(tencentLbsKey)); | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/delivery/AppDeliverExpressController.java
| ... | ... | @@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.trade.dal.dataobject.delivery.DeliveryExpressDO; |
| 8 | 8 | import cn.iocoder.yudao.module.trade.service.delivery.DeliveryExpressService; |
| 9 | 9 | import io.swagger.v3.oas.annotations.Operation; |
| 10 | 10 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 11 | +import jakarta.annotation.security.PermitAll; | |
| 11 | 12 | import org.springframework.validation.annotation.Validated; |
| 12 | 13 | import org.springframework.web.bind.annotation.GetMapping; |
| 13 | 14 | import org.springframework.web.bind.annotation.RequestMapping; |
| ... | ... | @@ -30,6 +31,7 @@ public class AppDeliverExpressController { |
| 30 | 31 | |
| 31 | 32 | @GetMapping("/list") |
| 32 | 33 | @Operation(summary = "获得快递公司列表") |
| 34 | + @PermitAll | |
| 33 | 35 | public CommonResult<List<AppDeliveryExpressRespVO>> getDeliveryExpressList() { |
| 34 | 36 | List<DeliveryExpressDO> list = deliveryExpressService.getDeliveryExpressListByStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 35 | 37 | list.sort(Comparator.comparing(DeliveryExpressDO::getSort)); | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/delivery/AppDeliverPickUpStoreController.java
| ... | ... | @@ -10,6 +10,7 @@ import io.swagger.v3.oas.annotations.Operation; |
| 10 | 10 | import io.swagger.v3.oas.annotations.Parameter; |
| 11 | 11 | import io.swagger.v3.oas.annotations.Parameters; |
| 12 | 12 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 13 | +import jakarta.annotation.security.PermitAll; | |
| 13 | 14 | import org.springframework.validation.annotation.Validated; |
| 14 | 15 | import org.springframework.web.bind.annotation.GetMapping; |
| 15 | 16 | import org.springframework.web.bind.annotation.RequestMapping; |
| ... | ... | @@ -36,6 +37,7 @@ public class AppDeliverPickUpStoreController { |
| 36 | 37 | @Parameter(name = "latitude", description = "精度", example = "110"), |
| 37 | 38 | @Parameter(name = "longitude", description = "纬度", example = "120") |
| 38 | 39 | }) |
| 40 | + @PermitAll | |
| 39 | 41 | public CommonResult<List<AppDeliveryPickUpStoreRespVO>> getDeliveryPickUpStoreList( |
| 40 | 42 | @RequestParam(value = "latitude", required = false) Double latitude, |
| 41 | 43 | @RequestParam(value = "longitude", required = false) Double longitude) { |
| ... | ... | @@ -47,6 +49,7 @@ public class AppDeliverPickUpStoreController { |
| 47 | 49 | @GetMapping("/get") |
| 48 | 50 | @Operation(summary = "获得自提门店") |
| 49 | 51 | @Parameter(name = "id", description = "门店编号") |
| 52 | + @PermitAll | |
| 50 | 53 | public CommonResult<AppDeliveryPickUpStoreRespVO> getOrder(@RequestParam("id") Long id) { |
| 51 | 54 | DeliveryPickUpStoreDO store = deliveryPickUpStoreService.getDeliveryPickUpStore(id); |
| 52 | 55 | return success(DeliveryPickUpStoreConvert.INSTANCE.convert03(store)); | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/AppTradeOrderController.java
| ... | ... | @@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.trade.controller.app.order; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 5 | -import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; | |
| 6 | 5 | import cn.iocoder.yudao.module.pay.api.notify.dto.PayOrderNotifyReqDTO; |
| 7 | 6 | import cn.iocoder.yudao.module.trade.controller.app.order.vo.*; |
| 8 | 7 | import cn.iocoder.yudao.module.trade.controller.app.order.vo.item.AppTradeOrderItemCommentCreateReqVO; |
| ... | ... | @@ -24,6 +23,7 @@ import io.swagger.v3.oas.annotations.Parameter; |
| 24 | 23 | import io.swagger.v3.oas.annotations.Parameters; |
| 25 | 24 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 26 | 25 | import jakarta.annotation.Resource; |
| 26 | +import jakarta.annotation.security.PermitAll; | |
| 27 | 27 | import jakarta.validation.Valid; |
| 28 | 28 | import lombok.extern.slf4j.Slf4j; |
| 29 | 29 | import org.springframework.validation.annotation.Validated; |
| ... | ... | @@ -59,7 +59,6 @@ public class AppTradeOrderController { |
| 59 | 59 | |
| 60 | 60 | @GetMapping("/settlement") |
| 61 | 61 | @Operation(summary = "获得订单结算信息") |
| 62 | - @PreAuthenticated | |
| 63 | 62 | public CommonResult<AppTradeOrderSettlementRespVO> settlementOrder(@Valid AppTradeOrderSettlementReqVO settlementReqVO) { |
| 64 | 63 | return success(tradeOrderUpdateService.settlementOrder(getLoginUserId(), settlementReqVO)); |
| 65 | 64 | } |
| ... | ... | @@ -67,13 +66,13 @@ public class AppTradeOrderController { |
| 67 | 66 | @GetMapping("/settlement-product") |
| 68 | 67 | @Operation(summary = "获得商品结算信息", description = "用于商品列表、商品详情,获得参与活动后的价格信息") |
| 69 | 68 | @Parameter(name = "spuIds", description = "商品 SPU 编号数组") |
| 69 | + @PermitAll | |
| 70 | 70 | public CommonResult<List<AppTradeProductSettlementRespVO>> settlementProduct(@RequestParam("spuIds") List<Long> spuIds) { |
| 71 | 71 | return success(priceService.calculateProductPrice(getLoginUserId(), spuIds)); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | @PostMapping("/create") |
| 75 | 75 | @Operation(summary = "创建订单") |
| 76 | - @PreAuthenticated | |
| 77 | 76 | public CommonResult<AppTradeOrderCreateRespVO> createOrder(@Valid @RequestBody AppTradeOrderCreateReqVO createReqVO) { |
| 78 | 77 | TradeOrderDO order = tradeOrderUpdateService.createOrder(getLoginUserId(), createReqVO); |
| 79 | 78 | return success(new AppTradeOrderCreateRespVO().setId(order.getId()).setPayOrderId(order.getPayOrderId())); |
| ... | ... | @@ -93,7 +92,6 @@ public class AppTradeOrderController { |
| 93 | 92 | @Parameter(name = "id", description = "交易订单编号"), |
| 94 | 93 | @Parameter(name = "sync", description = "是否同步支付状态", example = "true") |
| 95 | 94 | }) |
| 96 | - @PreAuthenticated | |
| 97 | 95 | public CommonResult<AppTradeOrderDetailRespVO> getOrderDetail(@RequestParam("id") Long id, |
| 98 | 96 | @RequestParam(value = "sync", required = false) Boolean sync) { |
| 99 | 97 | // 1.1 查询订单 |
| ... | ... | @@ -121,7 +119,6 @@ public class AppTradeOrderController { |
| 121 | 119 | @GetMapping("/get-express-track-list") |
| 122 | 120 | @Operation(summary = "获得交易订单的物流轨迹") |
| 123 | 121 | @Parameter(name = "id", description = "交易订单编号") |
| 124 | - @PreAuthenticated | |
| 125 | 122 | public CommonResult<List<AppOrderExpressTrackRespDTO>> getOrderExpressTrackList(@RequestParam("id") Long id) { |
| 126 | 123 | return success(TradeOrderConvert.INSTANCE.convertList02( |
| 127 | 124 | tradeOrderQueryService.getExpressTrackList(id, getLoginUserId()))); |
| ... | ... | @@ -129,7 +126,6 @@ public class AppTradeOrderController { |
| 129 | 126 | |
| 130 | 127 | @GetMapping("/page") |
| 131 | 128 | @Operation(summary = "获得交易订单分页") |
| 132 | - @PreAuthenticated | |
| 133 | 129 | public CommonResult<PageResult<AppTradeOrderPageItemRespVO>> getOrderPage(AppTradeOrderPageReqVO reqVO) { |
| 134 | 130 | // 查询订单 |
| 135 | 131 | PageResult<TradeOrderDO> pageResult = tradeOrderQueryService.getOrderPage(getLoginUserId(), reqVO); |
| ... | ... | @@ -142,7 +138,6 @@ public class AppTradeOrderController { |
| 142 | 138 | |
| 143 | 139 | @GetMapping("/get-count") |
| 144 | 140 | @Operation(summary = "获得交易订单数量") |
| 145 | - @PreAuthenticated | |
| 146 | 141 | public CommonResult<Map<String, Long>> getOrderCount() { |
| 147 | 142 | Map<String, Long> orderCount = Maps.newLinkedHashMapWithExpectedSize(5); |
| 148 | 143 | // 全部 |
| ... | ... | @@ -167,7 +162,6 @@ public class AppTradeOrderController { |
| 167 | 162 | @PutMapping("/receive") |
| 168 | 163 | @Operation(summary = "确认交易订单收货") |
| 169 | 164 | @Parameter(name = "id", description = "交易订单编号") |
| 170 | - @PreAuthenticated | |
| 171 | 165 | public CommonResult<Boolean> receiveOrder(@RequestParam("id") Long id) { |
| 172 | 166 | tradeOrderUpdateService.receiveOrderByMember(getLoginUserId(), id); |
| 173 | 167 | return success(true); |
| ... | ... | @@ -176,7 +170,6 @@ public class AppTradeOrderController { |
| 176 | 170 | @DeleteMapping("/cancel") |
| 177 | 171 | @Operation(summary = "取消交易订单") |
| 178 | 172 | @Parameter(name = "id", description = "交易订单编号") |
| 179 | - @PreAuthenticated | |
| 180 | 173 | public CommonResult<Boolean> cancelOrder(@RequestParam("id") Long id) { |
| 181 | 174 | tradeOrderUpdateService.cancelOrderByMember(getLoginUserId(), id); |
| 182 | 175 | return success(true); |
| ... | ... | @@ -185,7 +178,6 @@ public class AppTradeOrderController { |
| 185 | 178 | @DeleteMapping("/delete") |
| 186 | 179 | @Operation(summary = "删除交易订单") |
| 187 | 180 | @Parameter(name = "id", description = "交易订单编号") |
| 188 | - @PreAuthenticated | |
| 189 | 181 | public CommonResult<Boolean> deleteOrder(@RequestParam("id") Long id) { |
| 190 | 182 | tradeOrderUpdateService.deleteOrder(getLoginUserId(), id); |
| 191 | 183 | return success(true); |
| ... | ... | @@ -196,7 +188,6 @@ public class AppTradeOrderController { |
| 196 | 188 | @GetMapping("/item/get") |
| 197 | 189 | @Operation(summary = "获得交易订单项") |
| 198 | 190 | @Parameter(name = "id", description = "交易订单项编号") |
| 199 | - @PreAuthenticated | |
| 200 | 191 | public CommonResult<AppTradeOrderItemRespVO> getOrderItem(@RequestParam("id") Long id) { |
| 201 | 192 | TradeOrderItemDO item = tradeOrderQueryService.getOrderItem(getLoginUserId(), id); |
| 202 | 193 | return success(TradeOrderConvert.INSTANCE.convert03(item)); |
| ... | ... | @@ -204,7 +195,6 @@ public class AppTradeOrderController { |
| 204 | 195 | |
| 205 | 196 | @PostMapping("/item/create-comment") |
| 206 | 197 | @Operation(summary = "创建交易订单项的评价") |
| 207 | - @PreAuthenticated | |
| 208 | 198 | public CommonResult<Long> createOrderItemComment(@RequestBody AppTradeOrderItemCommentCreateReqVO createReqVO) { |
| 209 | 199 | return success(tradeOrderUpdateService.createOrderItemCommentByMember(getLoginUserId(), createReqVO)); |
| 210 | 200 | } | ... | ... |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/AppAddressController.java
| 1 | 1 | package cn.iocoder.yudao.module.member.controller.app.address; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | -import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; | |
| 5 | 4 | import cn.iocoder.yudao.module.member.controller.app.address.vo.AppAddressCreateReqVO; |
| 6 | 5 | import cn.iocoder.yudao.module.member.controller.app.address.vo.AppAddressRespVO; |
| 7 | 6 | import cn.iocoder.yudao.module.member.controller.app.address.vo.AppAddressUpdateReqVO; |
| 8 | 7 | import cn.iocoder.yudao.module.member.convert.address.AddressConvert; |
| 9 | 8 | import cn.iocoder.yudao.module.member.dal.dataobject.address.MemberAddressDO; |
| 10 | 9 | import cn.iocoder.yudao.module.member.service.address.AddressService; |
| 11 | -import io.swagger.v3.oas.annotations.tags.Tag; | |
| 12 | -import io.swagger.v3.oas.annotations.Parameter; | |
| 13 | 10 | import io.swagger.v3.oas.annotations.Operation; |
| 11 | +import io.swagger.v3.oas.annotations.Parameter; | |
| 12 | +import io.swagger.v3.oas.annotations.tags.Tag; | |
| 13 | +import jakarta.annotation.Resource; | |
| 14 | +import jakarta.validation.Valid; | |
| 14 | 15 | import org.springframework.validation.annotation.Validated; |
| 15 | 16 | import org.springframework.web.bind.annotation.*; |
| 16 | 17 | |
| 17 | -import jakarta.annotation.Resource; | |
| 18 | -import jakarta.validation.Valid; | |
| 19 | 18 | import java.util.List; |
| 20 | 19 | |
| 21 | 20 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| ... | ... | @@ -32,14 +31,12 @@ public class AppAddressController { |
| 32 | 31 | |
| 33 | 32 | @PostMapping("/create") |
| 34 | 33 | @Operation(summary = "创建用户收件地址") |
| 35 | - @PreAuthenticated | |
| 36 | 34 | public CommonResult<Long> createAddress(@Valid @RequestBody AppAddressCreateReqVO createReqVO) { |
| 37 | 35 | return success(addressService.createAddress(getLoginUserId(), createReqVO)); |
| 38 | 36 | } |
| 39 | 37 | |
| 40 | 38 | @PutMapping("/update") |
| 41 | 39 | @Operation(summary = "更新用户收件地址") |
| 42 | - @PreAuthenticated | |
| 43 | 40 | public CommonResult<Boolean> updateAddress(@Valid @RequestBody AppAddressUpdateReqVO updateReqVO) { |
| 44 | 41 | addressService.updateAddress(getLoginUserId(), updateReqVO); |
| 45 | 42 | return success(true); |
| ... | ... | @@ -48,7 +45,6 @@ public class AppAddressController { |
| 48 | 45 | @DeleteMapping("/delete") |
| 49 | 46 | @Operation(summary = "删除用户收件地址") |
| 50 | 47 | @Parameter(name = "id", description = "编号", required = true) |
| 51 | - @PreAuthenticated | |
| 52 | 48 | public CommonResult<Boolean> deleteAddress(@RequestParam("id") Long id) { |
| 53 | 49 | addressService.deleteAddress(getLoginUserId(), id); |
| 54 | 50 | return success(true); |
| ... | ... | @@ -57,7 +53,6 @@ public class AppAddressController { |
| 57 | 53 | @GetMapping("/get") |
| 58 | 54 | @Operation(summary = "获得用户收件地址") |
| 59 | 55 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 60 | - @PreAuthenticated | |
| 61 | 56 | public CommonResult<AppAddressRespVO> getAddress(@RequestParam("id") Long id) { |
| 62 | 57 | MemberAddressDO address = addressService.getAddress(getLoginUserId(), id); |
| 63 | 58 | return success(AddressConvert.INSTANCE.convert(address)); |
| ... | ... | @@ -65,7 +60,6 @@ public class AppAddressController { |
| 65 | 60 | |
| 66 | 61 | @GetMapping("/get-default") |
| 67 | 62 | @Operation(summary = "获得默认的用户收件地址") |
| 68 | - @PreAuthenticated | |
| 69 | 63 | public CommonResult<AppAddressRespVO> getDefaultUserAddress() { |
| 70 | 64 | MemberAddressDO address = addressService.getDefaultUserAddress(getLoginUserId()); |
| 71 | 65 | return success(AddressConvert.INSTANCE.convert(address)); |
| ... | ... | @@ -73,7 +67,6 @@ public class AppAddressController { |
| 73 | 67 | |
| 74 | 68 | @GetMapping("/list") |
| 75 | 69 | @Operation(summary = "获得用户收件地址列表") |
| 76 | - @PreAuthenticated | |
| 77 | 70 | public CommonResult<List<AppAddressRespVO>> getAddressList() { |
| 78 | 71 | List<MemberAddressDO> list = addressService.getAddressList(getLoginUserId()); |
| 79 | 72 | return success(AddressConvert.INSTANCE.convertList(list)); | ... | ... |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/AppAuthController.java
| ... | ... | @@ -44,13 +44,14 @@ public class AppAuthController { |
| 44 | 44 | |
| 45 | 45 | @PostMapping("/login") |
| 46 | 46 | @Operation(summary = "使用手机 + 密码登录") |
| 47 | + @PermitAll | |
| 47 | 48 | public CommonResult<AppAuthLoginRespVO> login(@RequestBody @Valid AppAuthLoginReqVO reqVO) { |
| 48 | 49 | return success(authService.login(reqVO)); |
| 49 | 50 | } |
| 50 | 51 | |
| 51 | 52 | @PostMapping("/logout") |
| 52 | - @PermitAll | |
| 53 | 53 | @Operation(summary = "登出系统") |
| 54 | + @PermitAll | |
| 54 | 55 | public CommonResult<Boolean> logout(HttpServletRequest request) { |
| 55 | 56 | String token = SecurityFrameworkUtils.obtainAuthorization(request, |
| 56 | 57 | securityProperties.getTokenHeader(), securityProperties.getTokenParameter()); |
| ... | ... | @@ -63,6 +64,7 @@ public class AppAuthController { |
| 63 | 64 | @PostMapping("/refresh-token") |
| 64 | 65 | @Operation(summary = "刷新令牌") |
| 65 | 66 | @Parameter(name = "refreshToken", description = "刷新令牌", required = true) |
| 67 | + @PermitAll | |
| 66 | 68 | public CommonResult<AppAuthLoginRespVO> refreshToken(@RequestParam("refreshToken") String refreshToken) { |
| 67 | 69 | return success(authService.refreshToken(refreshToken)); |
| 68 | 70 | } |
| ... | ... | @@ -71,12 +73,14 @@ public class AppAuthController { |
| 71 | 73 | |
| 72 | 74 | @PostMapping("/sms-login") |
| 73 | 75 | @Operation(summary = "使用手机 + 验证码登录") |
| 76 | + @PermitAll | |
| 74 | 77 | public CommonResult<AppAuthLoginRespVO> smsLogin(@RequestBody @Valid AppAuthSmsLoginReqVO reqVO) { |
| 75 | 78 | return success(authService.smsLogin(reqVO)); |
| 76 | 79 | } |
| 77 | 80 | |
| 78 | 81 | @PostMapping("/send-sms-code") |
| 79 | 82 | @Operation(summary = "发送手机验证码") |
| 83 | + @PermitAll | |
| 80 | 84 | public CommonResult<Boolean> sendSmsCode(@RequestBody @Valid AppAuthSmsSendReqVO reqVO) { |
| 81 | 85 | authService.sendSmsCode(getLoginUserId(), reqVO); |
| 82 | 86 | return success(true); |
| ... | ... | @@ -84,6 +88,7 @@ public class AppAuthController { |
| 84 | 88 | |
| 85 | 89 | @PostMapping("/validate-sms-code") |
| 86 | 90 | @Operation(summary = "校验手机验证码") |
| 91 | + @PermitAll | |
| 87 | 92 | public CommonResult<Boolean> validateSmsCode(@RequestBody @Valid AppAuthSmsValidateReqVO reqVO) { |
| 88 | 93 | authService.validateSmsCode(getLoginUserId(), reqVO); |
| 89 | 94 | return success(true); |
| ... | ... | @@ -97,6 +102,7 @@ public class AppAuthController { |
| 97 | 102 | @Parameter(name = "type", description = "社交类型", required = true), |
| 98 | 103 | @Parameter(name = "redirectUri", description = "回调路径") |
| 99 | 104 | }) |
| 105 | + @PermitAll | |
| 100 | 106 | public CommonResult<String> socialAuthRedirect(@RequestParam("type") Integer type, |
| 101 | 107 | @RequestParam("redirectUri") String redirectUri) { |
| 102 | 108 | return CommonResult.success(authService.getSocialAuthorizeUrl(type, redirectUri)); |
| ... | ... | @@ -104,12 +110,14 @@ public class AppAuthController { |
| 104 | 110 | |
| 105 | 111 | @PostMapping("/social-login") |
| 106 | 112 | @Operation(summary = "社交快捷登录,使用 code 授权码", description = "适合未登录的用户,但是社交账号已绑定用户") |
| 113 | + @PermitAll | |
| 107 | 114 | public CommonResult<AppAuthLoginRespVO> socialLogin(@RequestBody @Valid AppAuthSocialLoginReqVO reqVO) { |
| 108 | 115 | return success(authService.socialLogin(reqVO)); |
| 109 | 116 | } |
| 110 | 117 | |
| 111 | 118 | @PostMapping("/weixin-mini-app-login") |
| 112 | 119 | @Operation(summary = "微信小程序的一键登录") |
| 120 | + @PermitAll | |
| 113 | 121 | public CommonResult<AppAuthLoginRespVO> weixinMiniAppLogin(@RequestBody @Valid AppAuthWeixinMiniAppLoginReqVO reqVO) { |
| 114 | 122 | return success(authService.weixinMiniAppLogin(reqVO)); |
| 115 | 123 | } |
| ... | ... | @@ -117,6 +125,7 @@ public class AppAuthController { |
| 117 | 125 | @PostMapping("/create-weixin-jsapi-signature") |
| 118 | 126 | @Operation(summary = "创建微信 JS SDK 初始化所需的签名", |
| 119 | 127 | description = "参考 https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html 文档") |
| 128 | + @PermitAll | |
| 120 | 129 | public CommonResult<SocialWxJsapiSignatureRespDTO> createWeixinMpJsapiSignature(@RequestParam("url") String url) { |
| 121 | 130 | SocialWxJsapiSignatureRespDTO signature = socialClientApi.createWxMpJsapiSignature( |
| 122 | 131 | UserTypeEnum.MEMBER.getValue(), url); | ... | ... |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/level/AppMemberExperienceRecordController.java
| ... | ... | @@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.member.controller.app.level; |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 5 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | -import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; | |
| 7 | 6 | import cn.iocoder.yudao.module.member.controller.app.level.vo.experience.AppMemberExperienceRecordRespVO; |
| 8 | 7 | import cn.iocoder.yudao.module.member.convert.level.MemberExperienceRecordConvert; |
| 9 | 8 | import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberExperienceRecordDO; |
| ... | ... | @@ -32,7 +31,6 @@ public class AppMemberExperienceRecordController { |
| 32 | 31 | |
| 33 | 32 | @GetMapping("/page") |
| 34 | 33 | @Operation(summary = "获得会员经验记录分页") |
| 35 | - @PreAuthenticated | |
| 36 | 34 | public CommonResult<PageResult<AppMemberExperienceRecordRespVO>> getExperienceRecordPage( |
| 37 | 35 | @Valid PageParam pageParam) { |
| 38 | 36 | PageResult<MemberExperienceRecordDO> pageResult = experienceLogService.getExperienceRecordPage( | ... | ... |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/level/AppMemberLevelController.java
| ... | ... | @@ -7,6 +7,7 @@ import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelDO; |
| 7 | 7 | import cn.iocoder.yudao.module.member.service.level.MemberLevelService; |
| 8 | 8 | import io.swagger.v3.oas.annotations.Operation; |
| 9 | 9 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 10 | +import jakarta.annotation.security.PermitAll; | |
| 10 | 11 | import org.springframework.validation.annotation.Validated; |
| 11 | 12 | import org.springframework.web.bind.annotation.GetMapping; |
| 12 | 13 | import org.springframework.web.bind.annotation.RequestMapping; |
| ... | ... | @@ -28,6 +29,7 @@ public class AppMemberLevelController { |
| 28 | 29 | |
| 29 | 30 | @GetMapping("/list") |
| 30 | 31 | @Operation(summary = "获得会员等级列表") |
| 32 | + @PermitAll | |
| 31 | 33 | public CommonResult<List<AppMemberLevelRespVO>> getLevelList() { |
| 32 | 34 | List<MemberLevelDO> result = levelService.getEnableLevelList(); |
| 33 | 35 | return success(MemberLevelConvert.INSTANCE.convertList02(result)); | ... | ... |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/point/AppMemberPointRecordController.java
| 1 | 1 | package cn.iocoder.yudao.module.member.controller.app.point; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | -import cn.iocoder.yudao.framework.common.pojo.PageParam; | |
| 5 | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | 5 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 7 | -import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; | |
| 8 | 6 | import cn.iocoder.yudao.module.member.controller.app.point.vo.AppMemberPointRecordPageReqVO; |
| 9 | 7 | import cn.iocoder.yudao.module.member.controller.app.point.vo.AppMemberPointRecordRespVO; |
| 10 | -import cn.iocoder.yudao.module.member.convert.point.MemberPointRecordConvert; | |
| 11 | 8 | import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointRecordDO; |
| 12 | 9 | import cn.iocoder.yudao.module.member.service.point.MemberPointRecordService; |
| 13 | 10 | import io.swagger.v3.oas.annotations.Operation; |
| 14 | 11 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 12 | +import jakarta.annotation.Resource; | |
| 13 | +import jakarta.validation.Valid; | |
| 15 | 14 | import org.springframework.validation.annotation.Validated; |
| 16 | 15 | import org.springframework.web.bind.annotation.GetMapping; |
| 17 | 16 | import org.springframework.web.bind.annotation.RequestMapping; |
| 18 | 17 | import org.springframework.web.bind.annotation.RestController; |
| 19 | 18 | |
| 20 | -import jakarta.annotation.Resource; | |
| 21 | -import jakarta.validation.Valid; | |
| 22 | - | |
| 23 | 19 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 24 | 20 | import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; |
| 25 | 21 | |
| ... | ... | @@ -34,7 +30,6 @@ public class AppMemberPointRecordController { |
| 34 | 30 | |
| 35 | 31 | @GetMapping("/page") |
| 36 | 32 | @Operation(summary = "获得用户积分记录分页") |
| 37 | - @PreAuthenticated | |
| 38 | 33 | public CommonResult<PageResult<AppMemberPointRecordRespVO>> getPointRecordPage( |
| 39 | 34 | @Valid AppMemberPointRecordPageReqVO pageReqVO) { |
| 40 | 35 | PageResult<MemberPointRecordDO> pageResult = pointRecordService.getPointRecordPage(getLoginUserId(), pageReqVO); | ... | ... |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/signin/AppMemberSignInConfigController.java
| ... | ... | @@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO |
| 8 | 8 | import cn.iocoder.yudao.module.member.service.signin.MemberSignInConfigService; |
| 9 | 9 | import io.swagger.v3.oas.annotations.Operation; |
| 10 | 10 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 11 | +import jakarta.annotation.security.PermitAll; | |
| 11 | 12 | import org.springframework.validation.annotation.Validated; |
| 12 | 13 | import org.springframework.web.bind.annotation.GetMapping; |
| 13 | 14 | import org.springframework.web.bind.annotation.RequestMapping; |
| ... | ... | @@ -29,6 +30,7 @@ public class AppMemberSignInConfigController { |
| 29 | 30 | |
| 30 | 31 | @GetMapping("/list") |
| 31 | 32 | @Operation(summary = "获得签到规则列表") |
| 33 | + @PermitAll | |
| 32 | 34 | public CommonResult<List<AppMemberSignInConfigRespVO>> getSignInConfigList() { |
| 33 | 35 | List<MemberSignInConfigDO> pageResult = signInConfigService.getSignInConfigList(CommonStatusEnum.ENABLE.getStatus()); |
| 34 | 36 | return success(MemberSignInConfigConvert.INSTANCE.convertList02(pageResult)); | ... | ... |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/signin/AppMemberSignInRecordController.java
| ... | ... | @@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.member.controller.app.signin; |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 5 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | -import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; | |
| 7 | 6 | import cn.iocoder.yudao.module.member.controller.app.signin.vo.record.AppMemberSignInRecordRespVO; |
| 8 | 7 | import cn.iocoder.yudao.module.member.controller.app.signin.vo.record.AppMemberSignInRecordSummaryRespVO; |
| 9 | 8 | import cn.iocoder.yudao.module.member.convert.signin.MemberSignInRecordConvert; |
| ... | ... | @@ -11,14 +10,13 @@ import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO |
| 11 | 10 | import cn.iocoder.yudao.module.member.service.signin.MemberSignInRecordService; |
| 12 | 11 | import io.swagger.v3.oas.annotations.Operation; |
| 13 | 12 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 13 | +import jakarta.annotation.Resource; | |
| 14 | 14 | import org.springframework.validation.annotation.Validated; |
| 15 | 15 | import org.springframework.web.bind.annotation.GetMapping; |
| 16 | 16 | import org.springframework.web.bind.annotation.PostMapping; |
| 17 | 17 | import org.springframework.web.bind.annotation.RequestMapping; |
| 18 | 18 | import org.springframework.web.bind.annotation.RestController; |
| 19 | 19 | |
| 20 | -import jakarta.annotation.Resource; | |
| 21 | - | |
| 22 | 20 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 23 | 21 | import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; |
| 24 | 22 | |
| ... | ... | @@ -33,14 +31,12 @@ public class AppMemberSignInRecordController { |
| 33 | 31 | |
| 34 | 32 | @GetMapping("/get-summary") |
| 35 | 33 | @Operation(summary = "获得个人签到统计") |
| 36 | - @PreAuthenticated | |
| 37 | 34 | public CommonResult<AppMemberSignInRecordSummaryRespVO> getSignInRecordSummary() { |
| 38 | 35 | return success(signInRecordService.getSignInRecordSummary(getLoginUserId())); |
| 39 | 36 | } |
| 40 | 37 | |
| 41 | 38 | @PostMapping("/create") |
| 42 | 39 | @Operation(summary = "签到") |
| 43 | - @PreAuthenticated | |
| 44 | 40 | public CommonResult<AppMemberSignInRecordRespVO> createSignInRecord() { |
| 45 | 41 | MemberSignInRecordDO recordDO = signInRecordService.createSignRecord(getLoginUserId()); |
| 46 | 42 | return success(MemberSignInRecordConvert.INSTANCE.coverRecordToAppRecordVo(recordDO)); |
| ... | ... | @@ -48,7 +44,6 @@ public class AppMemberSignInRecordController { |
| 48 | 44 | |
| 49 | 45 | @GetMapping("/page") |
| 50 | 46 | @Operation(summary = "获得签到记录分页") |
| 51 | - @PreAuthenticated | |
| 52 | 47 | public CommonResult<PageResult<AppMemberSignInRecordRespVO>> getSignRecordPage(PageParam pageParam) { |
| 53 | 48 | PageResult<MemberSignInRecordDO> pageResult = signInRecordService.getSignRecordPage(getLoginUserId(), pageParam); |
| 54 | 49 | return success(MemberSignInRecordConvert.INSTANCE.convertPage02(pageResult)); | ... | ... |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/social/AppSocialUserController.java
| ... | ... | @@ -4,7 +4,6 @@ import cn.hutool.core.codec.Base64; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; |
| 5 | 5 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 6 | 6 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 7 | -import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; | |
| 8 | 7 | import cn.iocoder.yudao.module.member.controller.app.social.vo.*; |
| 9 | 8 | import cn.iocoder.yudao.module.system.api.social.SocialClientApi; |
| 10 | 9 | import cn.iocoder.yudao.module.system.api.social.SocialUserApi; |
| ... | ... | @@ -13,6 +12,7 @@ import io.swagger.v3.oas.annotations.Operation; |
| 13 | 12 | import io.swagger.v3.oas.annotations.Parameter; |
| 14 | 13 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 15 | 14 | import jakarta.annotation.Resource; |
| 15 | +import jakarta.annotation.security.PermitAll; | |
| 16 | 16 | import jakarta.validation.Valid; |
| 17 | 17 | import org.springframework.validation.annotation.Validated; |
| 18 | 18 | import org.springframework.web.bind.annotation.*; |
| ... | ... | @@ -35,6 +35,7 @@ public class AppSocialUserController { |
| 35 | 35 | |
| 36 | 36 | @PostMapping("/bind") |
| 37 | 37 | @Operation(summary = "社交绑定,使用 code 授权码") |
| 38 | + @PermitAll | |
| 38 | 39 | public CommonResult<String> socialBind(@RequestBody @Valid AppSocialUserBindReqVO reqVO) { |
| 39 | 40 | SocialUserBindReqDTO reqDTO = new SocialUserBindReqDTO(getLoginUserId(), UserTypeEnum.MEMBER.getValue(), |
| 40 | 41 | reqVO.getType(), reqVO.getCode(), reqVO.getState()); |
| ... | ... | @@ -44,7 +45,6 @@ public class AppSocialUserController { |
| 44 | 45 | |
| 45 | 46 | @DeleteMapping("/unbind") |
| 46 | 47 | @Operation(summary = "取消社交绑定") |
| 47 | - @PreAuthenticated | |
| 48 | 48 | public CommonResult<Boolean> socialUnbind(@RequestBody AppSocialUserUnbindReqVO reqVO) { |
| 49 | 49 | SocialUserUnbindReqDTO reqDTO = new SocialUserUnbindReqDTO(getLoginUserId(), UserTypeEnum.MEMBER.getValue(), |
| 50 | 50 | reqVO.getType(), reqVO.getOpenid()); |
| ... | ... | @@ -55,7 +55,6 @@ public class AppSocialUserController { |
| 55 | 55 | @GetMapping("/get") |
| 56 | 56 | @Operation(summary = "获得社交用户") |
| 57 | 57 | @Parameter(name = "type", description = "社交平台的类型,参见 SocialTypeEnum 枚举值", required = true, example = "10") |
| 58 | - @PreAuthenticated | |
| 59 | 58 | public CommonResult<AppSocialUserRespVO> getSocialUser(@RequestParam("type") Integer type) { |
| 60 | 59 | SocialUserRespDTO socialUser = socialUserApi.getSocialUserByUserId(UserTypeEnum.MEMBER.getValue(), getLoginUserId(), type); |
| 61 | 60 | return success(BeanUtils.toBean(socialUser, AppSocialUserRespVO.class)); |
| ... | ... | @@ -63,6 +62,7 @@ public class AppSocialUserController { |
| 63 | 62 | |
| 64 | 63 | @PostMapping("/wxa-qrcode") |
| 65 | 64 | @Operation(summary = "获得微信小程序码(base64 image)") |
| 65 | + @PermitAll | |
| 66 | 66 | public CommonResult<String> getWxaQrcode(@RequestBody @Valid AppSocialWxaQrcodeReqVO reqVO) { |
| 67 | 67 | byte[] wxQrcode = socialClientApi.getWxaQrcode(BeanUtils.toBean(reqVO, SocialWxQrcodeReqDTO.class)); |
| 68 | 68 | return success(Base64.encode(wxQrcode)); |
| ... | ... | @@ -70,6 +70,7 @@ public class AppSocialUserController { |
| 70 | 70 | |
| 71 | 71 | @GetMapping("/get-subscribe-template-list") |
| 72 | 72 | @Operation(summary = "获得微信小程订阅模板列表") |
| 73 | + @PermitAll | |
| 73 | 74 | public CommonResult<List<AppSocialWxaSubscribeTemplateRespVO>> getSubscribeTemplateList() { |
| 74 | 75 | List<SocialWxaSubscribeTemplateRespDTO> template = socialClientApi.getWxaSubscribeTemplateList(UserTypeEnum.MEMBER.getValue()); |
| 75 | 76 | return success(BeanUtils.toBean(template, AppSocialWxaSubscribeTemplateRespVO.class)); | ... | ... |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/AppMemberUserController.java
| 1 | 1 | package cn.iocoder.yudao.module.member.controller.app.user; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | -import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; | |
| 5 | 4 | import cn.iocoder.yudao.module.member.controller.app.user.vo.*; |
| 6 | 5 | import cn.iocoder.yudao.module.member.convert.user.MemberUserConvert; |
| 7 | 6 | import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelDO; |
| ... | ... | @@ -10,13 +9,13 @@ import cn.iocoder.yudao.module.member.service.level.MemberLevelService; |
| 10 | 9 | import cn.iocoder.yudao.module.member.service.user.MemberUserService; |
| 11 | 10 | import io.swagger.v3.oas.annotations.Operation; |
| 12 | 11 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 12 | +import jakarta.annotation.Resource; | |
| 13 | +import jakarta.annotation.security.PermitAll; | |
| 14 | +import jakarta.validation.Valid; | |
| 13 | 15 | import lombok.extern.slf4j.Slf4j; |
| 14 | 16 | import org.springframework.validation.annotation.Validated; |
| 15 | 17 | import org.springframework.web.bind.annotation.*; |
| 16 | 18 | |
| 17 | -import jakarta.annotation.Resource; | |
| 18 | -import jakarta.validation.Valid; | |
| 19 | - | |
| 20 | 19 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 21 | 20 | import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; |
| 22 | 21 | |
| ... | ... | @@ -34,7 +33,6 @@ public class AppMemberUserController { |
| 34 | 33 | |
| 35 | 34 | @GetMapping("/get") |
| 36 | 35 | @Operation(summary = "获得基本信息") |
| 37 | - @PreAuthenticated | |
| 38 | 36 | public CommonResult<AppMemberUserInfoRespVO> getUserInfo() { |
| 39 | 37 | MemberUserDO user = userService.getUser(getLoginUserId()); |
| 40 | 38 | MemberLevelDO level = levelService.getLevel(user.getLevelId()); |
| ... | ... | @@ -43,7 +41,6 @@ public class AppMemberUserController { |
| 43 | 41 | |
| 44 | 42 | @PutMapping("/update") |
| 45 | 43 | @Operation(summary = "修改基本信息") |
| 46 | - @PreAuthenticated | |
| 47 | 44 | public CommonResult<Boolean> updateUser(@RequestBody @Valid AppMemberUserUpdateReqVO reqVO) { |
| 48 | 45 | userService.updateUser(getLoginUserId(), reqVO); |
| 49 | 46 | return success(true); |
| ... | ... | @@ -51,7 +48,6 @@ public class AppMemberUserController { |
| 51 | 48 | |
| 52 | 49 | @PutMapping("/update-mobile") |
| 53 | 50 | @Operation(summary = "修改用户手机") |
| 54 | - @PreAuthenticated | |
| 55 | 51 | public CommonResult<Boolean> updateUserMobile(@RequestBody @Valid AppMemberUserUpdateMobileReqVO reqVO) { |
| 56 | 52 | userService.updateUserMobile(getLoginUserId(), reqVO); |
| 57 | 53 | return success(true); |
| ... | ... | @@ -59,7 +55,6 @@ public class AppMemberUserController { |
| 59 | 55 | |
| 60 | 56 | @PutMapping("/update-mobile-by-weixin") |
| 61 | 57 | @Operation(summary = "基于微信小程序的授权码,修改用户手机") |
| 62 | - @PreAuthenticated | |
| 63 | 58 | public CommonResult<Boolean> updateUserMobileByWeixin(@RequestBody @Valid AppMemberUserUpdateMobileByWeixinReqVO reqVO) { |
| 64 | 59 | userService.updateUserMobileByWeixin(getLoginUserId(), reqVO); |
| 65 | 60 | return success(true); |
| ... | ... | @@ -67,7 +62,6 @@ public class AppMemberUserController { |
| 67 | 62 | |
| 68 | 63 | @PutMapping("/update-password") |
| 69 | 64 | @Operation(summary = "修改用户密码", description = "用户修改密码时使用") |
| 70 | - @PreAuthenticated | |
| 71 | 65 | public CommonResult<Boolean> updateUserPassword(@RequestBody @Valid AppMemberUserUpdatePasswordReqVO reqVO) { |
| 72 | 66 | userService.updateUserPassword(getLoginUserId(), reqVO); |
| 73 | 67 | return success(true); |
| ... | ... | @@ -75,6 +69,7 @@ public class AppMemberUserController { |
| 75 | 69 | |
| 76 | 70 | @PutMapping("/reset-password") |
| 77 | 71 | @Operation(summary = "重置密码", description = "用户忘记密码时使用") |
| 72 | + @PermitAll | |
| 78 | 73 | public CommonResult<Boolean> resetUserPassword(@RequestBody @Valid AppMemberUserResetPasswordReqVO reqVO) { |
| 79 | 74 | userService.resetUserPassword(reqVO); |
| 80 | 75 | return success(true); | ... | ... |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/channel/AppPayChannelController.java
| ... | ... | @@ -6,13 +6,13 @@ import cn.iocoder.yudao.module.pay.service.channel.PayChannelService; |
| 6 | 6 | import io.swagger.v3.oas.annotations.Operation; |
| 7 | 7 | import io.swagger.v3.oas.annotations.Parameter; |
| 8 | 8 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 9 | +import jakarta.annotation.Resource; | |
| 9 | 10 | import org.springframework.validation.annotation.Validated; |
| 10 | 11 | import org.springframework.web.bind.annotation.GetMapping; |
| 11 | 12 | import org.springframework.web.bind.annotation.RequestMapping; |
| 12 | 13 | import org.springframework.web.bind.annotation.RequestParam; |
| 13 | 14 | import org.springframework.web.bind.annotation.RestController; |
| 14 | 15 | |
| 15 | -import jakarta.annotation.Resource; | |
| 16 | 16 | import java.util.List; |
| 17 | 17 | import java.util.Set; |
| 18 | 18 | ... | ... |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/order/AppPayOrderController.java
| ... | ... | @@ -17,12 +17,11 @@ import io.swagger.v3.oas.annotations.Operation; |
| 17 | 17 | import io.swagger.v3.oas.annotations.Parameter; |
| 18 | 18 | import io.swagger.v3.oas.annotations.Parameters; |
| 19 | 19 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 20 | +import jakarta.annotation.Resource; | |
| 20 | 21 | import lombok.extern.slf4j.Slf4j; |
| 21 | 22 | import org.springframework.validation.annotation.Validated; |
| 22 | 23 | import org.springframework.web.bind.annotation.*; |
| 23 | 24 | |
| 24 | -import jakarta.annotation.Resource; | |
| 25 | - | |
| 26 | 25 | import java.util.Map; |
| 27 | 26 | import java.util.Objects; |
| 28 | 27 | ... | ... |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/refund/package-info.java deleted
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/wallet/AppPayWalletController.java
| ... | ... | @@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.pay.controller.app.wallet; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 5 | -import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; | |
| 6 | 5 | import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.wallet.AppPayWalletRespVO; |
| 7 | 6 | import cn.iocoder.yudao.module.pay.convert.wallet.PayWalletConvert; |
| 8 | 7 | import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletDO; |
| ... | ... | @@ -35,7 +34,6 @@ public class AppPayWalletController { |
| 35 | 34 | |
| 36 | 35 | @GetMapping("/get") |
| 37 | 36 | @Operation(summary = "获取钱包") |
| 38 | - @PreAuthenticated | |
| 39 | 37 | public CommonResult<AppPayWalletRespVO> getPayWallet() { |
| 40 | 38 | PayWalletDO wallet = payWalletService.getOrCreateWallet(getLoginUserId(), UserTypeEnum.MEMBER.getValue()); |
| 41 | 39 | return success(PayWalletConvert.INSTANCE.convert(wallet)); | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/app/dict/AppDictDataController.java
| ... | ... | @@ -9,6 +9,7 @@ import cn.iocoder.yudao.module.system.service.dict.DictDataService; |
| 9 | 9 | import io.swagger.v3.oas.annotations.Operation; |
| 10 | 10 | import io.swagger.v3.oas.annotations.Parameter; |
| 11 | 11 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 12 | +import jakarta.annotation.security.PermitAll; | |
| 12 | 13 | import org.springframework.validation.annotation.Validated; |
| 13 | 14 | import org.springframework.web.bind.annotation.GetMapping; |
| 14 | 15 | import org.springframework.web.bind.annotation.RequestMapping; |
| ... | ... | @@ -32,6 +33,7 @@ public class AppDictDataController { |
| 32 | 33 | @GetMapping("/type") |
| 33 | 34 | @Operation(summary = "根据字典类型查询字典数据信息") |
| 34 | 35 | @Parameter(name = "type", description = "字典类型", required = true, example = "common_status") |
| 36 | + @PermitAll | |
| 35 | 37 | public CommonResult<List<AppDictDataRespVO>> getDictDataListByType(@RequestParam("type") String type) { |
| 36 | 38 | List<DictDataDO> list = dictDataService.getDictDataList( |
| 37 | 39 | CommonStatusEnum.ENABLE.getStatus(), type); | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/app/ip/AppAreaController.java
| ... | ... | @@ -8,6 +8,7 @@ import cn.iocoder.yudao.framework.ip.core.utils.AreaUtils; |
| 8 | 8 | import cn.iocoder.yudao.module.system.controller.app.ip.vo.AppAreaNodeRespVO; |
| 9 | 9 | import io.swagger.v3.oas.annotations.Operation; |
| 10 | 10 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 11 | +import jakarta.annotation.security.PermitAll; | |
| 11 | 12 | import org.springframework.validation.annotation.Validated; |
| 12 | 13 | import org.springframework.web.bind.annotation.GetMapping; |
| 13 | 14 | import org.springframework.web.bind.annotation.RequestMapping; |
| ... | ... | @@ -25,6 +26,7 @@ public class AppAreaController { |
| 25 | 26 | |
| 26 | 27 | @GetMapping("/tree") |
| 27 | 28 | @Operation(summary = "获得地区树") |
| 29 | + @PermitAll | |
| 28 | 30 | public CommonResult<List<AppAreaNodeRespVO>> getAreaTree() { |
| 29 | 31 | Area area = AreaUtils.getArea(Area.ID_CHINA); |
| 30 | 32 | Assert.notNull(area, "获取不到中国"); | ... | ... |