package org.springblade.gateway.common_gateway.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.gateway.common_gateway.wrapper.AppUserBankWrapper;
import org.springblade.ldt.user.entity.UserBank;
import org.springblade.ldt.user.service.IUserBankService;
import org.springblade.ldt.user.wrapper.UserBankWrapper;
import org.springblade.modules.system.service.IUserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author cy-computer
 */
@RestController
@RequestMapping("/common/userbank")
@Api(tags = "用户银行模块")
public class AppUserBankController {

	@Resource
	private IUserBankService userBankService;
	/**
	 * 小程序银行卡脱敏
	 * @param userBank
	 * @param query
	 * @return
	 */
	@GetMapping("/list")
	@ApiOperationSupport(order = 2)
	@ApiOperation(value = "分页", notes = "传入userBank")
	public R appList(UserBank userBank, Query query) {
		IPage<UserBank> pages = userBankService.page(Condition.getPage(query), Condition.getQueryWrapper(userBank));
		return R.data(AppUserBankWrapper.build().pageVO(pages));
	}
}
