|
@@ -1,14 +1,5 @@
|
|
|
package com.qmth.themis.exam.api;
|
|
|
|
|
|
-import java.util.Date;
|
|
|
-
|
|
|
-import javax.annotation.Resource;
|
|
|
-
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
-
|
|
|
import com.qmth.themis.business.bean.exam.EnvBean;
|
|
|
import com.qmth.themis.business.bean.exam.OrgInfoBean;
|
|
|
import com.qmth.themis.business.bean.exam.VersionBean;
|
|
@@ -16,43 +7,43 @@ import com.qmth.themis.business.entity.TBOrg;
|
|
|
import com.qmth.themis.business.service.TBOrgService;
|
|
|
import com.qmth.themis.common.util.Result;
|
|
|
import com.qmth.themis.common.util.ResultUtil;
|
|
|
+import io.swagger.annotations.*;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
-import io.swagger.annotations.Api;
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
-import io.swagger.annotations.ApiParam;
|
|
|
-import io.swagger.annotations.ApiResponse;
|
|
|
-import io.swagger.annotations.ApiResponses;
|
|
|
+import javax.annotation.Resource;
|
|
|
|
|
|
@Api(tags = "系统信息Controller")
|
|
|
@RestController
|
|
|
@RequestMapping("/${prefix.url.exam}/sys")
|
|
|
public class SysController {
|
|
|
-
|
|
|
- @Resource
|
|
|
- private TBOrgService orgService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private TBOrgService orgService;
|
|
|
|
|
|
@ApiOperation(value = "获取环境接口")
|
|
|
- @RequestMapping(value = "/env", method = RequestMethod.POST)
|
|
|
+ @RequestMapping(value = "/env", method = RequestMethod.GET)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "环境信息", response = Result.class)})
|
|
|
public Result env(@ApiParam(value = "机构id", required = false) @RequestParam(required = false) Long orgId) {
|
|
|
- EnvBean env=new EnvBean();
|
|
|
- if(orgId!=null) {
|
|
|
- TBOrg org=orgService.getById(orgId);
|
|
|
- if(org!=null) {
|
|
|
- OrgInfoBean orgInfo=new OrgInfoBean();
|
|
|
- orgInfo.setLogo(org.getLogo());
|
|
|
- orgInfo.setName(org.getName());
|
|
|
- orgInfo.setUpdateTime((org.getUpdateTime()==null?null:org.getUpdateTime().getTime()));
|
|
|
- env.setOrgInfo(orgInfo);
|
|
|
- }
|
|
|
- }
|
|
|
- env.setCurrentTime(new Date().getTime());
|
|
|
- VersionBean v=new VersionBean();
|
|
|
- v.setName("1.2.0");
|
|
|
- v.setValue(12);
|
|
|
- v.setUrl("xxxxxx");
|
|
|
- env.setVersion(v);
|
|
|
-
|
|
|
+ EnvBean env = new EnvBean();
|
|
|
+ if (orgId != null) {
|
|
|
+ TBOrg org = orgService.getById(orgId);
|
|
|
+ if (org != null) {
|
|
|
+ OrgInfoBean orgInfo = new OrgInfoBean();
|
|
|
+ orgInfo.setLogo(org.getLogo());
|
|
|
+ orgInfo.setName(org.getName());
|
|
|
+ orgInfo.setUpdateTime((org.getUpdateTime() == null ? null : org.getUpdateTime().getTime()));
|
|
|
+ env.setOrgInfo(orgInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ env.setCurrentTime(System.currentTimeMillis());
|
|
|
+ VersionBean v = new VersionBean();
|
|
|
+ v.setName("1.2.0");
|
|
|
+ v.setValue(12);
|
|
|
+ v.setUrl("xxxxxx");
|
|
|
+ env.setVersion(v);
|
|
|
return ResultUtil.ok(env);
|
|
|
}
|
|
|
}
|