Browse Source

Merge branch 'master' of http://git.ycjcjy.com/medical-plat/service

Your Name 4 years ago
parent
commit
cdde16038f

+ 81
- 0
src/main/java/com/yunzhi/demo/controller/SysBannerController.java View File

4
 import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
 import com.yunzhi.demo.common.BaseController;
6
 import com.yunzhi.demo.common.BaseController;
7
+import com.yunzhi.demo.common.Constants;
7
 import com.yunzhi.demo.common.ResponseBean;
8
 import com.yunzhi.demo.common.ResponseBean;
9
+import com.yunzhi.demo.common.StringUtils;
10
+import com.yunzhi.demo.entity.TaPost;
8
 import io.swagger.annotations.Api;
11
 import io.swagger.annotations.Api;
9
 import io.swagger.annotations.ApiOperation;
12
 import io.swagger.annotations.ApiOperation;
10
 import io.swagger.annotations.ApiParam;
13
 import io.swagger.annotations.ApiParam;
59
             return ResponseBean.success(result);
62
             return ResponseBean.success(result);
60
     }
63
     }
61
 
64
 
65
+    /**
66
+     * 分页查询列表
67
+     * @param pageNum
68
+     * @param pageSize
69
+     * @return
70
+     */
71
+    @RequestMapping(value="/admin/banner",method= RequestMethod.GET)
72
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
73
+    public ResponseBean bannerList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
74
+                                   @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
75
+                                   @ApiParam("标题") @RequestParam(value = "title", required = false) String title) throws Exception{
76
+
77
+        IPage<SysBanner> pg = new Page<>(pageNum, pageSize);
78
+        QueryWrapper<SysBanner> queryWrapper = new QueryWrapper<SysBanner>().like(!StringUtils.isEmpty(title), "title", title);
79
+        queryWrapper.orderByDesc("create_date");
80
+
81
+        IPage<SysBanner> result = iSysBannerService.page(pg, queryWrapper);
82
+        return ResponseBean.success(result);
83
+    }
84
+
62
     /**
85
     /**
63
      * 保存对象
86
      * 保存对象
64
      * @param sysBanner 实体对象
87
      * @param sysBanner 实体对象
75
         }
98
         }
76
     }
99
     }
77
 
100
 
101
+    /**
102
+     * 保存对象
103
+     * @param sysBanner 实体对象
104
+     * @return
105
+     */
106
+    @RequestMapping(value="/admin/banner",method= RequestMethod.POST)
107
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
108
+    public ResponseBean bannerAdd(@ApiParam("保存内容") @RequestBody SysBanner sysBanner) throws Exception{
109
+
110
+        if (iSysBannerService.save(sysBanner)){
111
+            return ResponseBean.success(sysBanner);
112
+        }else {
113
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
114
+        }
115
+    }
116
+
78
     /**
117
     /**
79
      * 根据id删除对象
118
      * 根据id删除对象
80
      * @param id  实体ID
119
      * @param id  实体ID
89
         }
128
         }
90
     }
129
     }
91
 
130
 
131
+    /**
132
+     * 根据id删除对象
133
+     * @param id  实体ID
134
+     */
135
+    @RequestMapping(value="/admin/banner/{id}", method= RequestMethod.DELETE)
136
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
137
+    public ResponseBean bannerDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
138
+        if(iSysBannerService.removeById(id)){
139
+            return ResponseBean.success("success");
140
+        }else {
141
+            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
142
+        }
143
+    }
144
+
92
     /**
145
     /**
93
      * 修改对象
146
      * 修改对象
94
      * @param id  实体ID
147
      * @param id  实体ID
107
         }
160
         }
108
     }
161
     }
109
 
162
 
163
+    /**
164
+     * 修改对象
165
+     * @param id  实体ID
166
+     * @param sysBanner 实体对象
167
+     * @return
168
+     */
169
+    @RequestMapping(value="/admin/banner/{id}",method= RequestMethod.PUT)
170
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
171
+    public ResponseBean bannerUpdate(@ApiParam("对象ID") @PathVariable Integer id,
172
+                                        @ApiParam("更新内容") @RequestBody SysBanner sysBanner) throws Exception{
173
+
174
+        if (iSysBannerService.updateById(sysBanner)){
175
+            return ResponseBean.success(iSysBannerService.getById(id));
176
+        }else {
177
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
178
+        }
179
+    }
180
+
110
     /**
181
     /**
111
      * 根据id查询对象
182
      * 根据id查询对象
112
      * @param id  实体ID
183
      * @param id  实体ID
116
     public ResponseBean sysBannerGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
187
     public ResponseBean sysBannerGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
117
         return ResponseBean.success(iSysBannerService.getById(id));
188
         return ResponseBean.success(iSysBannerService.getById(id));
118
     }
189
     }
190
+
191
+    /**
192
+     * 根据id查询对象
193
+     * @param id  实体ID
194
+     */
195
+    @RequestMapping(value="/admin/banner/{id}",method= RequestMethod.GET)
196
+    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
197
+    public ResponseBean bannerGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
198
+        return ResponseBean.success(iSysBannerService.getById(id));
199
+    }
119
 }
