Browse Source

接口描述更改

hym 4 years ago
parent
commit
8638b898ba

+ 16 - 1
common/pom.xml

@@ -10,6 +10,21 @@
     <modelVersion>4.0.0</modelVersion>
     <modelVersion>4.0.0</modelVersion>
 
 
     <artifactId>common</artifactId>
     <artifactId>common</artifactId>
-
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>none</phase>
+                    </execution>
+                </executions>
+                <configuration>
+                    <classifier>execute</classifier>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 
 
 </project>
 </project>

+ 11 - 5
gateway/pom.xml

@@ -38,10 +38,7 @@
             <groupId>org.springframework.cloud</groupId>
             <groupId>org.springframework.cloud</groupId>
             <artifactId>spring-cloud-commons</artifactId>
             <artifactId>spring-cloud-commons</artifactId>
         </dependency>
         </dependency>
-        <dependency>
-            <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
-        </dependency>
+
         <dependency>
         <dependency>
             <groupId>org.springframework.cloud</groupId>
             <groupId>org.springframework.cloud</groupId>
             <artifactId>spring-cloud-starter-gateway</artifactId>
             <artifactId>spring-cloud-starter-gateway</artifactId>
@@ -69,8 +66,17 @@
             <version>1.18.4</version>
             <version>1.18.4</version>
             <scope>provided</scope>
             <scope>provided</scope>
         </dependency>
         </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+            <version>2.9.2</version>
 
 
-
+        </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger-ui</artifactId>
+            <version>2.7.0</version>
+        </dependency>
         <dependency>
         <dependency>
             <groupId>com.alibaba.cloud</groupId>
             <groupId>com.alibaba.cloud</groupId>
             <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
             <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>

+ 15 - 0
gateway/src/main/java/com/huaxu/gateway/GatewayApplication.java

@@ -0,0 +1,15 @@
+package com.huaxu.gateway;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+
+@EnableDiscoveryClient
+@SpringBootApplication
+public class GatewayApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(GatewayApplication.class, args);
+    }
+
+}

+ 21 - 0
gateway/src/main/java/com/huaxu/gateway/config/GatewayConfig.java

@@ -0,0 +1,21 @@
+package com.huaxu.gateway.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.web.reactive.function.server.RouterFunction;
+import org.springframework.web.reactive.function.server.RouterFunctions;
+import org.springframework.web.reactive.function.server.ServerResponse;
+
+@Configuration
+public class GatewayConfig {
+
+    /**
+     * webflux 静态资源配置
+     * @return serverResponse
+     */
+    @Bean
+    RouterFunction<ServerResponse> staticResourceRouter(){
+        return RouterFunctions.resources("/webjars/**", new ClassPathResource("webjars/"));
+    }
+}

+ 51 - 0
gateway/src/main/java/com/huaxu/gateway/config/SwaggerHandler.java

@@ -0,0 +1,51 @@
+package com.huaxu.gateway.config;
+
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import reactor.core.publisher.Mono;
+import springfox.documentation.swagger.web.SecurityConfiguration;
+import springfox.documentation.swagger.web.SwaggerResourcesProvider;
+import springfox.documentation.swagger.web.*;
+
+import java.util.Optional;
+
+
+@RestController
+@RequestMapping("/swagger-resources")
+public class SwaggerHandler {
+    @Autowired(required = false)
+    private SecurityConfiguration securityConfiguration;
+    @Autowired(required = false)
+    private UiConfiguration uiConfiguration;
+    private final SwaggerResourcesProvider swaggerResources;
+
+    @Autowired
+    public SwaggerHandler(SwaggerResourcesProvider swaggerResources) {
+        this.swaggerResources = swaggerResources;
+    }
+
+
+    @GetMapping("/configuration/security")
+    public Mono<ResponseEntity<SecurityConfiguration>> securityConfiguration() {
+        return Mono.just(new ResponseEntity<>(
+                Optional.ofNullable(securityConfiguration).orElse(SecurityConfigurationBuilder.builder().build()), HttpStatus.OK));
+    }
+
+    @GetMapping("/configuration/ui")
+    public Mono<ResponseEntity<UiConfiguration>> uiConfiguration() {
+        return Mono.just(new ResponseEntity<>(
+                Optional.ofNullable(uiConfiguration).orElse(UiConfigurationBuilder.builder().build()), HttpStatus.OK));
+    }
+
+    @GetMapping("")
+    public Mono<ResponseEntity> swaggerResources() {
+        return Mono.just((new ResponseEntity<>(swaggerResources.get(), HttpStatus.OK)));
+    }
+
+
+}

