package com.cyl.zhanggui.controller;


import com.cyl.zhanggui.domain.SysUserLinkPtlAgreement;
import com.cyl.zhanggui.service.SysUserLinkPtlAgreementService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;

@Api(tags = "测试动态数据源切换")
@RequestMapping("/no-auth/sysUserLinkPtlAgreement")
@RestController
public class SysUserLinkPtlAgreementController{


    @Autowired
    private SysUserLinkPtlAgreementService sysUserLinkPtlAgreementService;

    @PostMapping("queryPage")
    @ApiOperation(value = "后线人员关联协议分页")
    public ResponseEntity<Page<SysUserLinkPtlAgreement>> queryPage(@RequestBody SysUserLinkPtlAgreement query, Pageable page) {
        List<SysUserLinkPtlAgreement> list = sysUserLinkPtlAgreementService.selectList(query, page);
        return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
    }
}