200
 }

+ 77
- 0
src/main/java/com/yunzhi/demo/controller/TaTopicController.java View File

59
             return ResponseBean.success(result);
59
             return ResponseBean.success(result);
60
     }
60
     }
61
 
61
 
62
+    /**
63
+     * 分页查询列表
64
+     * @param pageNum
65
+     * @param pageSize
66
+     * @return
67
+     */
68
+    @RequestMapping(value="/admin/topic",method= RequestMethod.GET)
69
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
70
+    public ResponseBean topicList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
71
+                                    @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
72
+
73
+        IPage<TaTopic> pg = new Page<>(pageNum, pageSize);
74
+        QueryWrapper<TaTopic> queryWrapper = new QueryWrapper<>();
75
+        queryWrapper.orderByDesc("create_date");
76
+
77
+        IPage<TaTopic> result = iTaTopicService.page(pg, queryWrapper);
78
+        return ResponseBean.success(result);
79
+    }
80
+
62
     /**
81
     /**
63
      * 保存对象
82
      * 保存对象
64
      * @param taTopic 实体对象
83
      * @param taTopic 实体对象
75
         }
94
         }
76
     }
95
     }
77
 
96
 
97
+    /**
98
+     * 保存对象
99
+     * @param taTopic 实体对象
100
+     * @return
101
+     */
102
+    @RequestMapping(value="/admin/topic",method= RequestMethod.POST)
103
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
104
+    public ResponseBean topicAdd(@ApiParam("保存内容") @RequestBody TaTopic taTopic) throws Exception{
105
+
106
+        if (iTaTopicService.save(taTopic)){
107
+            return ResponseBean.success(taTopic);
108
+        }else {
109
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
110
+        }
111
+    }
112
+
78
     /**
113
     /**
79
      * 根据id删除对象
114
      * 根据id删除对象
80
      * @param id  实体ID
115
      * @param id  实体ID
89
         }
124
         }
90
     }
125
     }
91
 
126
 
127
+    /**
128
+     * 根据id删除对象
129
+     * @param id  实体ID
130
+     */
131
+    @RequestMapping(value="/admin/topic/{id}", method= RequestMethod.DELETE)
132
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
133
+    public ResponseBean topicDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
134
+        if(iTaTopicService.removeById(id)){
135
+            return ResponseBean.success("success");
136
+        }else {
137
+            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
138
+        }
139
+    }
140
+
92
     /**
141
     /**
93
      * 修改对象
142
      * 修改对象
94
      * @param id  实体ID
143
      * @param id  实体ID
107
         }
156
         }
108
     }
157
     }
109
 
158
 
159
+    /**
160
+     * 修改对象
161
+     * @param id  实体ID
162
+     * @param taTopic 实体对象
163
+     * @return
164
+     */
165
+    @RequestMapping(value="/admin/topic/{id}",method= RequestMethod.PUT)
166
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
167
+    public ResponseBean topicUpdate(@ApiParam("对象ID") @PathVariable Integer id,
168
+                                      @ApiParam("更新内容") @RequestBody TaTopic taTopic) throws Exception{
169
+
170
+        if (iTaTopicService.updateById(taTopic)){
171
+            return ResponseBean.success(iTaTopicService.getById(id));
172
+        }else {
173
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
174
+        }
175
+    }
176
+
110
     /**
177
     /**
111
      * 根据id查询对象
178
      * 根据id查询对象
112
      * @param id  实体ID
179
      * @param id  实体ID
116
     public ResponseBean taTopicGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
183
     public ResponseBean taTopicGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
117
         return ResponseBean.success(iTaTopicService.getById(id));
184
         return ResponseBean.success(iTaTopicService.getById(id));
118
     }
185
     }
186
+
187
+    /**
188
+     * 根据id查询对象
189
+     * @param id  实体ID
190
+     */
191
+    @RequestMapping(value="/admin/topic/{id}",method= RequestMethod.GET)
192
+    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
193
+    public ResponseBean topicGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
194
+        return ResponseBean.success(iTaTopicService.getById(id));
195
+    }
119
 }
