|
@@ -10,9 +10,17 @@ import io.swagger.annotations.ApiImplicitParam;
|
10
|
10
|
import io.swagger.annotations.ApiImplicitParams;
|
11
|
11
|
import io.swagger.annotations.ApiOperation;
|
12
|
12
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
13
|
+import org.springframework.beans.factory.annotation.Value;
|
|
14
|
+import org.springframework.beans.propertyeditors.CustomDateEditor;
|
|
15
|
+import org.springframework.web.bind.ServletRequestDataBinder;
|
13
|
16
|
import org.springframework.web.bind.annotation.*;
|
14
|
17
|
|
|
18
|
+import javax.servlet.http.HttpServletRequest;
|
15
|
19
|
import javax.servlet.http.HttpSession;
|
|
20
|
+import java.text.DateFormat;
|
|
21
|
+import java.text.SimpleDateFormat;
|
|
22
|
+import java.util.Date;
|
|
23
|
+import java.util.HashMap;
|
16
|
24
|
|
17
|
25
|
/**
|
18
|
26
|
* <p>
|
|
@@ -30,6 +38,13 @@ public class BuildingDynamicController extends BaseController {
|
30
|
38
|
@Autowired
|
31
|
39
|
private IBuildingDynamicService iBuildingDynamicService;
|
32
|
40
|
|
|
41
|
+ @InitBinder
|
|
42
|
+ protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception {
|
|
43
|
+ DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
|
44
|
+ CustomDateEditor editor = new CustomDateEditor(df, true);//true表示允许为空,false反之
|
|
45
|
+ binder.registerCustomEditor(Date.class, editor);
|
|
46
|
+ }
|
|
47
|
+
|
33
|
48
|
@ApiOperation(value = "项目动态管理列表", notes = "项目动态管理列表")
|
34
|
49
|
@ApiImplicitParams({
|
35
|
50
|
@ApiImplicitParam(paramType = "Query",dataType = "Integer",name = "pageNum",value = "分页第几页" ),
|
|
@@ -74,4 +89,26 @@ public class BuildingDynamicController extends BaseController {
|
74
|
89
|
return responseBean;
|
75
|
90
|
}
|
76
|
91
|
|
|
92
|
+ @RequestMapping(value = "/buildingDynamic/add" ,method =RequestMethod.PUT)
|
|
93
|
+ @ApiOperation(value = "动态管理添加",notes="动态管理添加")
|
|
94
|
+ @ApiImplicitParams({
|
|
95
|
+ @ApiImplicitParam(paramType = "Query",dataTypeClass = String.class,name = "buildingId",value = "楼盘id" ),
|
|
96
|
+ @ApiImplicitParam(paramType = "Query",dataTypeClass = String.class,name = "imgUrl",value = "首页图片" ),
|
|
97
|
+ @ApiImplicitParam(paramType = "Query",dataTypeClass = String.class,name = "title",value = "标题" ),
|
|
98
|
+ @ApiImplicitParam(paramType = "Query",dataTypeClass = String.class,name = "desc",value = "描述" ),
|
|
99
|
+ @ApiImplicitParam(paramType = "Query",dataTypeClass = String.class,name = "url",value = "url" ),
|
|
100
|
+ @ApiImplicitParam(paramType = "Query",dataType = "Date",name = "publishDate",value = "publishDate" )
|
|
101
|
+ })
|
|
102
|
+ public ResponseBean buildingDynamicAdd(@RequestParam(required = false) String buildingId,
|
|
103
|
+ @RequestParam(required = false) String imgUrl,
|
|
104
|
+ @RequestParam(required = false) String title,
|
|
105
|
+ @RequestParam(required = false) String desc,
|
|
106
|
+ @RequestParam(required = false) String url,
|
|
107
|
+ @RequestParam(value = "publishDate",required = false) Date publishDate){
|
|
108
|
+ HashMap<String,Object> map= new HashMap<>();
|
|
109
|
+ map.put("buildingId",buildingId);map.put("imgUrl",imgUrl);map.put("title",title);map.put("desc",desc);map.put("url",url);map.put("publishDate",publishDate);
|
|
110
|
+ ResponseBean responseBean= iBuildingDynamicService.buildingDynamicAdd(map);
|
|
111
|
+ return responseBean;
|
|
112
|
+ }
|
|
113
|
+
|
77
|
114
|
}
|