修改字典表类型Controller
diff --git a/leaveschool/client/src/main/java/com/supwisdom/leaveschool/client/config/Swagger2Config.java b/leaveschool/client/src/main/java/com/supwisdom/leaveschool/client/config/Swagger2Config.java
new file mode 100644
index 0000000..6509e93
--- /dev/null
+++ b/leaveschool/client/src/main/java/com/supwisdom/leaveschool/client/config/Swagger2Config.java
@@ -0,0 +1,41 @@
+package com.supwisdom.leaveschool.client.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+
+/**
+ * @author xiehuibing
+ * @ClassName com.supwisdom.framework.config.Swgger2
+ * @Description
+ * @date 2018-07-23
+ */
+@Configuration
+public class Swagger2Config {
+
+ @Bean
+ public Docket createRestApi() {
+ return new Docket(DocumentationType.SWAGGER_2)
+ .apiInfo(apiInfo())
+ .select()
+ .apis(RequestHandlerSelectors.any())
+// .apis(RequestHandlerSelectors.basePackage("org.supwisdom"))
+// .paths(PathSelectors.any())
+ .paths(PathSelectors.ant("/api/**"))
+ .build();
+ }
+
+ private ApiInfo apiInfo() {
+ return new ApiInfoBuilder()
+ .title("离校微服务系统前端API文档")
+ .description("restful风格,离校微服务系统前端API文档")
+// .termsOfServiceUrl("http://127.0.0.1:8081/")
+ .version("1.0")
+ .build();
+ }
+}
diff --git a/leaveschool/client/src/main/java/com/supwisdom/leaveschool/client/controller/basicsdata/DictionaryTypeController.java b/leaveschool/client/src/main/java/com/supwisdom/leaveschool/client/controller/basicsdata/DictionaryTypeController.java
new file mode 100644
index 0000000..a82b46a
--- /dev/null
+++ b/leaveschool/client/src/main/java/com/supwisdom/leaveschool/client/controller/basicsdata/DictionaryTypeController.java
@@ -0,0 +1,44 @@
+package com.supwisdom.leaveschool.client.controller.basicsdata;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.util.MimeTypeUtils;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.ResponseStatus;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.supwisdom.leaveschool.client.service.basicsdata.DictionaryType1RemoteService;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+
+@RestController
+@RequestMapping("/api/basics-data/dictionary-types")
+@Api(value="字典表类型操作",tags={"字典表类型的操作接口"})
+public class DictionaryTypeController {
+
+ private static final Logger logger = LoggerFactory.getLogger(DictionaryTypeController.class);
+
+ @Autowired
+ DictionaryType1RemoteService dictionaryType1RemoteService;
+
+ @GetMapping(produces = MimeTypeUtils.APPLICATION_JSON_VALUE)
+ @ResponseStatus(value = HttpStatus.OK)
+ @ApiOperation(value="获取字典表类型列表",tags={"获取字典表类型列表copy"},notes="注意问题点")
+// @ApiImplicitParams({
+// @ApiImplicitParam(name = "pageIndex", value = "当前第页数,默认0,为第一页", required = true, dataType = "int", paramType = "query", defaultValue = "0"),
+// @ApiImplicitParam(name = "pageSize", value = "每页条数,默认20", required = true, dataType = "int", paramType = "query", defaultValue = "20"),
+// @ApiImplicitParam(name = "name", value = "类型码或名称", required = false, dataType = "string", paramType = "query", defaultValue = "")
+// })
+ @ResponseBody
+ public Object list(@ApiParam(name="pageIndex",value="当前第页数,默认0,为第一页",required=true,defaultValue="0") int pageIndex,
+ @ApiParam(name="pageIndex",value="每页条数,默认20",required=true,defaultValue="20") int pageSize,
+ @ApiParam(name="name",value="类型码或名称",required=true,defaultValue="20") String name) {
+ return dictionaryType1RemoteService.list(pageIndex,pageSize,name);
+ }
+}
diff --git a/leaveschool/client/src/main/java/com/supwisdom/leaveschool/client/service/basicsdata/DictionaryType1RemoteService.java b/leaveschool/client/src/main/java/com/supwisdom/leaveschool/client/service/basicsdata/DictionaryType1RemoteService.java
new file mode 100644
index 0000000..329c550
--- /dev/null
+++ b/leaveschool/client/src/main/java/com/supwisdom/leaveschool/client/service/basicsdata/DictionaryType1RemoteService.java
@@ -0,0 +1,41 @@
+package com.supwisdom.leaveschool.client.service.basicsdata;
+
+import java.util.Map;
+
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.util.MimeTypeUtils;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import com.supwisdom.leaveschool.client.service.fallback.DictionaryType1RemoteHystrix;
+import com.supwisdom.leaveschool.proxy.basicsdata.domain.DictionaryType;
+import com.supwisdom.leaveschool.proxy.common.model.PagerRequestModel;
+import com.supwisdom.leaveschool.proxy.common.model.PagerResponseModel;
+import com.supwisdom.leaveschool.proxy.common.model.SuccessResponseModel;
+
+@FeignClient(
+ name = "leaveschool-basics-data-1-dictionary-type",
+ url = "${leaveschool-basics-data.api.url}/api/v1/basics-data/dictionary-types",
+ fallback = DictionaryType1RemoteHystrix.class
+)
+public interface DictionaryType1RemoteService {
+
+ @RequestMapping(method = RequestMethod.GET, produces = MimeTypeUtils.APPLICATION_JSON_VALUE)
+ public PagerResponseModel<DictionaryType> list(int pageIndex,int pageSize,String name);
+
+ @RequestMapping(path = "/{id}", method = RequestMethod.GET, produces = MimeTypeUtils.APPLICATION_JSON_VALUE)
+ public DictionaryType get(@PathVariable("id") String id);
+
+ @RequestMapping(method = RequestMethod.POST, consumes = MimeTypeUtils.APPLICATION_JSON_VALUE, produces = MimeTypeUtils.APPLICATION_JSON_VALUE)
+ public SuccessResponseModel create(@RequestBody DictionaryType dictionaryType);
+
+ @RequestMapping(method = RequestMethod.PUT, consumes = MimeTypeUtils.APPLICATION_JSON_VALUE, produces = MimeTypeUtils.APPLICATION_JSON_VALUE)
+ public SuccessResponseModel update(@RequestBody DictionaryType dictionaryType);
+
+ @RequestMapping(path = "/{id}", method = RequestMethod.DELETE, produces = MimeTypeUtils.APPLICATION_JSON_VALUE)
+ public SuccessResponseModel delete(@PathVariable("id") String id);
+
+}
diff --git a/leaveschool/client/src/main/java/com/supwisdom/leaveschool/client/service/fallback/DictionaryType1RemoteHystrix.java b/leaveschool/client/src/main/java/com/supwisdom/leaveschool/client/service/fallback/DictionaryType1RemoteHystrix.java
new file mode 100644
index 0000000..de6a7a7
--- /dev/null
+++ b/leaveschool/client/src/main/java/com/supwisdom/leaveschool/client/service/fallback/DictionaryType1RemoteHystrix.java
@@ -0,0 +1,42 @@
+package com.supwisdom.leaveschool.client.service.fallback;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+import com.supwisdom.leaveschool.client.service.basicsdata.DictionaryType1RemoteService;
+import com.supwisdom.leaveschool.proxy.basicsdata.domain.DictionaryType;
+import com.supwisdom.leaveschool.proxy.common.model.PagerResponseModel;
+import com.supwisdom.leaveschool.proxy.common.model.SuccessResponseModel;
+
+@Component
+public class DictionaryType1RemoteHystrix implements DictionaryType1RemoteService {
+
+ private static final Logger logger = LoggerFactory.getLogger(DictionaryType1RemoteHystrix.class);
+
+ @Override
+ public PagerResponseModel<DictionaryType> list(int pageIndex,int pageSize,String name) {
+ return null;
+ }
+
+ @Override
+ public DictionaryType get(String id) {
+ return null;
+ }
+
+ @Override
+ public SuccessResponseModel create(DictionaryType dictionaryType) {
+ return null;
+ }
+
+ @Override
+ public SuccessResponseModel update(DictionaryType dictionaryType) {
+ return null;
+ }
+
+ @Override
+ public SuccessResponseModel delete(String id) {
+ return null;
+ }
+
+}
diff --git a/leaveschool/client/src/main/java/com/supwisdom/leaveschool/proxy/basicsdata/domain/DictionaryType.java b/leaveschool/client/src/main/java/com/supwisdom/leaveschool/proxy/basicsdata/domain/DictionaryType.java
new file mode 100644
index 0000000..74afe21
--- /dev/null
+++ b/leaveschool/client/src/main/java/com/supwisdom/leaveschool/proxy/basicsdata/domain/DictionaryType.java
@@ -0,0 +1,51 @@
+package com.supwisdom.leaveschool.proxy.basicsdata.domain;
+
+import com.supwisdom.leaveschool.proxy.common.domain.ABaseDomain;
+
+/**
+ * 字典类型表
+ * @author Administrator
+ *
+ */
+public class DictionaryType extends ABaseDomain {
+
+
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -7355785282419690119L;
+
+ private String code;
+
+ private String name;
+
+ private boolean enabled = true;
+
+ public String getCode() {
+ return code;
+ }
+
+ public void setCode(String code) {
+ this.code = code;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+
+
+}