Commit 5463c846 authored by Quxl's avatar Quxl

xx

parent 87da6ab4
package com.egolm.film.api.admin; package com.egolm.film.api.admin;
import java.io.File; import java.io.BufferedReader;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.egolm.common.FileUtil;
import com.egolm.common.StringUtil; import com.egolm.common.StringUtil;
import com.egolm.common.bean.Rjx; import com.egolm.common.bean.Rjx;
import com.egolm.common.jdbc.Page; import com.egolm.common.jdbc.Page;
...@@ -148,10 +150,11 @@ public class AdminAuthController { ...@@ -148,10 +150,11 @@ public class AdminAuthController {
@ResponseBody @ResponseBody
@PostMapping("allAuth") @PostMapping("allAuth")
@ApiOperation("全部管理组权限查询") @ApiOperation("全部管理组权限查询")
public Object allAuth() throws FileNotFoundException { public Object allAuth() throws IOException {
File file = ResourceUtils.getFile("classpath:auth_admin.json"); Resource resource = new ClassPathResource("auth_admin.json");
String json = FileUtil.fileToString(file); BufferedReader br = new BufferedReader(new InputStreamReader(resource.getInputStream()));
return Rjx.jsonOk().setData(JSON.parseArray(json)); String text = StringUtil.read(br);
return Rjx.jsonOk().setData(JSON.parseArray(text));
} }
@ResponseBody @ResponseBody
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment