提交 ff69f324 authored 作者: YunaiV's avatar YunaiV

后端:部分接口补充 @PermitAll 注解

上级 bc2bf520
......@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.security.PermitAll;
import java.util.List;
@RestController
......@@ -27,6 +28,7 @@ public class UsersProductCategoryController {
@GetMapping("/list")
@ApiOperation("获得指定编号下的子分类的数组")
@ApiImplicitParam(name = "pid", value = "指定分类编号", required = true, example = "0")
@PermitAll
public CommonResult<List<UsersProductCategoryVO>> list(@RequestParam("pid") Integer pid) {
List<ProductCategoryBO> result = productCategoryService.getListByPid(pid);
return CommonResult.success(ProductCategoryConvert.Users.INSTANCE.convertToVO(result));
......
......@@ -17,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.security.PermitAll;
@RestController
@RequestMapping("users/spu")
@Api("商品 SPU + SKU")
......@@ -28,6 +30,7 @@ public class UsersProductSpuController {
@GetMapping("/info")
@ApiOperation("商品 SPU 明细")
@ApiImplicitParam(name = "id", value = "SPU 编号", required = true, example = "100")
@PermitAll
public CommonResult<UsersProductSpuDetailVO> info(@RequestParam("id") Integer id) {
return ProductSpuConvert.INSTANCE.convert4(productSpuService.getProductSpuDetail(id));
}
......@@ -39,6 +42,7 @@ public class UsersProductSpuController {
@ApiImplicitParam(name = "pageNo", value = "页码,从 1 开始", example = "1"),
@ApiImplicitParam(name = "pageSize", value = "每页条数", required = true, example = "10"),
})
@PermitAll
public CommonResult<UsersProductSpuPageVO> page(@RequestParam(value = "cid", required = false) Integer cid,
@RequestParam(value = "pageNo", defaultValue = "0") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
......
......@@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.security.PermitAll;
import java.util.Comparator;
import java.util.List;
......@@ -26,6 +27,7 @@ public class UsersBannerController {
@GetMapping("/list")
@ApiOperation("获得所有 Banner 列表")
@PermitAll
public CommonResult<List<UsersBannerVO>> list() {
// 查询 Banner 列表
List<BannerBO> result = bannerService.getBannerListByStatus(CommonStatusEnum.ENABLE.getValue()).getData();
......@@ -36,4 +38,3 @@ public class UsersBannerController {
}
}
......@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.security.PermitAll;
import java.util.Collection;
import java.util.Comparator;
import java.util.List;
......@@ -35,6 +36,7 @@ public class UsersProductRecommendController {
@GetMapping("/list")
@ApiOperation("获得所有 Banner 列表")
@PermitAll
public CommonResult<Map<Integer, Collection<UsersProductRecommendVO>>> list() {
// 查询商品推荐列表
List<ProductRecommendBO> productRecommends = productRecommendService.getProductRecommendList(
......@@ -51,4 +53,4 @@ public class UsersProductRecommendController {
return CommonResult.success(result.asMap());
}
}
\ No newline at end of file
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论