package com.cf.imes.module.system.controller.admin.funds.organamount;


import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.module.system.controller.admin.funds.organamount.vo.AllOrganAmountRespVO;
import com.cf.imes.module.system.controller.admin.funds.organamount.vo.OrganAmountRespVO;
import com.cf.imes.module.system.service.funds.organamount.OrganAmountService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import jakarta.annotation.Resource;
import jakarta.validation.Valid;

import static com.cf.imes.framework.common.pojo.CommonResult.success;

/**
 * @author 组织资金
 */
@Tag(name = "管理后台 - 组织资金")
@RestController
@RequestMapping("/system/amount")
@Validated
public class OrganAmountController {


    @Resource
    private OrganAmountService organAmountService;



    @GetMapping("")
    @Operation(summary = "获取组织余额数据")
    @Parameter(name = "organId", description = "组织ID", required = true)
    public CommonResult<OrganAmountRespVO> getOrganAmount(@Valid @RequestParam("organId") Long organId) {

        return success(organAmountService.getOrganAmount(organId));

    }




    @GetMapping("/all")
    @Operation(summary = "获取全部组织的余额数据")
    public CommonResult<AllOrganAmountRespVO> getOrganAmountAll() {

        return success(organAmountService.getOrganAmountAll());

    }


}
