package com.ylx.shopingfundsdetail.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ylx.common.core.domain.R;
import com.ylx.shopingfundsdetail.domain.dto.ShoppingFundsDetailQueryDto;
import com.ylx.shopingfundsdetail.domain.vo.ShoppingFundsDetailAddDto;
import com.ylx.shopingfundsdetail.domain.vo.ShoppingFundsDetailQueryVo;
import com.ylx.shopingfundsdetail.service.ShoppingFundsDetailService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 类描述：我的购物金明细C端
 *
 * @author Administrator
 * @version 1.0
 * @date 2026/6/1 10:58
 */
@RestController
@RequestMapping("/shopping/funds/detail")
@Api(tags = {"购物金明细"})
@Slf4j
public class ShoppingFundsDetailController {
    @Resource(name = "shoppingFundsDetailService")
    private ShoppingFundsDetailService shoppingFundsDetailService;

    @ApiOperation("查询购物金明细")
    @PostMapping(value="queryShoppingFundsDetail")
    public R<Page<ShoppingFundsDetailQueryVo>> queryShoppingFundsDetail(@Validated @RequestBody ShoppingFundsDetailQueryDto shoppingFundsDetailQueryDto) {
        Page<ShoppingFundsDetailQueryVo> v =  shoppingFundsDetailService.queryShoppingFundsDetail(shoppingFundsDetailQueryDto);
        return R.ok(v);
    }

    @ApiOperation("新增购物金明细")
    @PostMapping(value="addShoppingFundsDetail")
    public R<?> addShoppingFundsDetail(@Validated  @RequestBody ShoppingFundsDetailAddDto dto) {
        shoppingFundsDetailService.addShoppingFundsDetail(dto);
        return R.ok();
    }

}