diff --git a/README.md b/README.md
index d423f9d7..e940998f 100644
--- a/README.md
+++ b/README.md
@@ -1,11 +1,15 @@
### 作业描述
-
-#### 切换到课程对应的分支查看每节课的作业要求
-* Routing: routing
-* Data Binding: data-binding
-* Validation: validation
-* Customised Response: customize-response
-* Error Handling: error-handling
-
- 注意:最终需要将改动合并到master分支
-
+* 将所有接口的返回值都替换成使用ResponseEntity
+* 所有post请求都返回201,并且返回的头部带上index字段(值为创建的资源在列表中的位置:eg: 添加的热搜事件在列表中的index)
+* 完成demo里的练习:get /rs/list和 get/rs/{index}接口返回的数据中不包含user字段
+* 添加获取所有用户的接口: get /users,期望返回的数据格式例子:
+ ```
+ [{
+ "user_name": "xxxx",
+ "user_age": 19,
+ "user_gender": "female",
+ "user_email": "xxx@xx",
+ "user_phone": "1xxxxxxxxxx"
+ }]
+* 先写测试!!!
+* hint: @JsonpProperty的使用
\ No newline at end of file
diff --git a/git status b/git status
new file mode 100644
index 00000000..54623e43
--- /dev/null
+++ b/git status
@@ -0,0 +1,5 @@
+* [32mcustomize-response[m
+ data-binding[m
+ master[m
+ vaildation[m
+ validation[m
diff --git a/src/main/java/com/thoughtworks/rslist/api/RsController.java b/src/main/java/com/thoughtworks/rslist/api/RsController.java
index 6899e4de..44dadb38 100644
--- a/src/main/java/com/thoughtworks/rslist/api/RsController.java
+++ b/src/main/java/com/thoughtworks/rslist/api/RsController.java
@@ -1,11 +1,86 @@
package com.thoughtworks.rslist.api;
+import com.thoughtworks.rslist.domain.User;
+import com.thoughtworks.rslist.exception.Error;
+import com.thoughtworks.rslist.exception.RsEventNotValidException;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.MethodArgumentNotValidException;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.thoughtworks.rslist.domain.RsEvent;
+import org.springframework.web.bind.annotation.*;
-import java.util.Arrays;
+import javax.validation.Valid;
+import java.awt.*;
+import java.util.ArrayList;
import java.util.List;
@RestController
public class RsController {
- private List rsList = Arrays.asList("第一条事件", "第二条事件", "第三条事件");
+ private List rsList = initRsEventList();
+ private List initRsEventList(){
+ List rsEventList = new ArrayList<>();
+ User user = new User("lyx","female",18,"1@2.com","12222222222");
+ rsEventList.add(new RsEvent("第一条事件","无标签",user));
+ rsEventList.add(new RsEvent("第二条事件","无标签",user));
+ rsEventList.add(new RsEvent("第三条事件","无标签",user));
+ return rsEventList;
+ }
+
+ @GetMapping("/rs/{index}")
+ public ResponseEntity getOneRsEvent(@PathVariable int index){
+ if (index <= 0 || index > rsList.size()){
+ throw new RsEventNotValidException("invalid index");
+ }
+ return ResponseEntity.ok(rsList.get(index -1));
+ }
+
+ @GetMapping("/rs/list")
+ public ResponseEntity getRsEventBetween(@RequestParam(required = false) Integer start,@RequestParam(required = false) Integer end){
+ if(start == null || end == null){
+ return ResponseEntity.ok(rsList);
+ }
+ if((end - start +1) >rsList.size() || start > rsList.size()){
+ throw new RsEventNotValidException("invalid request param");
+ }
+ return ResponseEntity.ok(rsList.subList(start - 1,end));
+ }
+
+ @PostMapping("/rs/event")
+ public ResponseEntity