package com.ruoyi.cai.controller.app;

import com.ruoyi.cai.dto.app.query.UserReportReq;
import com.ruoyi.cai.service.ReportService;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.helper.LoginHelper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/other")
@Tag(name = "其他接口")
public class OtherController {

    @Autowired
    private ReportService reportService;

    @PostMapping("/report")
    @Operation(summary = "举报")
    public R<Void> report(@RequestBody UserReportReq reportRes){
        Long userId = LoginHelper.getUserId();
        reportRes.setUserId(userId);
        reportService.report(reportRes);
        return R.ok();
    }
}
