Commit 1dce13ed by zhiwj

数据字典

parent e1eafb2b
......@@ -19,6 +19,7 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<libraryVersion>4.0-SNAPSHOT</libraryVersion>
<gic-data-cloud-api>4.0-SNAPSHOT</gic-data-cloud-api>
<!-- api依赖,正式版会在 gic-pom-base 里生成 -->
</properties>
......@@ -88,6 +89,11 @@
<artifactId>gic-platform-enterprise-api</artifactId>
<version>${gic-platform-enterprise-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-data-cloud-api</artifactId>
<version>${gic-data-cloud-api}</version>
</dependency>
<!--<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
......
package com.gic.cloud.operation.web.controller;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.authcenter.security.core.dto.UserDetailsVO;
import com.gic.authcenter.security.core.util.UserUtils;
import com.gic.cloud.dto.IndexDTO;
import com.gic.cloud.qo.IndexQO;
import com.gic.cloud.service.DataExplainApiService;
import com.gic.cloud.service.IndexApiService;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.utils.ResultControllerUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author zhiwj
* @Description:
* @date 2020-07-09 14:22
*/
@RestController
public class IndexController {
@Autowired
private IndexApiService indexApiService;
@Autowired
private DataExplainApiService dataExplainApiService;
@RequestMapping("/saveIndex")
public RestResponse saveIndex(IndexDTO indexDTO) {
if (indexDTO.getIsAppIndex() == null ||
StringUtils.isBlank(indexDTO.getCode()) ||
StringUtils.isBlank(indexDTO.getName()) ||
StringUtils.isBlank(indexDTO.getIndexRemark())) {
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), ErrorCode.PARAMETER_ERROR.getMsg());
}
UserDetailsVO user = UserUtils.getUser();
indexDTO.setOptUserId(user.getId());
indexDTO.setOptUserName(user.getRealName());
ServiceResponse<Void> serviceResponse = indexApiService.saveIndex(indexDTO);
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("/updateIndex")
public RestResponse updateIndex(IndexDTO indexDTO, Integer updateType, String reason) {
if (indexDTO.getIndexId() == null || updateType == null) {
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), ErrorCode.PARAMETER_ERROR.getMsg());
}
ServiceResponse<Void> serviceResponse = indexApiService.updateIndex(indexDTO, updateType, reason);
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("/getByIndexId")
public RestResponse getByIndexId(Integer indexId) {
ServiceResponse<IndexDTO> serviceResponse = indexApiService.getByIndexId(indexId);
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("/listIndex")
public RestResponse listIndex(IndexQO indexQO) {
ServiceResponse<Page<IndexDTO>> serviceResponse = indexApiService.listIndex(indexQO);
return ResultControllerUtils.commonResult(serviceResponse);
}
}
\ No newline at end of file
......@@ -92,4 +92,7 @@
<dubbo:reference interface="com.gic.authcenter.api.service.GicDepartmentService" id="gicDepartmentService" timeout="6000" />
<dubbo:reference interface="com.gic.member.config.api.service.MemberCardApiService" id="memberCardApiService" timeout="6000" />
<dubbo:reference interface="com.gic.cloud.service.IndexApiService" id="indexApiService" timeout="6000" retries="0"/>
<dubbo:reference interface="com.gic.cloud.service.DataExplainApiService" id="dataExplainApiService" timeout="6000" retries="0"/>
</beans>
\ No newline at end of file
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