package com.bc.exam.modules.tlog.controller;


import com.bc.exam.core.api.ApiRest;
import com.bc.exam.core.api.controller.BaseController;
import com.bc.exam.core.api.dto.PagingReqDTO;
import com.bc.exam.modules.tlog.entity.TLog;
import com.bc.exam.modules.tlog.service.TLogService;
import com.bc.exam.modules.user.UserUtils;
import io.swagger.annotations.ApiOperation;
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;

/**
 * @Description 描述:书籍借还日志记录前端控制器
 * @Author A贾宇婷034244310
 * @Date 20260615
 */
@RestController
@RequestMapping("/tlog/logcontrol")
public class TLogController extends BaseController {


    @Resource
    TLogService tLogService;

    /**
     * 日志分页查询
     * @param reqDTO
     * @return
     */
    @ApiOperation(value = "日志分页查询")
    @PostMapping("paging")
    public ApiRest query(@RequestBody PagingReqDTO<TLog> reqDTO) {
        reqDTO.setUserId(UserUtils.getUserId());

        return super.success(tLogService.paging(reqDTO));
    }
}

