店铺区域接口
This commit is contained in:
@@ -1,31 +1,31 @@
|
||||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.account.dto.area.ShopAreaAddDTO;
|
||||
import com.czg.account.dto.area.ShopAreaEditDTO;
|
||||
import com.czg.account.entity.ShopTableArea;
|
||||
import com.czg.account.service.ShopTableAreaService;
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 区域管理
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/shopArea")
|
||||
@RequestMapping("/admin/shopArea")
|
||||
public class ShopTableAreaController {
|
||||
@Resource
|
||||
private ShopTableAreaService shopTableAreaService;
|
||||
|
||||
/**
|
||||
* 区域添加
|
||||
* 区域获取
|
||||
* 权限标识: shopArea:add
|
||||
* @param name 区域名称
|
||||
* @return 是否成功
|
||||
*/
|
||||
@@ -37,12 +37,34 @@ public class ShopTableAreaController {
|
||||
|
||||
/**
|
||||
* 区域修改
|
||||
* @param name 区域名称
|
||||
* 权限标识: shopArea:edit
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission("shopArea:edit")
|
||||
@PutMapping
|
||||
public CzgResult<Page<ShopTableArea>> edit(String name) {
|
||||
return CzgResult.success(shopTableAreaService.pageInfo(StpKit.USER.getShopId(), name));
|
||||
public CzgResult<Boolean> edit(@RequestBody @Validated ShopAreaEditDTO shopAreaEditDTO) {
|
||||
return CzgResult.success(shopTableAreaService.edit(StpKit.USER.getShopId(), shopAreaEditDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 区域删除
|
||||
* 权限标识: shopArea:del
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission("shopArea:del")
|
||||
@DeleteMapping
|
||||
public CzgResult<Boolean> remove(@RequestBody @Validated ShopAreaEditDTO shopAreaEditDTO) {
|
||||
return CzgResult.success(shopTableAreaService.remove(new QueryWrapper().eq(ShopTableArea::getShopId, StpKit.USER.getShopId()).eq(ShopTableArea::getId, shopAreaEditDTO.getId())));
|
||||
}
|
||||
|
||||
/**
|
||||
* 区域新增
|
||||
* 权限标识: shopArea:add
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission("shopArea:add")
|
||||
@PostMapping
|
||||
public CzgResult<Boolean> add(@RequestBody @Validated ShopAreaAddDTO shopAreaAddDTO) {
|
||||
return CzgResult.success(shopTableAreaService.add(shopAreaAddDTO));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user