|
@@ -9,6 +9,8 @@ import java.util.LinkedHashMap;
|
|
|
import java.util.Map;
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.json.JSONArray;
|
|
|
+import org.json.JSONObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@@ -55,13 +57,36 @@ public class SysMessageController extends BaseController {
|
|
|
@ApiOperation("获取消息分类类型")
|
|
|
@GetMapping(value = "typeList")
|
|
|
public Object typeList(){
|
|
|
- HashMap<Object, Object> map = new LinkedHashMap<>(5);
|
|
|
- map.put("ALL","全部");
|
|
|
- map.put("ATTENDANCE","考勤信息");
|
|
|
- map.put("COURSE","课程信息");
|
|
|
- map.put("WORK","作业信息");
|
|
|
- map.put("DEFAULT","其他");
|
|
|
- return succeed(map);
|
|
|
+ return succeed("[{\"value\":\"全部\",\"key\":\"ALL\"}," +
|
|
|
+ "{\"value\":\"考勤信息\",\"key\":\"ATTENDANCE\"}," +
|
|
|
+ "{\"value\":\"课程信息\",\"key\":\"COURSE\"}," +
|
|
|
+ "{\"value\":\"作业信息\",\"key\":\"WORK\"}," +
|
|
|
+ "{\"value\":\"其他\",\"key\":\"DEFAULT\"}]");
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void main(String[] args) {
|
|
|
+ JSONArray jsonArray = new JSONArray();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ jsonObject.put("key","ALL");
|
|
|
+ jsonObject.put("value","全部");
|
|
|
+ JSONObject jsonObject1 = new JSONObject();
|
|
|
+ jsonObject1.put("key","ATTENDANCE");
|
|
|
+ jsonObject1.put("value","考勤信息");
|
|
|
+ JSONObject jsonObject2 = new JSONObject();
|
|
|
+ jsonObject2.put("key","COURSE");
|
|
|
+ jsonObject2.put("value","课程信息");
|
|
|
+ JSONObject jsonObject3 = new JSONObject();
|
|
|
+ jsonObject3.put("key","WORK");
|
|
|
+ jsonObject3.put("value","作业信息");
|
|
|
+ JSONObject jsonObject4 = new JSONObject();
|
|
|
+ jsonObject4.put("key","DEFAULT");
|
|
|
+ jsonObject4.put("value","其他");
|
|
|
+ jsonArray.put(jsonObject);
|
|
|
+ jsonArray.put(jsonObject1);
|
|
|
+ jsonArray.put(jsonObject2);
|
|
|
+ jsonArray.put(jsonObject3);
|
|
|
+ jsonArray.put(jsonObject4);
|
|
|
+ System.out.println(jsonArray);
|
|
|
}
|
|
|
|
|
|
@ApiOperation("一键已读")
|