196
 }

+ 80
- 3
src/main/java/com/yunzhi/demo/controller/TdSchoolController.java View File

67
             return ResponseBean.success(result);
67
             return ResponseBean.success(result);
68
     }
68
     }
69
 
69
 
70
+    /**
71
+     * 分页查询列表
72
+     * @param pageNum
73
+     * @param pageSize
74
+     * @return
75
+     */
76
+    @RequestMapping(value="/admin/school",method= RequestMethod.GET)
77
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
78
+    public ResponseBean schoolList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
79
+                                     @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
80
+
81
+        IPage<TdSchool> pg = new Page<>(pageNum, pageSize);
82
+        QueryWrapper<TdSchool> queryWrapper = new QueryWrapper<>();
83
+        queryWrapper.orderByDesc("create_date");
84
+
85
+        IPage<TdSchool> result = iTdSchoolService.page(pg, queryWrapper);
86
+        return ResponseBean.success(result);
87
+    }
88
+
70
     /**
89
     /**
71
      * 保存对象
90
      * 保存对象
72
      * @param tdSchool 实体对象
91
      * @param tdSchool 实体对象
83
         }
102
         }
84
     }
103
     }
85
 
104
 
105
+    /**
106
+     * 保存对象
107
+     * @param tdSchool 实体对象
108
+     * @return
109
+     */
110
+    @RequestMapping(value="/admin/school",method= RequestMethod.POST)
111
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
112
+    public ResponseBean schoolAdd(@ApiParam("保存内容") @RequestBody TdSchool tdSchool) throws Exception{
113
+
114
+        if (iTdSchoolService.save(tdSchool)){
115
+            return ResponseBean.success(tdSchool);
116
+        }else {
117
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
118
+        }
119
+    }
120
+
86
     /**
121
     /**
87
      * 根据id删除对象
122
      * 根据id删除对象
88
      * @param id  实体ID
123
      * @param id  实体ID
89
      */
124
      */
90
     @RequestMapping(value="/tdSchool/{id}", method= RequestMethod.DELETE)
125
     @RequestMapping(value="/tdSchool/{id}", method= RequestMethod.DELETE)
91
     @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
126
     @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