+ 45 - 0
gateway/src/main/java/com/huaxu/gateway/config/SwaggerProvider.java

@@ -0,0 +1,45 @@
+package com.huaxu.gateway.config;
+
+
+import lombok.AllArgsConstructor;
+import org.springframework.cloud.gateway.config.GatewayProperties;
+import org.springframework.cloud.gateway.route.RouteLocator;
+import org.springframework.context.annotation.Primary;
+import org.springframework.stereotype.Component;
+import springfox.documentation.swagger.web.SwaggerResource;
+import springfox.documentation.swagger.web.SwaggerResourcesProvider;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+@Component
+@Primary
+@AllArgsConstructor
+public class SwaggerProvider implements SwaggerResourcesProvider {
+
+    public static final String API_URI = "/v2/api-docs";
+    private final RouteLocator routeLocator;
+    private final GatewayProperties gatewayProperties;
+
+
+
+
+    @Override
+    public List<SwaggerResource> get() {
+        List resources = new ArrayList<>();
+        resources.add(swaggerResource("用户服务接口", "/user-auth/v2/api-docs?group=api"));
+        resources.add(swaggerResource("用户管理接口", "/user-center/v2/api-docs?group=api"));
+        return resources;
+    }
+
+    private SwaggerResource swaggerResource(String name, String location) {
+        SwaggerResource swaggerResource = new SwaggerResource();
+        swaggerResource.setName(name);
+        swaggerResource.setLocation(location);
+        swaggerResource.setSwaggerVersion("2.0");
+        return swaggerResource;
+
+    }
+
+}

+ 8 - 28
gateway/src/main/resources/application-dev.properties

@@ -1,10 +1,10 @@
-server.port=8320
+server.port=8081
 
 
 logging.level.root=info
 logging.level.root=info
 logging.path=D:/logs/smart-city-v2-gateway
 logging.path=D:/logs/smart-city-v2-gateway
 logging.level.com.alibaba.nacos.client.naming=error
 logging.level.com.alibaba.nacos.client.naming=error
 #指定服务名
 #指定服务名
-spring.application.name=smart-city-v2-gateway
+spring.application.name=gateway
 
 
 #nacos
 #nacos
 spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
 spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
@@ -12,36 +12,16 @@ spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
 spring.cloud.gateway.discovery.locator.enabled=true
 spring.cloud.gateway.discovery.locator.enabled=true
 spring.cloud.gateway.discovery.locator.lowerCaseServiceId=true
 spring.cloud.gateway.discovery.locator.lowerCaseServiceId=true
 
 
