支付方式接口
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user