92
-    public ResponseBean tdSchoolDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
127
+    public ResponseBean tdSchoolDelete(@ApiParam("对象ID") @PathVariable String id) throws Exception{
128
+        if(iTdSchoolService.removeById(id)){
129
+            return ResponseBean.success("success");
130
+        }else {
131
+            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
132
+        }
133
+    }
134
+
135
+    /**
136
+     * 根据id删除对象
137
+     * @param id  实体ID
138
+     */
139
+    @RequestMapping(value="/admin/school/{id}", method= RequestMethod.DELETE)
140
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
141
+    public ResponseBean schoolDelete(@ApiParam("对象ID") @PathVariable String id) throws Exception{
93
         if(iTdSchoolService.removeById(id)){
142
         if(iTdSchoolService.removeById(id)){
94
             return ResponseBean.success("success");
143
             return ResponseBean.success("success");
95
         }else {
144
         }else {
105
      */
154
      */
106
     @RequestMapping(value="/tdSchool/{id}",method= RequestMethod.PUT)
155
     @RequestMapping(value="/tdSchool/{id}",method= RequestMethod.PUT)
107
     @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
156
     @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
108
-    public ResponseBean tdSchoolUpdate(@ApiParam("对象ID") @PathVariable Integer id,
157
+    public ResponseBean tdSchoolUpdate(@ApiParam("对象ID") @PathVariable String id,
109
                                         @ApiParam("更新内容") @RequestBody TdSchool tdSchool) throws Exception{
158
                                         @ApiParam("更新内容") @RequestBody TdSchool tdSchool) throws Exception{
110
 
159
 
111
         if (iTdSchoolService.updateById(tdSchool)){
160
         if (iTdSchoolService.updateById(tdSchool)){
115
         }
164
         }
116
     }
165
     }
117
 
166
 
167
+    /**
168
+     * 修改对象
169
+     * @param id  实体ID
170
+     * @param tdSchool 实体对象
171
+     * @return
172
+     */
173
+    @RequestMapping(value="/admin/school/{id}",method= RequestMethod.PUT)
174
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
175
+    public ResponseBean schoolUpdate(@ApiParam("对象ID") @PathVariable String id,
176
+                                       @ApiParam("更新内容") @RequestBody TdSchool tdSchool) throws Exception{
177
+
178
+        if (iTdSchoolService.updateById(tdSchool)){
179
+            return ResponseBean.success(iTdSchoolService.getById(id));
180
+        }else {
181
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
182
+        }
183
+    }
184
+
118
     /**
185
     /**
119
      * 根据id查询对象
186
      * 根据id查询对象
120
      * @param id  实体ID
187
      * @param id  实体ID
121
      */
188
      */
122
     @RequestMapping(value="/tdSchool/{id}",method= RequestMethod.GET)
189
     @RequestMapping(value="/tdSchool/{id}",method= RequestMethod.GET)
123
     @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
190
     @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
124
-    public ResponseBean tdSchoolGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
191
+    public ResponseBean tdSchoolGet(@ApiParam("对象ID") @PathVariable String id) throws Exception{
192
+        return ResponseBean.success(iTdSchoolService.getById(id));
193
+    }
194
+
195
+    /**
196
+     * 根据id查询对象
197
+     * @param id  实体ID
198
+     */
199
+    @RequestMapping(value="/admin/school/{id}",method= RequestMethod.GET)
200
+    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
201
+    public ResponseBean schoolGet(@ApiParam("对象ID") @PathVariable String id) throws Exception{
125
         return ResponseBean.success(iTdSchoolService.getById(id));
202
         return ResponseBean.success(iTdSchoolService.getById(id));
126
     }
203
     }
127
 }
204
 }

+ 3
- 0
src/main/java/com/yunzhi/demo/entity/TdSchool.java View File

2
 
2
 
3
 import com.baomidou.mybatisplus.annotation.IdType;
3
 import com.baomidou.mybatisplus.annotation.IdType;
4
 import java.time.LocalDateTime;
4
 import java.time.LocalDateTime;
5
+
6
+import com.baomidou.mybatisplus.annotation.TableField;
5
 import com.baomidou.mybatisplus.annotation.TableId;
7
 import com.baomidou.mybatisplus.annotation.TableId;
6
 import java.io.Serializable;
8
 import java.io.Serializable;
7
 import io.swagger.annotations.ApiModel;
9
 import io.swagger.annotations.ApiModel;
37
     private String logo;
39
     private String logo;
38
 
40
 
39
     @ApiModelProperty(value = "简介")
41
     @ApiModelProperty(value = "简介")
42
+    @TableField ("`desc`")
40
     private String desc;
43
     private String desc;
41
 
44
 
42
     @ApiModelProperty(value = "排序")
45
     @ApiModelProperty(value = "排序")