package com.sonic.frog.controller.api;

import com.sonic.common.rpc.Result;
import com.sonic.frog.domain.input.AiInfoApiInput;
import com.sonic.frog.domain.input.GetTotalDeductionAmountInput;
import com.sonic.frog.domain.output.AiInfoApiOutput;
import com.sonic.frog.service.AiUserService;
import com.sonic.frog.service.UserDeductionStatService;
import com.sonic.sdk.api.annotation.IgnoreAuth;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * AI接口
 *
 * @author code
 */
@RestController
@Slf4j
public class UserDeductionApi {

    @Autowired
    private UserDeductionStatService userDeductionStatService;

    @IgnoreAuth
    @ApiOperation(value = "获取用户总预扣金额", tags = {"API-接口"})
    @PostMapping("/api/user/get-total-deduction-amount")
    public Result<Long> getTotalDeductionAmount(@RequestBody GetTotalDeductionAmountInput input) {
        return Result.success(userDeductionStatService.getTotalDeductionAmount(input.getUserId()));
    }

}

