wangwei 6 年之前
父节点
当前提交
f3e6df1542

+ 0 - 49
examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/controller/OrgConfigController.java

@@ -1,49 +0,0 @@
-package cn.com.qmth.examcloud.core.basic.api.controller;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import cn.com.qmth.examcloud.core.basic.service.impl.OrgConfigService;
-import io.swagger.annotations.ApiOperation;
-
-/**
- * 机构配置API
- * 
- * @author wang wei
- * @date 2018年4月9日
- */
-@Transactional
-@RestController
-@RequestMapping("${$rmp.ctr.basic}/orgConfig")
-public class OrgConfigController {
-
-	@Autowired
-	private OrgConfigService orgConfigService;
-
-	@ApiOperation(value = "查询机构配置", notes = "查询")
-	@GetMapping("/{id}/{key}")
-	public ResponseEntity<?> getOrgConfig(@PathVariable Long id, @PathVariable String key) {
-
-		String value = orgConfigService.getOrgConfig(id, key);
-
-		return new ResponseEntity<>(value, HttpStatus.OK);
-	}
-
-	@ApiOperation(value = "更新机构配置", notes = "更新")
-	@PutMapping("/{id}/{key}")
-	public ResponseEntity<?> setOrgConfig(@PathVariable Long id, @PathVariable String key, @RequestBody String value) {
-
-		orgConfigService.setOrgConfig(id, key, value);
-
-		return new ResponseEntity<>("", HttpStatus.OK);
-	}
-
-}

+ 0 - 48
examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/impl/OrgConfigService.java

@@ -1,48 +0,0 @@
-package cn.com.qmth.examcloud.core.basic.service.impl;
-
-import java.util.List;
-import java.util.Map;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.stereotype.Service;
-import org.springframework.web.bind.annotation.PathVariable;
-
-@Service
-public class OrgConfigService {
-
-	@Autowired
-	private JdbcTemplate jdbcTemplate;
-
-	/**
-	 * @param id
-	 * @param key
-	 * @return
-	 */
-	public String getOrgConfig(@PathVariable Long id, @PathVariable String key) {
-
-		List<Map<String, Object>> dataList = jdbcTemplate
-				.queryForList(" SELECT t.value from ecs_core_org_config t where t.org_id=? and t.key=?", id, key);
-
-		String value = "";
-		if (1 == dataList.size()) {
-			Map<String, Object> map = dataList.get(0);
-			value = (String) map.get("value");
-		}
-
-		return value;
-	}
-
-	/**
-	 * @param orgId
-	 * @param key
-	 * @param value
-	 */
-	public void setOrgConfig(Long orgId, String key, String value) {
-
-		jdbcTemplate.update(
-				"INSERT INTO ecs_core_org_config (org_id,`key`,`value`) VALUES (?,?,?) ON DUPLICATE KEY UPDATE `value`=?", orgId,
-				key, value, value);
-	}
-
-}