package com.red.circle.other.adapter.app.violation;

import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.web.controller.BaseController;
import com.red.circle.other.app.dto.cmd.violation.RoomViolationHandleCmd;
import com.red.circle.other.app.dto.cmd.violation.ViolationRecordPageQueryCmd;
import com.red.circle.other.app.dto.clientobject.violation.ViolationHandleResultCO;
import com.red.circle.other.app.dto.clientobject.violation.ViolationRecordCO;
import com.red.circle.other.app.service.violation.RoomViolationService;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * 房间违规处理控制器
 */
@RestController
@RequestMapping("/room-violation")
@RequiredArgsConstructor
public class RoomViolationRestController extends BaseController {

    private final RoomViolationService roomViolationService;

    /**
     * 处理房间违规
     */
    @PostMapping("/handle")
    public ViolationHandleResultCO handle(@Valid @RequestBody RoomViolationHandleCmd cmd) {
        return roomViolationService.handle(cmd);
    }

    /**
     * 分页查询违规记录
     */
    @PostMapping("/page-query")
    public PageResult<ViolationRecordCO> pageQuery(@Valid @RequestBody ViolationRecordPageQueryCmd cmd) {
        return roomViolationService.pageQuery(cmd);
    }
}
