|
@@ -2,12 +2,19 @@ package com.qmth.exam.reserve.controller.admin;
|
|
|
|
|
|
import com.qmth.boot.api.annotation.Aac;
|
|
|
import com.qmth.boot.api.constant.ApiConstant;
|
|
|
-import com.qmth.exam.reserve.bean.SystemPropertyBean;
|
|
|
+import com.qmth.boot.core.fss.store.FileStore;
|
|
|
+import com.qmth.exam.reserve.bean.Constants;
|
|
|
+import com.qmth.exam.reserve.bean.applytask.CurrentApplyTaskVO;
|
|
|
+import com.qmth.exam.reserve.bean.systemproperty.SystemPropertyBean;
|
|
|
import com.qmth.exam.reserve.controller.BaseController;
|
|
|
+import com.qmth.exam.reserve.entity.SystemPropertyEntity;
|
|
|
+import com.qmth.exam.reserve.service.ApplyTaskService;
|
|
|
+import com.qmth.exam.reserve.service.SystemPropertyService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
@@ -20,15 +27,31 @@ public class SystemPropertyController extends BaseController {
|
|
|
|
|
|
private static final Logger log = LoggerFactory.getLogger(SystemPropertyController.class);
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private FileStore fileStore;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ApplyTaskService applyTaskService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private SystemPropertyService systemPropertyService;
|
|
|
+
|
|
|
@ApiOperation(value = "获取系统常用属性集合")
|
|
|
@PostMapping(value = "/properties")
|
|
|
public SystemPropertyBean properties() {
|
|
|
SystemPropertyBean properties = new SystemPropertyBean();
|
|
|
- properties.setFileUrlPrefix("https://xxx.com");
|
|
|
- properties.setOrgTitle("XXX大学");
|
|
|
- properties.setOrgTitle("yyyy年春季考试预约");
|
|
|
- properties.setCategoryLevels("[{\"level\":1,\"title\":\"城市\"},{\"level\":2,\"title\":\"教学点\"}]");
|
|
|
- // todo
|
|
|
+ properties.setFileUrlPrefix(fileStore.getServer());
|
|
|
+
|
|
|
+ CurrentApplyTaskVO curApplyTask = applyTaskService.currentApplyTask();
|
|
|
+ if (curApplyTask != null) {
|
|
|
+ properties.setOrgTitle(curApplyTask.getOrgName());
|
|
|
+ properties.setTaskTitle(curApplyTask.getTaskName());
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemPropertyEntity systemProperty = systemPropertyService.findByPropKey(Constants.CATEGORY_LEVEL);
|
|
|
+ if (systemProperty != null) {
|
|
|
+ properties.setCategoryLevels(systemProperty.getPropValue());
|
|
|
+ }
|
|
|
|
|
|
return properties;
|
|
|
}
|