package com.nantian.cloud.ggjg.controller;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nantian.cloud.ggjg.entity.GgjgUser;
import com.nantian.cloud.ggjg.service.GgjgUserService;
import com.nantian.sc.cloud.common.core.util.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin
@RestController
@AllArgsConstructor
@RequestMapping("/ggjgUser")
@Api(value = "ggjgUser", tags = "公共机构用户")
public class GgigUserController {
    @Autowired
    private GgjgUserService ggjgUserService;

    /**
     *
     * @param page      分页对象
     * @param ggjgUser
     * @return
     */
    @ApiOperation(value = "查询公共机构用户",notes = "条件查询公共机构用户")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ggjgUserService", value = " 公共机构用户", required = false, dataType = "json", paramType = "path"),
            @ApiImplicitParam(name = "Page", value = "分页对象", required = false, dataType = "json", paramType = "path")
    })
    @GetMapping("/queryList")
    public R queryList(Page page, GgjgUser ggjgUser) {
        return R.ok(ggjgUserService.page(page, Wrappers.query(ggjgUser)));
    }
}
