支付方式接口

This commit is contained in:
张松
2025-02-26 10:46:19 +08:00
parent e0fa223a7c
commit 533a5a4e7e
7 changed files with 315 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
package com.czg.controller.admin;
import cn.hutool.core.bean.BeanUtil;
import com.czg.account.dto.ShopPayTypeDTO;
import com.czg.account.entity.ShopPayType;
import com.czg.account.service.ShopPayTypeService;
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.web.bind.annotation.*;
import java.util.List;
/**
* 支付方式管理
* @author Administrator
*/
@RestController
@RequestMapping("/admin/payType")
public class ShopPayTypeController {
@Resource
private ShopPayTypeService shopPayTypeService;
/**
* 支付方式列表
*/
@SaAdminCheckPermission(value = "shopPayType:list", name = "支付方式列表")
@GetMapping
public CzgResult<List<ShopPayType>> list() {
return CzgResult.success(shopPayTypeService.getList(StpKit.USER.getShopId()));
}
/**
* 支付方式详情获取
*/
@SaAdminCheckPermission(value = "shopPayType:detail", name = "支付方式详情获取")
@GetMapping("/detail")
public CzgResult<ShopPayType> detail(@RequestParam Integer id) {
return CzgResult.success(shopPayTypeService.getOne(new QueryWrapper().eq(ShopPayType::getId, id)));
}
/**
* 支付方式详情获取
*/
@SaAdminCheckPermission(value = "shopPayType:edit", name = "支付方式编辑")
@PutMapping
public CzgResult<Boolean> edit(@RequestBody ShopPayTypeDTO shopPayTypeDTO) {
ShopPayType shopPayType = BeanUtil.copyProperties(shopPayTypeDTO, ShopPayType.class);
return CzgResult.success(shopPayTypeService.updateById(shopPayType));
}
}