-spring.cloud.gateway.routes[0].id=user
-spring.cloud.gateway.routes[0].uri=lb://smart-city-v2-user
-spring.cloud.gateway.routes[0].predicates[0]=Path=/user/**
+spring.cloud.gateway.routes[0].id=user-auth
+spring.cloud.gateway.routes[0].uri=lb://user-auth
+spring.cloud.gateway.routes[0].predicates[0]=Path=/user-auth/**
 spring.cloud.gateway.routes[0].filters[0]=StripPrefix=1
 spring.cloud.gateway.routes[0].filters[0]=StripPrefix=1
 
 
-spring.cloud.gateway.routes[1].id=admin
-spring.cloud.gateway.routes[1].uri=lb://smart-city-v2-admin
-spring.cloud.gateway.routes[1].predicates[0]=Path=/admin/**
+spring.cloud.gateway.routes[1].id=user-center
+spring.cloud.gateway.routes[1].uri=lb://user-center
+spring.cloud.gateway.routes[1].predicates[0]=Path=/user-center/**
 spring.cloud.gateway.routes[1].filters[0]=StripPrefix=1
 spring.cloud.gateway.routes[1].filters[0]=StripPrefix=1
 
 
-spring.cloud.gateway.routes[2].id=device
-spring.cloud.gateway.routes[2].uri=lb://smart-city-v2-device
-spring.cloud.gateway.routes[2].predicates[0]=Path=/device/**
-spring.cloud.gateway.routes[2].filters[0]=StripPrefix=1
-
-spring.cloud.gateway.routes[3].id=workflow
-spring.cloud.gateway.routes[3].uri=lb://smart-city-v2-workflow
-spring.cloud.gateway.routes[3].predicates[0]=Path=/workflow/**
-spring.cloud.gateway.routes[3].filters[0]=StripPrefix=1
-
-
-spring.cloud.gateway.routes[4].id=access
-spring.cloud.gateway.routes[4].uri=lb://smart-city-v2-iothub-access
-spring.cloud.gateway.routes[4].predicates[0]=Path=/access/**
-spring.cloud.gateway.routes[4].filters[0]=StripPrefix=1
-
-spring.cloud.gateway.routes[5].id=log
-spring.cloud.gateway.routes[5].uri=lb://smart-city-v2-log
-spring.cloud.gateway.routes[5].predicates[0]=Path=/log/**
-spring.cloud.gateway.routes[5].filters[0]=StripPrefix=1
 
 
 spring.servlet.multipart.max-file-size=100MB
 spring.servlet.multipart.max-file-size=100MB
 spring.servlet.multipart.max-request-size=100MB
 spring.servlet.multipart.max-request-size=100MB

+ 11 - 0
user_auth/pom.xml

@@ -17,6 +17,17 @@
            <artifactId>aliyun-java-sdk-core</artifactId>
            <artifactId>aliyun-java-sdk-core</artifactId>
            <version>4.1.0</version>
            <version>4.1.0</version>
        </dependency>
        </dependency>
+       <dependency>
+           <groupId>com.huaxu</groupId>
+           <artifactId>common</artifactId>
+           <version>1.0-SNAPSHOT</version>
+           <exclusions>
+               <exclusion>
+                   <groupId>org.springframework.security.oauth.boot</groupId>
+                   <artifactId>spring-security-oauth2-autoconfigure</artifactId>
+               </exclusion>
+           </exclusions>
+       </dependency>
    </dependencies>
    </dependencies>
 
 
 </project>
 </project>

+ 33 - 10
user_auth/src/main/java/com/huaxu/controller/SmsController.java

@@ -53,11 +53,18 @@ public class SmsController {
 
 
         //检验该手机号码是否注册
         //检验该手机号码是否注册
         String key = "smsValidTime:" + phone;
         String key = "smsValidTime:" + phone;
-        getUser(phone,key);
+
+        int user = getUser(phone, key);
+        if(user==1){
+            return  new AjaxMessage(ResultStatus.PHONE_NUMBER_NOT_FOUND_ERROR);
+
+        }else if(user==2){
+            return  new AjaxMessage(ResultStatus.UNABLE_SEND_ERROR);
+        }
         verifyCode(phone,key);
         verifyCode(phone,key);
 
 
 
 
-        return new AjaxMessage(ResultStatus.OK);
+        return countVerify(phone);
     }
     }
     @PostMapping("/v2/send")
     @PostMapping("/v2/send")
     @ResponseBody
     @ResponseBody
@@ -69,17 +76,24 @@ public class SmsController {
     ) {
     ) {
 
 
         String validKey = "smsValidTime:" + mobile;
         String validKey = "smsValidTime:" + mobile;
-        getUser(mobile,validKey);
+        int user = getUser(mobile, validKey);
+        if(user==1){
+             return  new AjaxMessage(ResultStatus.PHONE_NUMBER_NOT_FOUND_ERROR);
+
+        }else if(user==2){
+            return  new AjaxMessage(ResultStatus.UNABLE_SEND_ERROR);
+        }
 
 
 
 
         String key = "validateCode:" + random;
         String key = "validateCode:" + random;
         byte[] redisValidateCodeByte = redisUtil.get(key.getBytes());
         byte[] redisValidateCodeByte = redisUtil.get(key.getBytes());
         if (redisValidateCodeByte == null) {
         if (redisValidateCodeByte == null) {
-            throw new ServiceException(ResultStatus.VALIDATE_CODE_EXPIRED_ERROR);
+            return  new AjaxMessage(ResultStatus.VALIDATE_CODE_EXPIRED_ERROR);
+
         } else {
         } else {
             ValidateCode validateCode = (ValidateCode) ByteArrayUtils.bytesToObject(redisValidateCodeByte).get();
             ValidateCode validateCode = (ValidateCode) ByteArrayUtils.bytesToObject(redisValidateCodeByte).get();
             if (validateCode.isExpried() || !StringUtils.equals(validateCode.getCode(), code)) {
             if (validateCode.isExpried() || !StringUtils.equals(validateCode.getCode(), code)) {
-                throw new ServiceException(ResultStatus.VALIDATE_CODE_ERROR);
+                return  new AjaxMessage(ResultStatus.VALIDATE_CODE_ERROR);
             }
             }
         }
         }
         verifyCode(mobile,validKey);
         verifyCode(mobile,validKey);
@@ -87,6 +101,12 @@ public class SmsController {
         redisUtil.del(key.getBytes());
         redisUtil.del(key.getBytes());
         return new AjaxMessage(ResultStatus.OK);
         return new AjaxMessage(ResultStatus.OK);
     }
     }
+    @PostMapping("test")
+    @ResponseBody
+    @ApiOperation(value = "发送短信")
+    public void test(String phone){
+        countVerify(phone);
+    }
     private AjaxMessage countVerify(String phone){
     private AjaxMessage countVerify(String phone){
         LocalDate now = LocalDate.now();
         LocalDate now = LocalDate.now();
         AjaxMessage ajaxMessage=new AjaxMessage(ResultStatus.OK);
         AjaxMessage ajaxMessage=new AjaxMessage(ResultStatus.OK);
@@ -99,6 +119,8 @@ public class SmsController {
             }else if(count==maxSendCodeNum){
             }else if(count==maxSendCodeNum){
                 ajaxMessage=new AjaxMessage(ResultStatus.SMS_CODE_LIMIT);
                 ajaxMessage=new AjaxMessage(ResultStatus.SMS_CODE_LIMIT);
             }
             }
+        }else{
+            redisUtil.set(key,"0");
         }
         }
         redisUtil.incr(key);
         redisUtil.incr(key);
         redisUtil.setExpire(key,60*60*24);
         redisUtil.setExpire(key,60*60*24);
@@ -114,9 +136,9 @@ public class SmsController {
         VerifyCodeUtil.sendVerificationCodeSms(mobile, verifyCode);
         VerifyCodeUtil.sendVerificationCodeSms(mobile, verifyCode);
         redisUtil.setExpire(validKey.getBytes(), "".getBytes(), 60);//60秒
         redisUtil.setExpire(validKey.getBytes(), "".getBytes(), 60);//60秒
     }
     }
-    private AjaxMessage getUser(String phone,String key){
+    private int getUser(String phone,String key){
         if (StringUtils.equals(phone, "18800000000") || StringUtils.equals(phone, "18800000001")) {
         if (StringUtils.equals(phone, "18800000000") || StringUtils.equals(phone, "18800000001")) {
-            return new AjaxMessage(ResultStatus.OK);
+            return 0;
         }
         }
 
 
         //检验该手机号码是否注册
         //检验该手机号码是否注册
@@ -124,15 +146,16 @@ public class SmsController {
         userQuery.setPhone(phone);
         userQuery.setPhone(phone);
         User user =  userService.findUser(userQuery);
         User user =  userService.findUser(userQuery);
         if (user == null) {
         if (user == null) {
-            throw new ServiceException(ResultStatus.PHONE_NUMBER_NOT_FOUND_ERROR);
+            return 1;
+
         }
         }
 
 
 
 
         byte[] redisValidateCodeByte = redisUtil.get(key.getBytes());
         byte[] redisValidateCodeByte = redisUtil.get(key.getBytes());
         if (redisValidateCodeByte != null) {
         if (redisValidateCodeByte != null) {
-            throw new ServiceException(ResultStatus.UNABLE_SEND_ERROR);
+            return 2;
         }
         }
-        return null;
+        return 0;
     }
     }
 
 
 
 

+ 11 - 75
user_auth/src/main/java/com/huaxu/controller/UserController.java

@@ -1,5 +1,6 @@
 package com.huaxu.controller;
 package com.huaxu.controller;
 
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.huaxu.dto.UserDto;
 import com.huaxu.dto.UserDto;
@@ -33,7 +34,7 @@ import java.util.List;
 @RestController
 @RestController
 @RequestMapping("/user")
 @RequestMapping("/user")
 
 
-@Api(tags = "")
+@Api(tags = "用户接口")
 public class UserController {
 public class UserController {
     /**
     /**
      * 服务对象
      * 服务对象
@@ -43,80 +44,6 @@ public class UserController {
     @Autowired
     @Autowired
     private RedisUtil redisUtil;
     private RedisUtil redisUtil;
 
 
-    /**
-     * 通过主键查询单条数据
-     *
-     * @param user 参数对象
-     * @return 单条数据
-     */
-    @RequestMapping(value = "get", method = RequestMethod.POST)
-    @ApiOperation(value = "查询设施配置列表")
-    public AjaxMessage<User> selectOne(
-            @ApiParam(value = "设置配置", required = true) @RequestBody User user) {
-        User result = userService.selectById(user.getId());
-
-        return new AjaxMessage<>(ResultStatus.OK, result);
-    }
-
-    /**
-     * 新增一条数据
-     *
-     * @param user 实体类
-     * @return Response对象
-     */
-    @RequestMapping(value = "insert", method = RequestMethod.POST)
-    @ApiOperation(value = "查询设施配置列表")
-    public AjaxMessage<Integer> insert(@ApiParam(value = "设置配置", required = true) @RequestBody User user) {
-        int result = userService.insert(user);
-
-        return new AjaxMessage<>(ResultStatus.OK, result);
-    }
-
-    /**
-     * 修改一条数据
-     *
-     * @param user 实体类
-     * @return Response对象
-     */
-    @RequestMapping(value = "update", method = RequestMethod.POST)
-    @ApiOperation(value = "查询设施配置列表")
-    public AjaxMessage<Integer> update(@ApiParam(value = "设置配置", required = true) @RequestBody User user) {
-        int result = userService.update(user);
-        return new AjaxMessage<>(ResultStatus.OK, result);
-
-    }
-
-    /**
-     * 删除一条数据
-     *
-     * @param user 参数对象
-     * @return Response对象
-     */
-    @RequestMapping(value = "delete", method = RequestMethod.POST)
-    @ApiOperation(value = "查询设施配置列表")
-    public AjaxMessage<Integer> delete(@ApiParam(value = "设置配置", required = true) @RequestBody User user) {
-        int result = userService.deleteById(user.getId());
-        return new AjaxMessage<>(ResultStatus.OK, result);
-    }
-
-
-    /**
-     * 分页查询
-     *
-     * @param pageNum  偏移
-     * @param pageSize 条数
-     * @return Response对象
-     */
-    @RequestMapping(value = "selectPage", method = RequestMethod.POST)
-    @ApiOperation(value = "查询设施配置列表")
-    public AjaxMessage<Pagination<User>> selectPage(Integer pageNum, Integer pageSize) {
-        User user = new User();
-        IPage<User> iPage = new Page<>(pageNum, pageSize);
-        iPage = userService.selectPage(user, iPage);
-        Pagination<User> pages = new Pagination<>(iPage);
-        return new AjaxMessage<>(ResultStatus.OK, pages);
-    }
-
     /**
     /**
      * 登录
      * 登录
      *
      *
@@ -166,4 +93,13 @@ public class UserController {
     {
     {
         return principal;
         return principal;
     }
     }
+
+
+    @GetMapping("/logininfo")
+    @CrossOrigin(allowCredentials = "true")
+    @ApiOperation(value = "用户需要信息")
+    public AjaxMessage logininfo(String mobile, String smsCode) {
+        String info="登录调用接口地址:/user-auth/user/smsCodeLogin";
+        return new AjaxMessage<>(ResultStatus.OK,info);
+    }
 }
 }

+ 3 - 3
user_auth/src/main/resources/application-dev.properties

@@ -1,7 +1,7 @@
 server.port=8321
 server.port=8321
-spring.application.name=smart-city-v2-user
+spring.application.name=user-auth
 logging.level.root=info
 logging.level.root=info
-logging.path=D:/logs/smart-city-v2-user
+logging.path=./logs/user-auth
 #\u6570\u636E\u5E93\u914D\u7F6E
 #\u6570\u636E\u5E93\u914D\u7F6E
 spring.datasource.url=jdbc:mysql://10.0.0.161:3306/uims?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull
 spring.datasource.url=jdbc:mysql://10.0.0.161:3306/uims?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull
 spring.datasource.username=root
 spring.datasource.username=root
@@ -20,7 +20,7 @@ spring.jackson.time-zone=GMT+8
 spring.redis.host=114.135.61.188
 spring.redis.host=114.135.61.188
 spring.redis.port=26379
 spring.redis.port=26379
 spring.redis.password=zoniot
 spring.redis.password=zoniot
-spring.redis.database=13
+spring.redis.database=2
 spring.redis.timeout=36000
 spring.redis.timeout=36000
 
 
 # Lettuce
 # Lettuce

+ 1 - 1
user_auth/user_auth.iml

@@ -34,6 +34,7 @@
     <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.1.14" level="project" />
     <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.1.14" level="project" />
     <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.1" level="project" />
     <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.1" level="project" />
     <orderEntry type="library" name="Maven: javax.activation:activation:1.1.1" level="project" />
     <orderEntry type="library" name="Maven: javax.activation:activation:1.1.1" level="project" />
+    <orderEntry type="module" module-name="common" />
     <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:2.1.6.RELEASE" level="project" />
     <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:2.1.6.RELEASE" level="project" />
     <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.1.6.RELEASE" level="project" />
     <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.1.6.RELEASE" level="project" />
     <orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
     <orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
@@ -196,6 +197,5 @@
     <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-mapper-asl:1.9.13" level="project" />
     <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-mapper-asl:1.9.13" level="project" />
     <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-core-asl:1.9.13" level="project" />
     <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-core-asl:1.9.13" level="project" />
     <orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
     <orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
-    <orderEntry type="module" module-name="common" />
   </component>
   </component>
 </module>
 </module>

+ 6 - 0
user_center/pom.xml

@@ -20,6 +20,12 @@
            <groupId>com.huaxu</groupId>
            <groupId>com.huaxu</groupId>
            <artifactId>common</artifactId>
            <artifactId>common</artifactId>
            <version>1.0-SNAPSHOT</version>
            <version>1.0-SNAPSHOT</version>
+           <exclusions>
+               <exclusion>
+                   <groupId>org.springframework.security.oauth.boot</groupId>
+                   <artifactId>spring-security-oauth2-autoconfigure</artifactId>
+               </exclusion>
+           </exclusions>
        </dependency>
        </dependency>
        <dependency>
        <dependency>
            <groupId>com.alibaba</groupId>
            <groupId>com.alibaba</groupId>

+ 5 - 8
user_center/src/main/java/com/huaxu/controller/OrgController.java

@@ -12,10 +12,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import io.swagger.annotations.ApiParam;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
-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.RestController;
+import org.springframework.web.bind.annotation.*;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -42,9 +39,9 @@ public class OrgController {
      * @return 单条数据
      * @return 单条数据
      */
      */
     @RequestMapping(value = "get", method = RequestMethod.POST)
     @RequestMapping(value = "get", method = RequestMethod.POST)
