银行卡信息

master
istars 7 years ago
parent c40a064fe6
commit 0fb5095bc9

@ -10,6 +10,9 @@ public interface userBankIdMapper {
@Select("select * from userBankIdentify where userNum = #{userNum}")
public UserBankIdentify selectUsageDateByCheckNum(long userNum);
@Select("select * from userBankIdentify where userNum = #{userNum}")
public List<UserBankIdentify> selectUserBankByUserNum(long userNum);
@Select("select * from userBankIdentify")
public List<UserBankIdentify> select();

@ -0,0 +1,37 @@
package com.example.demo.bankCard.controller;
import com.alibaba.fastjson.JSONObject;
import com.example.demo.bankCard.service.BankCardService;
import com.example.demo.bean.User;
import com.example.demo.bean.UserBankIdentify;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@RestController
public class BankCardController {
@Autowired
private BankCardService bankCardService;
@RequestMapping(value = "/card",method = RequestMethod.POST)
public List<UserBankIdentify> UserInfo(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {
response.setContentType("text/html;charset=utf-8");
HttpSession session = request.getSession();
User user = (User)session.getAttribute("user");
List<UserBankIdentify> list = new ArrayList<UserBankIdentify>();
list = bankCardService.selectUserBankByUserNum(user.getUserNum());
return list;
// String data = JSONObject.toJSONString();
// response.getWriter().print(data);
//System.out.println(data);
}
}

@ -0,0 +1,9 @@
package com.example.demo.bankCard.service;
import com.example.demo.bean.UserBankIdentify;
import java.util.List;
public interface BankCardService {
List<UserBankIdentify> selectUserBankByUserNum(long userNum);
}

@ -0,0 +1,26 @@
package com.example.demo.bankCard.service.impl;
import com.example.demo.Dao.userBankIdMapper;
import com.example.demo.bankCard.service.BankCardService;
import com.example.demo.bean.User;
import com.example.demo.bean.UserBankIdentify;
import com.example.demo.userInfo.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class BankCardServiceImpl implements BankCardService {
@Autowired
userBankIdMapper userBankIdMapper;
@Override
public List<UserBankIdentify> selectUserBankByUserNum(long userNum) {
return userBankIdMapper.selectUserBankByUserNum(userNum);
}
}

@ -9,6 +9,8 @@ import com.example.demo.register.identify;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@ -18,7 +20,8 @@ import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
@Controller
//@Controller
@RestController
public class bankCardController extends HttpServlet {
@Autowired
@ -26,7 +29,7 @@ public class bankCardController extends HttpServlet {
@Autowired
private userMapper userMapper;
@RequestMapping("/binding")//卡号绑定界面
@RequestMapping(value = "/binding",method = RequestMethod.POST)//卡号绑定界面
public void doPost(HttpServletResponse response, HttpServletRequest request)throws IOException {
HttpSession session=request.getSession();
User user=new User();

Loading…
Cancel
Save