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


import com.yx.exam.core.api.ApiRest;
import com.yx.exam.core.api.controller.BaseController;
import com.yx.exam.core.api.dto.PagingReqDTO;
import com.yx.exam.modules.tjhxxb.entity.TJhxxb;
import com.yx.exam.modules.tlog.entity.TLog;
import com.yx.exam.modules.tlog.service.TLogService;
import com.yx.exam.modules.tsjxxb.entity.TSjxxb;
import com.yx.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;
import java.util.Calendar;
import java.util.Date;

/**
 *  书籍借还日志记录前端控制器
 *
 * @author chenhaodong
 * @since 2023-03-03
 */
@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));
    }
}

