店铺装修接口
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user