package com.sqx.modules.sendRecord.controller;


import com.sqx.common.utils.Result;
import com.sqx.modules.app.annotation.Login;
import com.sqx.modules.resumes.entity.PostPush;
import com.sqx.modules.sendRecord.entity.SendRecord;
import com.sqx.modules.sendRecord.service.SendRecordService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 投递记录
 * </p>
 *
 * @author wuchang
 * @since 2023-02-02
 */
@RestController
@RequestMapping("/admin/sendRecord/")
public class AdminSendRecordController {

    @Autowired
    private SendRecordService recordService;

    @ApiOperation("获取我的投递列表")
    @GetMapping(value = "getMyRecordListV2")
    public Result getMyRecordListV2(Long userId, Integer page, Integer limit, SendRecord sendRecord, PostPush postPush) {
        sendRecord.setUserId(userId);
        return Result.success().put("data", recordService.getMyRecordListV2(page, limit, sendRecord, postPush));
    }

    @ApiOperation("获取我的投递列表")
    @GetMapping(value = "getMyRecordList")
    public Result getRecordList(Long userId, Integer page, Integer limit, SendRecord sendRecord) {
        sendRecord.setUserId(userId);
        return Result.success().put("data", recordService.getRecordList(page, limit, sendRecord));
    }
}

