Skip to content

Commit e6cc128

Browse files
committed
a
1 parent 990348c commit e6cc128

44 files changed

Lines changed: 316 additions & 285 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.classpath

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,8 @@
2828
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
2929
</attributes>
3030
</classpathentry>
31+
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v7.0"/>
32+
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
33+
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
3134
<classpathentry kind="output" path="target/classes"/>
3235
</classpath>

.project

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</projects>
77
<buildSpec>
88
<buildCommand>
9-
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
9+
<name>org.eclipse.wst.validation.validationbuilder</name>
1010
<arguments>
1111
</arguments>
1212
</buildCommand>
@@ -20,11 +20,6 @@
2020
<arguments>
2121
</arguments>
2222
</buildCommand>
23-
<buildCommand>
24-
<name>org.eclipse.wst.validation.validationbuilder</name>
25-
<arguments>
26-
</arguments>
27-
</buildCommand>
2823
<buildCommand>
2924
<name>org.eclipse.m2e.core.maven2Builder</name>
3025
<arguments>

.settings/.jsdtscope

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
3-
<classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="src/main/webapp"/>
4-
<classpathentry kind="src" path="target/m2e-wtp/web-resources"/>
53
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
64
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
75
<attributes>
86
<attribute name="hide" value="true"/>
97
</attributes>
108
</classpathentry>
119
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
10+
<classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="WebContent"/>
1211
<classpathentry kind="output" path=""/>
1312
</classpath>

.settings/org.eclipse.wst.common.component

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
22
<wb-module deploy-name="webproject">
3-
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
4-
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
53
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
64
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
75
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/java"/>
6+
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
87
<property name="context-root" value="webproject"/>
98
<property name="java-output-path" value="/webproject/target/classes"/>
109
</wb-module>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<root>
2+
<facet id="jst.jsf">
3+
<node name="libprov">
4+
<attribute name="provider-id" value="jsf-no-op-library-provider"/>
5+
</node>
6+
</facet>
7+
<facet id="jst.jaxrs">
8+
<node name="libprov">
9+
<attribute name="provider-id" value="jaxrs-no-op-library-provider"/>
10+
</node>
11+
</facet>
12+
</root>
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<faceted-project>
3-
<fixed facet="wst.jsdt.web"/>
4-
<installed facet="java" version="1.5"/>
5-
<installed facet="jst.web" version="2.3"/>
3+
<installed facet="java" version="1.8"/>
4+
<installed facet="jst.web" version="3.0"/>
65
<installed facet="wst.jsdt.web" version="1.0"/>
6+
<installed facet="jst.jsf" version="2.2"/>
7+
<installed facet="jst.jaxrs" version="2.0"/>
78
</faceted-project>

javaWeb

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/main/java/com/weibo/dashboard/controller/CommentController.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import com.weibo.dashboard.entity.Comment;
1212
import com.weibo.dashboard.service.CommentService;
13+
import com.weibo.util.ResponseData;
1314

1415
@RestController
1516
@RequestMapping(value="/comment")
@@ -18,8 +19,9 @@ public class CommentController {
1819
CommentService commentService;
1920

2021
@RequestMapping(value="/new",method=RequestMethod.POST)
21-
public void add(@RequestBody Comment comment){
22+
public ResponseData add(@RequestBody Comment comment){
2223
commentService.insert(comment);
24+
return new ResponseData(comment);
2325
}
2426
@RequestMapping(value="/{id}",method=RequestMethod.DELETE)
2527
public void delete(@PathVariable("id") int id){

src/main/java/com/weibo/dashboard/controller/PostController.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ public int delete(@PathVariable("id") int id){
3838
int res = postService.delete(id);
3939
return res;
4040
}
41+
@ResponseBody
4142
@RequestMapping(value="/new",method=RequestMethod.POST)
42-
public void add(@RequestBody Post post){
43+
public ResponseData add(@RequestBody Post post){
4344
postService.insert(post);
45+
return new ResponseData(post);
4446
}
4547
@RequestMapping(value="/likes/{id}/{flag}",method=RequestMethod.GET)
4648
public void likeOrDislike(@PathVariable("id") int id,@PathVariable("flag") boolean flag){

src/main/java/com/weibo/dashboard/controller/UserController.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import javax.annotation.Resource;
44

5-
import org.json.JSONObject;
65
import org.springframework.web.bind.annotation.PathVariable;
76
import org.springframework.web.bind.annotation.RequestBody;
87
import org.springframework.web.bind.annotation.RequestMapping;
@@ -19,25 +18,18 @@
1918
public class UserController {
2019
@Resource
2120
UserService userService;
22-
2321

2422
@ResponseBody
2523
@RequestMapping(value="/{name}",method=RequestMethod.GET)
2624
public ResponseData findUser(@PathVariable("name")String name){
2725
User user = userService.select(name);
2826
return new ResponseData(user);
2927
}
30-
// @ResponseBody
31-
// @RequestMapping(value="/{name}",method=RequestMethod.GET)
32-
// public int userNameExits(@PathVariable("name")String name){
33-
// int res = userService.userNameExits(name);
34-
// return res;
35-
// }
3628

3729
@ResponseBody
3830
@RequestMapping(value="/login",method=RequestMethod.POST)
3931
public ResponseData accountValid(@RequestBody User user){
40-
User res = userService.accountValid(user);
32+
boolean res = userService.accountValid(user);
4133
return new ResponseData(res);
4234
}
4335
@ResponseBody

0 commit comments

Comments
 (0)