店铺装修接口

This commit is contained in:
张松
2025-02-19 17:31:39 +08:00
parent b29eb348e5
commit a6c0143d29
8 changed files with 243 additions and 1 deletions

View File

@@ -0,0 +1,51 @@
package com.czg.controller.admin;
import cn.hutool.core.util.StrUtil;
import com.czg.account.dto.extend.ShopExtendDTO;
import com.czg.account.entity.ShopExtend;
import com.czg.account.service.ShopExtendService;
import com.czg.annotation.SaAdminCheckPermission;
import com.czg.resp.CzgResult;
import com.czg.sa.StpKit;
import com.mybatisflex.core.query.QueryWrapper;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 店铺拓展配置/装修
* @author Administrator
*/
@RestController
@RequestMapping("/admin/shopExtend")
public class ShopExtendController {
@Resource
private ShopExtendService shopExtendService;
/**
* 获取当前店铺拓展参数
* @param autoKey key名称
* @return 参数列表
*/
@SaAdminCheckPermission(value = "shopExtend:list", name = "店铺拓展参数列表")
@GetMapping
public CzgResult<List<ShopExtend>> list(String autoKey) {
QueryWrapper queryWrapper = new QueryWrapper().eq(ShopExtend::getShopId, StpKit.USER.getShopId());
if (StrUtil.isNotBlank(autoKey)) {
queryWrapper.eq(ShopExtend::getAutoKey, autoKey);
}
return CzgResult.success(shopExtendService.list(queryWrapper));
}
/**
* 店铺拓展参数修改
* @return 是否成功
*/
@SaAdminCheckPermission(value = "shopExtend:edit", name = "店铺拓展参数修改")
@PutMapping
public CzgResult<Boolean> edit(@RequestBody @Validated ShopExtendDTO shopExtendDTO) {
return CzgResult.success(shopExtendService.edit(StpKit.USER.getShopId(), shopExtendDTO));
}
}