package com.elephant.framework.galaxy.aroad.module.zhjs.controller;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.elephant.framework.galaxy.aroad.response.R;
import com.elephant.framework.galaxy.aroad.module.common.annotation.SysLog;
import com.elephant.framework.galaxy.aroad.module.zhjs.entity.ZhjsZqzfzs;
import com.elephant.framework.galaxy.aroad.module.zhjs.service.ZhjsZqzfzsService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import com.elephant.framework.galaxy.aroad.module.common.controller.BaseController;


/**
 * 中期支付证书
 *
 * @author wangjian
 * @date 2019-05-16 17:39:16
 */
@RestController
@AllArgsConstructor
@RequestMapping("/zhjs/zqzfzs")
public class ZhjsZqzfzsController extends BaseController  {

  private final  ZhjsZqzfzsService zhjsZqzfzsService;

  /**
   * 分页查询
   * @param page 分页对象
   * @param zhjsZqzfzs 中期支付证书
   * @return
   */
  @GetMapping("/page")
  public R getZhjsZqzfzsPage(Page page, ZhjsZqzfzs zhjsZqzfzs) {
    return  new R<>(zhjsZqzfzsService.page(page,Wrappers.query(zhjsZqzfzs)));
  }


  /**
   * 通过id查询中期支付证书
   * @param id id
   * @return R
   */
  @GetMapping("/{id}")
  public R getById(@PathVariable("id") String id){
    return new R<>(zhjsZqzfzsService.getById(id));
  }

}
