package com.kxs.system.biz.controller.kxsapp;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kxs.common.core.util.R;
import com.kxs.system.api.model.KxsOpenBank;
import com.kxs.system.biz.service.KxsOpenBankService;
import lombok.RequiredArgsConstructor;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 用户相关(OpenBank)控制层
 *
 * @author 系统
 * @since 2024-04-11 15:30:26
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("openBank")
public class OpenBankController {

    /**
     * 服务对象
     */
    private final KxsOpenBankService kxsOpenBankService;



    /**
     * 设置-模糊搜索开户银行
     *
     * @param page 分页对象
     * @param keyword 查询字符串
     * @return 设置-模糊搜索开户银行
     */
    @GetMapping("/search")
    public R search(@ParameterObject Page<KxsOpenBank> page, @RequestParam(value = "keyword", required = false) String keyword) {

        return R.ok(kxsOpenBankService.page(page, Wrappers.<KxsOpenBank>lambdaQuery().like(KxsOpenBank::getBankName, keyword)));
    }

}