-    @ApiOperation(value = "查询设施配置列表")
+    @ApiOperation(value = "查询机构列表")
     public AjaxMessage<Org> selectOne(
     public AjaxMessage<Org> selectOne(
-            @ApiParam(value = "设置配置", required = true) Integer id) {
+            @ApiParam(value = "设置配置", required = true)@RequestParam Integer id) {
         Org org=new Org();
         Org org=new Org();
         org.setId(id);
         org.setId(id);
         Org result = orgService.selectById(org.getId());
         Org result = orgService.selectById(org.getId());
@@ -59,7 +56,7 @@ public class OrgController {
      * @return Response对象
      * @return Response对象
      */
      */
     @RequestMapping(value = "insert", method = RequestMethod.POST)
     @RequestMapping(value = "insert", method = RequestMethod.POST)
-    @ApiOperation(value = "查询设施配置列表")
+    @ApiOperation(value = "插入机构")
     public AjaxMessage<Integer> insert(@ApiParam(value = "设置配置", required = true) @RequestBody Org org) {
     public AjaxMessage<Integer> insert(@ApiParam(value = "设置配置", required = true) @RequestBody Org org) {
 
 
         int result = orgService.insert(org);
         int result = orgService.insert(org);
@@ -74,7 +71,7 @@ public class OrgController {
      * @return Response对象
      * @return Response对象
      */
      */
     @RequestMapping(value = "update", method = RequestMethod.POST)
     @RequestMapping(value = "update", method = RequestMethod.POST)
-    @ApiOperation(value = "查询设施配置列表")
+    @ApiOperation(value = "更改机构/删除机构",notes = "将状态设为1即为删除")
     public AjaxMessage<Integer> update(@ApiParam(value = "设置配置", required = true) @RequestBody Org org) {
     public AjaxMessage<Integer> update(@ApiParam(value = "设置配置", required = true) @RequestBody Org org) {
         int result = orgService.update(org);
         int result = orgService.update(org);
         if(result==-1){
         if(result==-1){

+ 6 - 8
user_center/src/main/java/com/huaxu/controller/RoleController.java

@@ -15,10 +15,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import io.swagger.annotations.ApiParam;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
-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.RestController;
+import org.springframework.web.bind.annotation.*;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -41,14 +38,15 @@ public class RoleController {
     /**
     /**
      * 通过主键查询单条数据
      * 通过主键查询单条数据
      *
      *
-     * @param role 参数对象
+     * @param id 参数对象
      * @return 单条数据
      * @return 单条数据
      */
      */
     @RequestMapping(value = "get", method = RequestMethod.POST)
     @RequestMapping(value = "get", method = RequestMethod.POST)
     @ApiOperation(value = "查询角色")
     @ApiOperation(value = "查询角色")
     public AjaxMessage<Role> selectOne(
     public AjaxMessage<Role> selectOne(
-            @ApiParam(value = "设置配置", required = true) @RequestBody Role role) {
-        Role result = roleService.selectById(role.getId());
+            @ApiParam(value = "角色id", required = true)@RequestParam Integer id) {
+
+        Role result = roleService.selectById(id);
 
 
         return new AjaxMessage<>(ResultStatus.OK, result);
         return new AjaxMessage<>(ResultStatus.OK, result);
     }
     }
@@ -74,7 +72,7 @@ public class RoleController {
      * @return Response对象
      * @return Response对象
      */
      */
     @RequestMapping(value = "update", method = RequestMethod.POST)
     @RequestMapping(value = "update", method = RequestMethod.POST)
-    @ApiOperation(value = "更新/删除角色")
+    @ApiOperation(value = "更新/删除角色",notes = "将状态设为1即为删除")
     public AjaxMessage<Integer> update(@ApiParam(value = "设置配置", required = true) @RequestBody RoleRequestDto role) {
     public AjaxMessage<Integer> update(@ApiParam(value = "设置配置", required = true) @RequestBody RoleRequestDto role) {
         int result = roleService.update(role);
         int result = roleService.update(role);
         if(result==-1){
         if(result==-1){

+ 5 - 8
user_center/src/main/java/com/huaxu/controller/UserGroupController.java

@@ -13,10 +13,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import io.swagger.annotations.ApiParam;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
-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.RestController;
+import org.springframework.web.bind.annotation.*;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -39,14 +36,14 @@ public class UserGroupController {
     /**
     /**
      * 通过主键查询单条数据
      * 通过主键查询单条数据
      *
      *
-     * @param userGroup 参数对象
+     * @param id 参数对象
      * @return 单条数据
      * @return 单条数据
      */
      */
     @RequestMapping(value = "get", method = RequestMethod.POST)
     @RequestMapping(value = "get", method = RequestMethod.POST)
     @ApiOperation(value = "查询用户组")
     @ApiOperation(value = "查询用户组")
     public AjaxMessage<UserGroup> selectOne(
     public AjaxMessage<UserGroup> selectOne(
-            @ApiParam(value = "设置配置", required = true) @RequestBody UserGroup userGroup) {
-        UserGroup result = userGroupService.selectById(userGroup.getId());
+            @ApiParam(value = "设置配置", required = true)@RequestParam Integer id) {
+        UserGroup result = userGroupService.selectById(id);
 
 
         return new AjaxMessage<>(ResultStatus.OK, result);
         return new AjaxMessage<>(ResultStatus.OK, result);
     }
     }
@@ -72,7 +69,7 @@ public class UserGroupController {
      * @return Response对象
      * @return Response对象
      */
      */
     @RequestMapping(value = "update", method = RequestMethod.POST)
     @RequestMapping(value = "update", method = RequestMethod.POST)
-    @ApiOperation(value = "更新/删除用户组")
+    @ApiOperation(value = "更新/删除用户组",notes = "将状态设为1即为删除")
     public AjaxMessage<Integer> update(@ApiParam(value = "设置配置", required = true) @RequestBody UserGroup userGroup) {
     public AjaxMessage<Integer> update(@ApiParam(value = "设置配置", required = true) @RequestBody UserGroup userGroup) {
         int result = userGroupService.update(userGroup);
         int result = userGroupService.update(userGroup);
         if(result==-1){
         if(result==-1){

+ 3 - 3
user_center/src/main/resources/application-dev.properties

@@ -1,7 +1,7 @@
 server.port=8322
 server.port=8322
-spring.application.name=smart-city-v2-user
+spring.application.name=user-center
 logging.level.root=info
 logging.level.root=info
-logging.path=D:/logs/smart-city-v2-user
+logging.path=./logs/user-center
 #\u6570\u636E\u5E93\u914D\u7F6E
 #\u6570\u636E\u5E93\u914D\u7F6E
 spring.datasource.url=jdbc:mysql://114.135.61.188:33306/uims?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull
 spring.datasource.url=jdbc:mysql://114.135.61.188:33306/uims?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull
 spring.datasource.username=root
 spring.datasource.username=root
@@ -21,7 +21,7 @@ spring.jackson.time-zone=GMT+8
 spring.redis.host=114.135.61.188
 spring.redis.host=114.135.61.188
 spring.redis.port=26379
 spring.redis.port=26379
 spring.redis.password=zoniot
 spring.redis.password=zoniot
-spring.redis.database=13
+spring.redis.database=2
 spring.redis.timeout=36000
 spring.redis.timeout=36000
 
 
 # Lettuce
 # Lettuce