|
@@ -1,16 +1,23 @@
|
|
package com.bofeng.wx.controller;
|
|
package com.bofeng.wx.controller;
|
|
|
|
|
|
|
|
+import com.bofeng.dao.UptownHouseMapper;
|
|
|
|
+import com.bofeng.dao.UptownMapper;
|
|
|
|
+import com.bofeng.entity.Uptown;
|
|
|
|
+import com.bofeng.entity.UptownHouse;
|
|
import com.bofeng.entity.UserOpen;
|
|
import com.bofeng.entity.UserOpen;
|
|
import com.bofeng.service.HomeService;
|
|
import com.bofeng.service.HomeService;
|
|
import com.bofeng.service.UserOpenService;
|
|
import com.bofeng.service.UserOpenService;
|
|
|
|
+import com.yvan.Model;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.ui.ModelMap;
|
|
import org.springframework.ui.ModelMap;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
@RestController
|
|
@RestController
|
|
public class UserOpenController {
|
|
public class UserOpenController {
|
|
@@ -19,6 +26,10 @@ public class UserOpenController {
|
|
private HomeService homeService;
|
|
private HomeService homeService;
|
|
@Autowired
|
|
@Autowired
|
|
private UserOpenService userOpenService;
|
|
private UserOpenService userOpenService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private UptownMapper uptownMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private UptownHouseMapper uptownHouseMapper;
|
|
|
|
|
|
@GetMapping("/user/home.html")
|
|
@GetMapping("/user/home.html")
|
|
public ModelAndView home(ModelMap model) {
|
|
public ModelAndView home(ModelMap model) {
|
|
@@ -27,15 +38,15 @@ public class UserOpenController {
|
|
return new ModelAndView("/user/home.ftl", model);
|
|
return new ModelAndView("/user/home.ftl", model);
|
|
}
|
|
}
|
|
|
|
|
|
-// @GetMapping("/home/getUptown.json")
|
|
|
|
-// public Model<List<Map<>>> getUptown(HttpServletRequest request) {
|
|
|
|
-// Long userId = Long.parseLong(request.getParameter("userId"));
|
|
|
|
-// Integer userType = Integer.parseInt(request.getParameter("userType"));
|
|
|
|
-// String linkman = request.getParameter("linkman");
|
|
|
|
-// String phone = request.getParameter("phone");
|
|
|
|
-// userOpenService.saveUserInfo(userId,userType,linkman,phone);
|
|
|
|
-// return new ModelAndView("/home/home.ftl");
|
|
|
|
-// }
|
|
|
|
|
|
+ @GetMapping("/home/getUptownData.json")
|
|
|
|
+ public List<Uptown> getUptownData(HttpServletRequest request, @RequestParam(value = "area") Integer area) {
|
|
|
|
+ return uptownMapper.getAllUptown(area);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @GetMapping("/home/getUptownHouseData.json")
|
|
|
|
+ public List<UptownHouse> getUptownHouseData(HttpServletRequest request, @RequestParam(value = "uptownId") Long uptownId) {
|
|
|
|
+ return uptownHouseMapper.getAllUptownHouse(uptownId);
|
|
|
|
+ }
|
|
|
|
|
|
@PostMapping("/home/saveUser.json")
|
|
@PostMapping("/home/saveUser.json")
|
|
public ModelAndView saveUser(HttpServletRequest request) {
|
|
public ModelAndView saveUser(HttpServletRequest request) {
|