Update ShopDetailController.java

cyj
pbvfus8to 8 months ago
parent 74e503e1c9
commit adff03961d

@ -8,6 +8,7 @@
*
*/
// 该类所属的包名,表明其位于管理端控制器相关的包下,用于对店铺详情相关操作进行控制和处理
package com.yami.shop.admin.controller;
import cn.hutool.core.util.StrUtil;
@ -30,22 +31,29 @@ import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* ShopDetailControllerSpring RESTfulShopDetail
*
*
* @author lgh on 2018/08/29.
*/
@RestController
// 定义该控制器类的基础请求路径,所有该类中的接口请求路径都将以此为前缀,表明是与店铺详情相关的操作接口
@RequestMapping("/shop/shopDetail")
public class ShopDetailController {
// 通过Spring的依赖注入机制自动注入ShopDetailService的实例以便调用其提供的与店铺详情相关的业务逻辑方法
@Autowired
private ShopDetailService shopDetailService;
/**
*
*
* isDistributionShopDetailIDSecurityUtilsID
* ShopDetailServiceupdateByIdremoveShopDetailCacheByShopIdID
* ServerResponseEntityVoid
*
* @param isDistribution 01
* @return ServerResponseEntityVoid
*/
@PutMapping("/isDistribution")
public ServerResponseEntity<Void> updateIsDistribution(@RequestParam Integer isDistribution) {
@ -57,8 +65,13 @@ public class ShopDetailController {
shopDetailService.removeShopDetailCacheByShopId(shopDetail.getShopId());
return ServerResponseEntity.success();
}
/**
*
*
* SecurityUtilsIDShopDetailServicegetShopDetailByShopId
* ServerResponseEntity
*
* @return ServerResponseEntityShopDetail
*/
@GetMapping("/info")
@PreAuthorize("@pms.hasPermission('shop:shopDetail:info')")
@ -67,9 +80,15 @@ public class ShopDetailController {
return ServerResponseEntity.success(shopDetail);
}
/**
*
*
* ShopDetailPageParam
* 使ShopDetailServicepageLambdaQueryWrapper
* IDServerResponseEntity
*
* @param shopDetail
* @param page
* @return ServerResponseEntityIPage<ShopDetail>
*/
@GetMapping("/page")
@PreAuthorize("@pms.hasPermission('shop:shopDetail:page')")
@ -82,18 +101,29 @@ public class ShopDetailController {
}
/**
*
* ID
* IDShopDetailServicegetShopDetailByShopId
* ServerResponseEntity
*
* @param shopId ID
* @return ServerResponseEntityShopDetail
*/
@GetMapping("/info/{shopId}")
@PreAuthorize("@pms.hasPermission('shop:shopDetail:info')")
public ServerResponseEntity<ShopDetail> info(@PathVariable("shopId") Long shopId) {
ShopDetail shopDetail = shopDetailService.getShopDetailByShopId(shopId);
// 店铺图片
// 店铺图片(此处可根据实际业务需求进一步处理店铺图片相关逻辑,目前只是简单返回店铺详情对象)
return ServerResponseEntity.success(shopDetail);
}
/**
*
*
* ShopDetailParamBeanUtilShopDetail
* new Date()1
* ShopDetailServicesaveServerResponseEntityVoid
*
* @param shopDetailParam
* @return ServerResponseEntityVoid
*/
@PostMapping
@PreAuthorize("@pms.hasPermission('shop:shopDetail:save')")
@ -106,7 +136,14 @@ public class ShopDetailController {
}
/**
*
*
* ShopDetailServicegetShopDetailByShopIdShopDetailParamIDdaShopDetail
* ShopDetailParamBeanUtilShopDetailnew Date()
* ShopDetailServiceupdateShopDetail
* ServerResponseEntityVoid
*
* @param shopDetailParam
* @return ServerResponseEntityVoid
*/
@PutMapping
@PreAuthorize("@pms.hasPermission('shop:shopDetail:update')")
@ -119,7 +156,12 @@ public class ShopDetailController {
}
/**
*
* ID
* IDShopDetailServicedeleteShopDetailByShopId
* ServerResponseEntityVoid
*
* @param id ID
* @return ServerResponseEntityVoid
*/
@DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('shop:shopDetail:delete')")
@ -129,7 +171,14 @@ public class ShopDetailController {
}
/**
*
*
* IDshopIdshopStatusShopDetailID
* ShopDetailServiceupdateByIdremoveShopDetailCacheByShopIdID
* ServerResponseEntityVoid
*
* @param shopId ID
* @param shopStatus
* @return ServerResponseEntityVoid
*/
@PutMapping("/shopStatus")
@PreAuthorize("@pms.hasPermission('shop:shopDetail:shopStatus')")
@ -143,9 +192,13 @@ public class ShopDetailController {
return ServerResponseEntity.success();
}
/**
*
*
* ShopDetailServicelistJava 8Stream
* IDShopDetail
* ServerResponseEntity
*
* @return ServerResponseEntityList<ShopDetail>ShopDetailID
*/
@GetMapping("/listShopName")
public ServerResponseEntity<List<ShopDetail>> listShopName() {

Loading…
Cancel
Save