weiximei 6 years ago
parent
commit
922a79cfd2

+ 48
- 0
whole-estate/src/main/java/com/example/wholeestate/controller/BuildingController.java View File

@@ -0,0 +1,48 @@
1
+package com.example.wholeestate.controller;
2
+
3
+
4
+import com.example.wholeestate.common.base.BaseController;
5
+import com.example.wholeestate.common.resp.ResponseBean;
6
+import com.example.wholeestate.common.session.UserElement;
7
+import com.example.wholeestate.model.SysUser;
8
+import com.example.wholeestate.service.IBuildingService;
9
+import io.swagger.annotations.Api;
10
+import io.swagger.annotations.ApiImplicitParam;
11
+import io.swagger.annotations.ApiImplicitParams;
12
+import io.swagger.annotations.ApiOperation;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.web.bind.annotation.RequestBody;
15
+import org.springframework.web.bind.annotation.RequestMapping;
16
+import org.springframework.web.bind.annotation.RequestMethod;
17
+import org.springframework.web.bind.annotation.RestController;
18
+
19
+import javax.servlet.http.HttpSession;
20
+
21
+/**
22
+ * <p>
23
+ * 楼盘表 前端控制器
24
+ * </p>
25
+ *
26
+ * @author jobob
27
+ * @since 2019-03-20
28
+ */
29
+@RestController
30
+@RequestMapping("/")
31
+@Api(value = "楼盘API",description = "楼盘API")
32
+public class BuildingController extends BaseController {
33
+@Autowired
34
+    private IBuildingService iBuildingService;
35
+    @ApiOperation(value = "楼盘API", notes = "楼盘API")
36
+    @ApiImplicitParams({
37
+            @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "pageNum:分页第几页" +
38
+                    "pageSize:每页长度")
39
+
40
+    })
41
+    @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "token")
42
+    @RequestMapping(value = "/buildingList", method = RequestMethod.POST)
43
+    public ResponseBean buildingList(@RequestBody String parameter, HttpSession session){
44
+    SysUser sessionUser= getSessionUser(session);
45
+        ResponseBean  responseBean = iBuildingService.buildingList(parameter);
46
+        return responseBean;
47
+    }
48
+}

+ 16
- 0
whole-estate/src/main/java/com/example/wholeestate/dao/BuildingMapper.java View File

@@ -0,0 +1,16 @@
1
+package com.example.wholeestate.dao;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.example.wholeestate.model.Building;
5
+
6
+/**
7
+ * <p>
8
+ * 楼盘表 Mapper 接口
9
+ * </p>
10
+ *
11
+ * @author jobob
12
+ * @since 2019-03-20
13
+ */
14
+public interface BuildingMapper extends BaseMapper<Building> {
15
+
16
+}

+ 87
- 0
whole-estate/src/main/java/com/example/wholeestate/model/Building.java View File

@@ -0,0 +1,87 @@
1
+package com.example.wholeestate.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.TableName;
4
+import java.time.LocalDateTime;
5
+import java.io.Serializable;
6
+import lombok.Data;
7
+import lombok.EqualsAndHashCode;
8
+import lombok.experimental.Accessors;
9
+
10
+/**
11
+ * <p>
12
+ * 楼盘表
13
+ * </p>
14
+ *
15
+ * @author jobob
16
+ * @since 2019-03-20
17
+ */
18
+@Data
19
+@EqualsAndHashCode(callSuper = false)
20
+@Accessors(chain = true)
21
+@TableName("ta_building")
22
+public class Building implements Serializable {
23
+
24
+    private static final long serialVersionUID = 1L;
25
+
26
+    /**
27
+     * 楼盘ID
28
+     */
29
+    private String buildingId;
30
+
31
+    /**
32
+     * 楼盘名称
33
+     */
34
+    private String buildingName;
35
+
36
+    /**
37
+     * 别名
38
+     */
39
+    private String name;
40
+
41
+    /**
42
+     * 价格
43
+     */
44
+    private String price;
45
+
46
+    /**
47
+     * 开盘时间
48
+     */
49
+    private LocalDateTime openingDate;
50
+
51
+    /**
52
+     * 项目地址
53
+     */
54
+    private String address;
55
+
56
+    /**
57
+     * 项目坐标
58
+     */
59
+    private String coordinate;
60
+
61
+    /**
62
+     * 物业类型
63
+     */
64
+    private String propertyType;
65
+
66
+    /**
67
+     * 最新动态
68
+     */
69
+    private String dynamic;
70
+
71
+    /**
72
+     * 电话
73
+     */
74
+    private String tel;
75
+
76
+    /**
77
+     * 创建时间
78
+     */
79
+    private LocalDateTime createDate;
80
+
81
+    /**
82
+     * 0正常,-1删除
83
+     */
84
+    private Integer status;
85
+
86
+
87
+}

+ 22
- 0
whole-estate/src/main/java/com/example/wholeestate/service/IBuildingService.java View File

@@ -0,0 +1,22 @@
1
+package com.example.wholeestate.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.example.wholeestate.common.resp.ResponseBean;
5
+import com.example.wholeestate.model.Building;
6
+
7
+/**
8
+ * <p>
9
+ * 楼盘表 服务类
10
+ * </p>
11
+ *
12
+ * @author jobob
13
+ * @since 2019-03-20
14
+ */
15
+public interface IBuildingService extends IService<Building> {
16
+    /**
17
+     * 楼盘列表
18
+     * @param parameter
19
+     * @return
20
+     */
21
+    ResponseBean buildingList(String parameter);
22
+}

+ 28
- 0
whole-estate/src/main/java/com/example/wholeestate/service/impl/BuildingServiceImpl.java View File

@@ -0,0 +1,28 @@
1
+package com.example.wholeestate.service.impl;
2
+
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5
+import com.example.wholeestate.common.resp.ResponseBean;
6
+import com.example.wholeestate.dao.BuildingMapper;
7
+import com.example.wholeestate.model.Building;
8
+import com.example.wholeestate.service.IBuildingService;
9
+import org.springframework.stereotype.Service;
10
+
11
+/**
12
+ * <p>
13
+ * 楼盘表 服务实现类
14
+ * </p>
15
+ *
16
+ * @author jobob
17
+ * @since 2019-03-20
18
+ */
19
+@Service
20
+public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> implements IBuildingService {
21
+
22
+    @Override
23
+    public ResponseBean buildingList(String parameter) {
24
+        ResponseBean response= new ResponseBean();
25
+        JSONObject object= JSONObject.parseObject(parameter);
26
+        return null;
27
+    }
28
+}

+ 5
- 0
whole-estate/src/main/resources/mapper/BuildingMapper.xml View File

@@ -0,0 +1,5 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.example.wholeestate.dao.BuildingMapper">
4
+
5
+</mapper>