|
@@ -5,15 +5,18 @@ import com.qmth.themis.business.bean.exam.OrgInfoBean;
|
|
import com.qmth.themis.business.bean.exam.VersionBean;
|
|
import com.qmth.themis.business.bean.exam.VersionBean;
|
|
import com.qmth.themis.business.entity.TBOrg;
|
|
import com.qmth.themis.business.entity.TBOrg;
|
|
import com.qmth.themis.business.service.TBOrgService;
|
|
import com.qmth.themis.business.service.TBOrgService;
|
|
|
|
+import com.qmth.themis.business.util.RedisUtil;
|
|
import com.qmth.themis.common.util.Result;
|
|
import com.qmth.themis.common.util.Result;
|
|
import com.qmth.themis.common.util.ResultUtil;
|
|
import com.qmth.themis.common.util.ResultUtil;
|
|
import io.swagger.annotations.*;
|
|
import io.swagger.annotations.*;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
+import java.util.Map;
|
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
@Api(tags = "系统信息Controller")
|
|
@Api(tags = "系统信息Controller")
|
|
@RestController
|
|
@RestController
|
|
@@ -23,14 +26,21 @@ public class SysController {
|
|
@Resource
|
|
@Resource
|
|
private TBOrgService orgService;
|
|
private TBOrgService orgService;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ RedisUtil redisUtil;
|
|
|
|
+
|
|
@ApiOperation(value = "获取环境接口")
|
|
@ApiOperation(value = "获取环境接口")
|
|
@RequestMapping(value = "/env", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/env", method = RequestMethod.POST)
|
|
@ApiResponses({@ApiResponse(code = 200, message = "环境信息", response = Result.class)})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "环境信息", response = Result.class)})
|
|
- public Result env(@ApiParam(value = "机构id", required = false) @RequestParam(required = false) Long orgId) {
|
|
|
|
|
|
+ public Result env(@ApiParam(value = "机构id", required = false) @RequestBody Map<String, Object> mapParameter) {
|
|
EnvBean env = new EnvBean();
|
|
EnvBean env = new EnvBean();
|
|
- if (orgId != null) {
|
|
|
|
- TBOrg org = orgService.getById(orgId);
|
|
|
|
- if (org != null) {
|
|
|
|
|
|
+ if (Objects.nonNull(mapParameter.get("orgId"))) {
|
|
|
|
+ Long orgId = Long.parseLong(String.valueOf(mapParameter.get("orgId")));
|
|
|
|
+ TBOrg org = (TBOrg) redisUtil.getOrg(orgId);
|
|
|
|
+ if (Objects.isNull(org)) {
|
|
|
|
+ org = orgService.getById(orgId);
|
|
|
|
+ }
|
|
|
|
+ if (Objects.nonNull(org)) {
|
|
OrgInfoBean orgInfo = new OrgInfoBean();
|
|
OrgInfoBean orgInfo = new OrgInfoBean();
|
|
orgInfo.setLogo(org.getLogo());
|
|
orgInfo.setLogo(org.getLogo());
|
|
orgInfo.setName(org.getName());
|
|
orgInfo.setName(org.getName());
|