Commit bde8517c by zzrdark

1.修改项目结构

2.登陆
3.等等
parent a8972fd1
...@@ -10,12 +10,13 @@ ...@@ -10,12 +10,13 @@
<module name="cneeds-server-datashow" /> <module name="cneeds-server-datashow" />
<module name="cneeds-common-utils" /> <module name="cneeds-common-utils" />
<module name="cneeds-common-data" /> <module name="cneeds-common-data" />
<module name="cneeds-server-logupload" />
<module name="cneeds-server-eureka" /> <module name="cneeds-server-eureka" />
<module name="cneeds-common-pojo" />
<module name="cneeds-server-device_activate" /> <module name="cneeds-server-device_activate" />
<module name="cneeds-server-authorization" />
<module name="cneeds-server-user" /> <module name="cneeds-server-user" />
<module name="cneeds-server-logupload" />
<module name="cneeds-server-device" /> <module name="cneeds-server-device" />
<module name="cneeds-server-authorization" />
</profile> </profile>
</annotationProcessing> </annotationProcessing>
<bytecodeTargetLevel> <bytecodeTargetLevel>
...@@ -27,6 +28,7 @@ ...@@ -27,6 +28,7 @@
<component name="JavacSettings"> <component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE"> <option name="ADDITIONAL_OPTIONS_OVERRIDE">
<module name="cneeds-common-data" options="-parameters" /> <module name="cneeds-common-data" options="-parameters" />
<module name="cneeds-common-pojo" options="-parameters" />
<module name="cneeds-common-utils" options="-parameters" /> <module name="cneeds-common-utils" options="-parameters" />
<module name="cneeds-server-advice-control" options="-parameters" /> <module name="cneeds-server-advice-control" options="-parameters" />
<module name="cneeds-server-authorization" options="-parameters" /> <module name="cneeds-server-authorization" options="-parameters" />
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<file url="file://$PROJECT_DIR$" charset="UTF-8" /> <file url="file://$PROJECT_DIR$" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/cneeds-common-data" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/cneeds-common-data" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/cneeds-common-data/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/cneeds-common-data/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/cneeds-common-pojo/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/cneeds-common-utils" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/cneeds-common-utils" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/cneeds-common-utils/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/cneeds-common-utils/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/cneeds-server-authorization/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/cneeds-server-authorization/src/main/java" charset="UTF-8" />
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<option name="ignoredFiles"> <option name="ignoredFiles">
<set> <set>
<option value="$PROJECT_DIR$/cneeds-server-advice-control/pom.xml" /> <option value="$PROJECT_DIR$/cneeds-server-advice-control/pom.xml" />
<option value="$PROJECT_DIR$/cneeds-server-pojo/pom.xml" />
</set> </set>
</option> </option>
</component> </component>
......
...@@ -47,11 +47,11 @@ ...@@ -47,11 +47,11 @@
<artifactId>spring-boot-starter-jdbc</artifactId> <artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>--> </dependency>-->
<dependency> <!--<dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId> <artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.version}</version> <version>${druid.version}</version>
</dependency> </dependency>-->
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>cneeds-server</artifactId>
<groupId>com.mx.cneeds</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>cneeds-common-pojo</artifactId>
<!--<dependencies>
<dependency>
<groupId>com.mx.cneeds</groupId>
<artifactId>cneeds-common-utils</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>-->
</project>
\ No newline at end of file
package com.mx.cneeds.common.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @ClassName JwtToken
* @Author zzrdark
* @Date 2020-03-04 17:35
* @Description TODO
**/
@Data
public class JwtToken implements Serializable {
@JsonProperty("access_token")
private String accessToken;
@JsonProperty("token_type")
private String tokenType;
@JsonProperty("expires_in")
private String expiresIn;
private String scope;
private String jti;
}
package com.mx.cneeds.server.vo; package com.mx.cneeds.common.vo;
import lombok.Data; import lombok.Data;
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
<mybatisplus.version>3.1.2</mybatisplus.version> <mybatisplus.version>3.1.2</mybatisplus.version>
<commons.lang.version>2.6</commons.lang.version> <commons.lang.version>2.6</commons.lang.version>
<commons.io.version>2.5</commons.io.version> <commons.io.version>2.5</commons.io.version>
<swagger.version>2.7.0</swagger.version>
</properties> </properties>
<dependencies> <dependencies>
...@@ -24,6 +23,7 @@ ...@@ -24,6 +23,7 @@
<groupId>com.baomidou</groupId> <groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId> <artifactId>mybatis-plus-boot-starter</artifactId>
<version>${mybatisplus.version}</version> <version>${mybatisplus.version}</version>
<scope>provided</scope>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>com.baomidou</groupId> <groupId>com.baomidou</groupId>
...@@ -42,15 +42,6 @@ ...@@ -42,15 +42,6 @@
<artifactId>commons-io</artifactId> <artifactId>commons-io</artifactId>
<version>${commons.io.version}</version> <version>${commons.io.version}</version>
</dependency> </dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.version}</version>
</dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
FROM hub.c.163.com/library/java:8-alpine
MAINTAINER XXX XXX@imooc.com
ADD target/*.jar app.jar
# ADD *.jar app.jar
EXPOSE 8761
ENTRYPOINT ["java", "-jar", "/app.jar"]
\ No newline at end of file
#!/usr/bin/env bash
mvn clean package -Dmaven.test.skip=true -U
#docker build -t hub.c.163.com/springcloud/eureka .
#docker push hub.c.163.com/springcloud/eureka
docker build -t zzrdark/eureka .
docker push zzrdark/eureka
# docker build -t 192.168.2.244:5000/eureka .
# docker push 192.168.2.244:5000/eureka
\ No newline at end of file
...@@ -8,11 +8,18 @@ ...@@ -8,11 +8,18 @@
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>cneeds-server-authorization</artifactId> <artifactId>cneeds-server-authorization</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<dependencies> <dependencies>
<!-- eureka-client -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<!-- for Spring Security --> <!-- for Spring Security -->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
......
...@@ -2,6 +2,7 @@ package com.mx.cneeds.server.anthorization; ...@@ -2,6 +2,7 @@ package com.mx.cneeds.server.anthorization;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
/** /**
* @ClassName AuthorizaitonApplication * @ClassName AuthorizaitonApplication
...@@ -10,6 +11,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; ...@@ -10,6 +11,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
* @Description TODO * @Description TODO
**/ **/
@SpringBootApplication @SpringBootApplication
@EnableEurekaClient
public class AuthorizaitonApplication { public class AuthorizaitonApplication {
public static void main(String[] args) { public static void main(String[] args) {
......
package com.mx.cneeds.server.anthorization.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
@Configuration
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Bean
@Override
public AuthenticationManager authenticationManagerBean() throws Exception {
AuthenticationManager manager = super.authenticationManagerBean();
return manager;
}
@Bean
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
@Override
protected void configure(HttpSecurity http) throws Exception {
/*http
.formLogin().and()
.authorizeRequests()
.anyRequest()
.permitAll()
.and()
.csrf().disable();*/
http.formLogin().disable();
}
}
\ No newline at end of file
server.port=8081 server.port=8861
server.servlet.context-path=/server server.servlet.context-path=/
spring.application.name= cneeds-server-authorization spring.application.name= cneeds-server-authorization
eureka.client.service-url.defaultZone= http://192.168.2.244:8761/eureka/
eureka.instance.prefer-ip-address=true
\ No newline at end of file
FROM hub.c.163.com/library/java:8-alpine
MAINTAINER XXX XXX@imooc.com
ADD target/*.jar app.jar
# ADD *.jar app.jar
EXPOSE 8761
ENTRYPOINT ["java", "-jar", "/app.jar"]
\ No newline at end of file
#!/usr/bin/env bash
mvn clean package -Dmaven.test.skip=true -U
#docker build -t hub.c.163.com/springcloud/eureka .
#docker push hub.c.163.com/springcloud/eureka
docker build -t zzrdark/eureka .
docker push zzrdark/eureka
# docker build -t 192.168.2.244:5000/eureka .
# docker push 192.168.2.244:5000/eureka
\ No newline at end of file
...@@ -12,18 +12,20 @@ ...@@ -12,18 +12,20 @@
<artifactId>cneeds-server-datashow</artifactId> <artifactId>cneeds-server-datashow</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency> </dependency>
<dependency> <!--<dependency>
<groupId>com.mx.cneeds</groupId> <groupId>com.mx.cneeds</groupId>
<artifactId>cneeds-common-data</artifactId> <artifactId>cneeds-common-utils</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</dependency> </dependency>-->
<dependency> <dependency>
<groupId>com.mx.cneeds</groupId> <groupId>com.mx.cneeds</groupId>
<artifactId>cneeds-common-utils</artifactId> <artifactId>cneeds-common-pojo</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</dependency> </dependency>
......
package com.mx.cneeds.common.converter;
import javax.xml.bind.DatatypeConverter;
/**
* @ClassName RequestParamterConverter
* @Author zzrdark
* @Date 2020-03-04 17:54
* @Description TODO
**/
public class RequestParamterConverter {
public static String authorizationConverter(String username, String password){
StringBuilder sb = new StringBuilder();
sb.append(username+":");
sb.append(password);
String encoding = DatatypeConverter.printBase64Binary(sb.toString().getBytes());
sb = new StringBuilder();
sb.append("Basic ");
sb.append(encoding);
return sb.toString();
}
public static void main(String[] args) {
System.out.println(authorizationConverter("clientapp", "112233"));
}
}
...@@ -3,6 +3,7 @@ package com.mx.cneeds.server.datashow; ...@@ -3,6 +3,7 @@ package com.mx.cneeds.server.datashow;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient; import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import springfox.documentation.swagger2.annotations.EnableSwagger2; import springfox.documentation.swagger2.annotations.EnableSwagger2;
/** /**
...@@ -14,8 +15,10 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2; ...@@ -14,8 +15,10 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@SpringBootApplication @SpringBootApplication
@EnableEurekaClient @EnableEurekaClient
@EnableSwagger2 @EnableSwagger2
@EnableFeignClients
public class DatashowApplication { public class DatashowApplication {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(DatashowApplication.class); SpringApplication.run(DatashowApplication.class);
} }
} }
package com.mx.cneeds.server.datashow.client;
import com.mx.cneeds.common.dto.JwtToken;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* @ClassName authorizationClient
* @Author zzrdark
* @Date 2020-03-04 17:33
* @Description TODO
**/
@FeignClient(name = "CNEEDS-SERVER-AUTHORIZATION")
public interface AuthorizationClient {
@PostMapping("/oauth/token")
JwtToken getToken(@RequestParam("grant_type") String grant_type,
@RequestParam("username") String username,
@RequestParam("password") String password,
@RequestParam("scope") String scope);
}
package com.mx.cneeds.server.datashow.config;
import com.mx.cneeds.common.converter.RequestParamterConverter;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
/**
* @ClassName FeignConfig
* @Author zzrdark
* @Date 2020-03-04 17:26
* @Description TODO
**/
@Configuration
@Slf4j
public class FeignConfig implements RequestInterceptor {
@Override
public void apply(RequestTemplate requestTemplate) {
//只支持 servlet
ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
if(requestAttributes == null){
return;
}
HttpServletRequest request = requestAttributes.getRequest();
if (request.getRequestURL().toString().contains("/user/login")){
String authString = RequestParamterConverter.authorizationConverter("clientapp","112233");
requestTemplate.header("Authorization",authString);
System.out.println(authString);
}
}
}
package com.mx.cneeds.server.datashow.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer;
import org.springframework.security.oauth2.provider.token.TokenStore;
import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter;
import org.springframework.security.oauth2.provider.token.store.JwtTokenStore;
// 资源服务配置
@Configuration
@EnableResourceServer
public class OAuth2ResourceServer extends ResourceServerConfigurerAdapter {
@Override
public void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.antMatchers("/user/login")
.permitAll()
// 开启认证
.anyRequest()
.authenticated()
.and();
}
@Override
public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
resources.stateless(true);
resources.tokenStore(jwtTokenStore());
}
@Bean
public TokenStore jwtTokenStore() {
return new JwtTokenStore(jwtAccessTokenConverter());
}
@Bean
public JwtAccessTokenConverter jwtAccessTokenConverter(){
JwtAccessTokenConverter converter = new JwtAccessTokenConverter();
// 对JWT进行前面的key
converter.setSigningKey("imooc");
return converter;
}
}
\ No newline at end of file
package com.mx.cneeds.server.datashow.web.user;
import com.mx.cneeds.server.datashow.client.AuthorizationClient;
import com.mx.cneeds.common.dto.JwtToken;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.logging.Logger;
/**
* @ClassName UserController
* @Author zzrdark
* @Date 2020-03-04 18:09
* @Description TODO
**/
@RestController
@Slf4j
@RequestMapping("/user")
public class UserController {
@Autowired
private AuthorizationClient authenticatorClient;
@GetMapping("/login")
public JwtToken login(String username, String password){
JwtToken token = authenticatorClient.getToken("password", username, password, "all");
log.info(token.toString());
return token;
}
}
spring: eureka:
datasource: client:
hikari: service-url:
driver-class-name: com.mysql.cj.jdbc.Driver defaultZone: http://192.168.2.244:8761/eureka/
jdbc-url: jdbc:mysql://192.168.2.244:3306/cneeds_server?useUnicode=true&characterEncoding=UTF-8 instance:
username: root prefer-ip-address: true
password: cneeds!QAZ1qaz
spring: spring:
profiles: profiles:
active: dev active: dev
application:
name: cneeds-server-datashow
server:
port: 9000
servlet:
context-path: /
\ No newline at end of file
package com.mx.cneeds.server.service.device; package com.mx.cneeds.server.device.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.common.pager.PageUtils; import com.mx.cneeds.common.pager.PageUtils;
......
package com.mx.cneeds.server.service.device; package com.mx.cneeds.server.device.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.common.pager.PageUtils; import com.mx.cneeds.common.pager.PageUtils;
......
package com.mx.cneeds.server.service.device; package com.mx.cneeds.server.device.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.common.pager.PageUtils; import com.mx.cneeds.common.pager.PageUtils;
......
package com.mx.cneeds.server.service.device; package com.mx.cneeds.server.device.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.common.pager.PageUtils; import com.mx.cneeds.common.pager.PageUtils;
......
...@@ -3,7 +3,7 @@ package com.mx.cneeds.server.device.service.impl; ...@@ -3,7 +3,7 @@ package com.mx.cneeds.server.device.service.impl;
import com.mx.cneeds.common.pager.PageUtils; import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.pager.Query; import com.mx.cneeds.common.pager.Query;
import com.mx.cneeds.server.dao.DeviceInfoDao; import com.mx.cneeds.server.dao.DeviceInfoDao;
import com.mx.cneeds.server.service.device.DeviceInfoService; import com.mx.cneeds.server.device.service.DeviceInfoService;
import com.mx.cneeds.server.entity.DeviceInfoEntity; import com.mx.cneeds.server.entity.DeviceInfoEntity;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Map; import java.util.Map;
......
...@@ -3,7 +3,7 @@ package com.mx.cneeds.server.device.service.impl; ...@@ -3,7 +3,7 @@ package com.mx.cneeds.server.device.service.impl;
import com.mx.cneeds.common.pager.PageUtils; import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.pager.Query; import com.mx.cneeds.common.pager.Query;
import com.mx.cneeds.server.dao.DeviceLogDao; import com.mx.cneeds.server.dao.DeviceLogDao;
import com.mx.cneeds.server.service.device.DeviceLogService; import com.mx.cneeds.server.device.service.DeviceLogService;
import com.mx.cneeds.server.entity.DeviceLogEntity; import com.mx.cneeds.server.entity.DeviceLogEntity;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Map; import java.util.Map;
......
...@@ -3,7 +3,7 @@ package com.mx.cneeds.server.device.service.impl; ...@@ -3,7 +3,7 @@ package com.mx.cneeds.server.device.service.impl;
import com.mx.cneeds.common.pager.PageUtils; import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.pager.Query; import com.mx.cneeds.common.pager.Query;
import com.mx.cneeds.server.dao.DeviceLogmediaDao; import com.mx.cneeds.server.dao.DeviceLogmediaDao;
import com.mx.cneeds.server.service.device.DeviceLogmediaService; import com.mx.cneeds.server.device.service.DeviceLogmediaService;
import com.mx.cneeds.server.entity.DeviceLogmediaEntity; import com.mx.cneeds.server.entity.DeviceLogmediaEntity;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Map; import java.util.Map;
......
...@@ -3,7 +3,7 @@ package com.mx.cneeds.server.device.service.impl; ...@@ -3,7 +3,7 @@ package com.mx.cneeds.server.device.service.impl;
import com.mx.cneeds.common.pager.PageUtils; import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.pager.Query; import com.mx.cneeds.common.pager.Query;
import com.mx.cneeds.server.dao.DeviceLogsettingDao; import com.mx.cneeds.server.dao.DeviceLogsettingDao;
import com.mx.cneeds.server.service.device.DeviceLogsettingService; import com.mx.cneeds.server.device.service.DeviceLogsettingService;
import com.mx.cneeds.server.entity.DeviceLogsettingEntity; import com.mx.cneeds.server.entity.DeviceLogsettingEntity;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Map; import java.util.Map;
......
package com.mx.cneeds.server.datashow.web.device; package com.mx.cneeds.server.device.web;
import com.mx.cneeds.common.pager.PageUtils; import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.result.R; import com.mx.cneeds.common.result.R;
import com.mx.cneeds.common.validator.ValidatorUtils; import com.mx.cneeds.common.validator.ValidatorUtils;
import com.mx.cneeds.server.service.device.DeviceInfoService;
import com.mx.cneeds.server.entity.DeviceInfoEntity; import com.mx.cneeds.server.entity.DeviceInfoEntity;
import com.mx.cneeds.server.device.service.DeviceInfoService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
......
package com.mx.cneeds.server.datashow.web.device; package com.mx.cneeds.server.device.web;
import com.mx.cneeds.common.pager.PageUtils; import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.result.R; import com.mx.cneeds.common.result.R;
import com.mx.cneeds.common.validator.ValidatorUtils; import com.mx.cneeds.common.validator.ValidatorUtils;
import com.mx.cneeds.server.service.device.DeviceLogService;
import com.mx.cneeds.server.entity.DeviceLogEntity; import com.mx.cneeds.server.entity.DeviceLogEntity;
import com.mx.cneeds.server.device.service.DeviceLogService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
......
package com.mx.cneeds.server.datashow.web.device; package com.mx.cneeds.server.device.web;
import com.mx.cneeds.common.pager.PageUtils; import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.result.R; import com.mx.cneeds.common.result.R;
import com.mx.cneeds.common.validator.ValidatorUtils; import com.mx.cneeds.common.validator.ValidatorUtils;
import com.mx.cneeds.server.service.device.DeviceLogmediaService;
import com.mx.cneeds.server.entity.DeviceLogmediaEntity; import com.mx.cneeds.server.entity.DeviceLogmediaEntity;
import com.mx.cneeds.server.device.service.DeviceLogmediaService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
......
package com.mx.cneeds.server.datashow.web.device; package com.mx.cneeds.server.device.web;
import com.mx.cneeds.common.pager.PageUtils; import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.result.R; import com.mx.cneeds.common.result.R;
import com.mx.cneeds.common.validator.ValidatorUtils; import com.mx.cneeds.common.validator.ValidatorUtils;
import com.mx.cneeds.server.service.device.DeviceLogsettingService;
import com.mx.cneeds.server.entity.DeviceLogsettingEntity; import com.mx.cneeds.server.entity.DeviceLogsettingEntity;
import com.mx.cneeds.server.device.service.DeviceLogsettingService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
......
...@@ -24,14 +24,14 @@ ...@@ -24,14 +24,14 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.mx.cneeds</groupId> <groupId>com.mx.cneeds</groupId>
<artifactId>cneeds-common-data</artifactId> <artifactId>cneeds-common-pojo</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>com.mx.cneeds</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>cneeds-common-data</artifactId>
<version>${mysql.version}</version> <version>1.0-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
......
package com.mx.cneeds.server.service.user; package com.mx.cneeds.server.user.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.common.pager.PageUtils; import com.mx.cneeds.common.pager.PageUtils;
......
package com.mx.cneeds.server.service.user; package com.mx.cneeds.server.user.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.common.pager.PageUtils; import com.mx.cneeds.common.pager.PageUtils;
......
package com.mx.cneeds.server.service.user; package com.mx.cneeds.server.user.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.common.pager.PageUtils; import com.mx.cneeds.common.pager.PageUtils;
......
package com.mx.cneeds.server.service.user; package com.mx.cneeds.server.user.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.common.pager.PageUtils; import com.mx.cneeds.common.pager.PageUtils;
......
package com.mx.cneeds.server.service.user; package com.mx.cneeds.server.user.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.common.pager.PageUtils; import com.mx.cneeds.common.pager.PageUtils;
......
package com.mx.cneeds.server.service.user; package com.mx.cneeds.server.user.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.common.pager.PageUtils; import com.mx.cneeds.common.pager.PageUtils;
......
package com.mx.cneeds.server.service.user; package com.mx.cneeds.server.user.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.common.pager.PageUtils; import com.mx.cneeds.common.pager.PageUtils;
......
...@@ -4,7 +4,7 @@ import com.mx.cneeds.common.pager.PageUtils; ...@@ -4,7 +4,7 @@ import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.pager.Query; import com.mx.cneeds.common.pager.Query;
import com.mx.cneeds.server.dao.SysDeptDao; import com.mx.cneeds.server.dao.SysDeptDao;
import com.mx.cneeds.server.entity.SysDeptEntity; import com.mx.cneeds.server.entity.SysDeptEntity;
import com.mx.cneeds.server.service.user.SysDeptService; import com.mx.cneeds.server.user.service.SysDeptService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Map; import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......
...@@ -4,7 +4,7 @@ import com.mx.cneeds.common.pager.PageUtils; ...@@ -4,7 +4,7 @@ import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.pager.Query; import com.mx.cneeds.common.pager.Query;
import com.mx.cneeds.server.dao.SysFuncDao; import com.mx.cneeds.server.dao.SysFuncDao;
import com.mx.cneeds.server.entity.SysFuncEntity; import com.mx.cneeds.server.entity.SysFuncEntity;
import com.mx.cneeds.server.service.user.SysFuncService; import com.mx.cneeds.server.user.service.SysFuncService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Map; import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......
...@@ -4,7 +4,7 @@ import com.mx.cneeds.common.pager.PageUtils; ...@@ -4,7 +4,7 @@ import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.pager.Query; import com.mx.cneeds.common.pager.Query;
import com.mx.cneeds.server.dao.SysRoleDeptDao; import com.mx.cneeds.server.dao.SysRoleDeptDao;
import com.mx.cneeds.server.entity.SysRoleDeptEntity; import com.mx.cneeds.server.entity.SysRoleDeptEntity;
import com.mx.cneeds.server.service.user.SysRoleDeptService; import com.mx.cneeds.server.user.service.SysRoleDeptService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Map; import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......
...@@ -4,7 +4,7 @@ import com.mx.cneeds.common.pager.PageUtils; ...@@ -4,7 +4,7 @@ import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.pager.Query; import com.mx.cneeds.common.pager.Query;
import com.mx.cneeds.server.dao.SysRoleFuncDao; import com.mx.cneeds.server.dao.SysRoleFuncDao;
import com.mx.cneeds.server.entity.SysRoleFuncEntity; import com.mx.cneeds.server.entity.SysRoleFuncEntity;
import com.mx.cneeds.server.service.user.SysRoleFuncService; import com.mx.cneeds.server.user.service.SysRoleFuncService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Map; import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......
...@@ -4,7 +4,7 @@ import com.mx.cneeds.common.pager.PageUtils; ...@@ -4,7 +4,7 @@ import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.pager.Query; import com.mx.cneeds.common.pager.Query;
import com.mx.cneeds.server.dao.SysRoleDao; import com.mx.cneeds.server.dao.SysRoleDao;
import com.mx.cneeds.server.entity.SysRoleEntity; import com.mx.cneeds.server.entity.SysRoleEntity;
import com.mx.cneeds.server.service.user.SysRoleService; import com.mx.cneeds.server.user.service.SysRoleService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Map; import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......
...@@ -4,7 +4,7 @@ import com.mx.cneeds.common.pager.PageUtils; ...@@ -4,7 +4,7 @@ import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.pager.Query; import com.mx.cneeds.common.pager.Query;
import com.mx.cneeds.server.dao.SysUserRoleDao; import com.mx.cneeds.server.dao.SysUserRoleDao;
import com.mx.cneeds.server.entity.SysUserRoleEntity; import com.mx.cneeds.server.entity.SysUserRoleEntity;
import com.mx.cneeds.server.service.user.SysUserRoleService; import com.mx.cneeds.server.user.service.SysUserRoleService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Map; import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......
...@@ -4,7 +4,7 @@ import com.mx.cneeds.common.pager.PageUtils; ...@@ -4,7 +4,7 @@ import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.pager.Query; import com.mx.cneeds.common.pager.Query;
import com.mx.cneeds.server.dao.SysUserDao; import com.mx.cneeds.server.dao.SysUserDao;
import com.mx.cneeds.server.entity.SysUserEntity; import com.mx.cneeds.server.entity.SysUserEntity;
import com.mx.cneeds.server.service.user.SysUserService; import com.mx.cneeds.server.user.service.SysUserService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Map; import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......
package com.mx.cneeds.server.datashow.web.user; package com.mx.cneeds.server.user.web;
import com.mx.cneeds.common.pager.PageUtils; import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.result.R; import com.mx.cneeds.common.result.R;
import com.mx.cneeds.common.validator.ValidatorUtils; import com.mx.cneeds.common.validator.ValidatorUtils;
import com.mx.cneeds.server.entity.SysDeptEntity; import com.mx.cneeds.server.entity.SysDeptEntity;
import com.mx.cneeds.server.service.user.SysDeptService; import com.mx.cneeds.server.user.service.SysDeptService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
......
package com.mx.cneeds.server.datashow.web.user; package com.mx.cneeds.server.user.web;
import com.mx.cneeds.common.pager.PageUtils; import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.result.R; import com.mx.cneeds.common.result.R;
import com.mx.cneeds.common.validator.ValidatorUtils; import com.mx.cneeds.common.validator.ValidatorUtils;
import com.mx.cneeds.server.entity.SysFuncEntity; import com.mx.cneeds.server.entity.SysFuncEntity;
import com.mx.cneeds.server.service.user.SysFuncService; import com.mx.cneeds.server.user.service.SysFuncService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
......
package com.mx.cneeds.server.datashow.web.user; package com.mx.cneeds.server.user.web;
import com.mx.cneeds.common.pager.PageUtils; import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.result.R; import com.mx.cneeds.common.result.R;
import com.mx.cneeds.common.validator.ValidatorUtils; import com.mx.cneeds.common.validator.ValidatorUtils;
import com.mx.cneeds.server.entity.SysRoleEntity; import com.mx.cneeds.server.entity.SysRoleEntity;
import com.mx.cneeds.server.service.user.SysRoleService; import com.mx.cneeds.server.user.service.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
......
package com.mx.cneeds.server.datashow.web.user; package com.mx.cneeds.server.user.web;
import com.mx.cneeds.common.pager.PageUtils; import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.result.R; import com.mx.cneeds.common.result.R;
import com.mx.cneeds.common.validator.ValidatorUtils; import com.mx.cneeds.common.validator.ValidatorUtils;
import com.mx.cneeds.server.entity.SysRoleDeptEntity; import com.mx.cneeds.server.entity.SysRoleDeptEntity;
import com.mx.cneeds.server.service.user.SysRoleDeptService; import com.mx.cneeds.server.user.service.SysRoleDeptService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
......
package com.mx.cneeds.server.datashow.web.user; package com.mx.cneeds.server.user.web;
import com.mx.cneeds.common.pager.PageUtils; import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.result.R; import com.mx.cneeds.common.result.R;
import com.mx.cneeds.common.validator.ValidatorUtils; import com.mx.cneeds.common.validator.ValidatorUtils;
import com.mx.cneeds.server.entity.SysRoleFuncEntity; import com.mx.cneeds.server.entity.SysRoleFuncEntity;
import com.mx.cneeds.server.service.user.SysRoleFuncService; import com.mx.cneeds.server.user.service.SysRoleFuncService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
......
package com.mx.cneeds.server.datashow.web.user; package com.mx.cneeds.server.user.web;
import com.mx.cneeds.common.pager.PageUtils; import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.result.R; import com.mx.cneeds.common.result.R;
import com.mx.cneeds.common.validator.ValidatorUtils; import com.mx.cneeds.common.validator.ValidatorUtils;
import com.mx.cneeds.common.vo.UserVo;
import com.mx.cneeds.server.entity.SysUserEntity; import com.mx.cneeds.server.entity.SysUserEntity;
import com.mx.cneeds.server.service.user.SysUserService; import com.mx.cneeds.server.user.service.SysUserService;
import com.mx.cneeds.server.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
......
package com.mx.cneeds.server.datashow.web.user; package com.mx.cneeds.server.user.web;
import com.mx.cneeds.common.pager.PageUtils; import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.result.R; import com.mx.cneeds.common.result.R;
import com.mx.cneeds.common.validator.ValidatorUtils; import com.mx.cneeds.common.validator.ValidatorUtils;
import com.mx.cneeds.server.entity.SysUserRoleEntity; import com.mx.cneeds.server.entity.SysUserRoleEntity;
import com.mx.cneeds.server.service.user.SysUserRoleService; import com.mx.cneeds.server.user.service.SysUserRoleService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
......
...@@ -2,43 +2,57 @@ spring: ...@@ -2,43 +2,57 @@ spring:
application: application:
name: cneeds-server-user name: cneeds-server-user
datasource: datasource:
type: com.alibaba.druid.pool.DruidDataSource
druid:
driver-class-name: com.mysql.jdbc.Driver driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://192.168.2.244:3306/cneeds_server?useUnicode=true&characterEncoding=UTF-8&useSSL=false url: jdbc:mysql://192.168.2.244:3306/cneeds_server?useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root
password: cneeds!QAZ1qaz password: cneeds!QAZ1qaz
initial-size: 10 username: root
max-active: 100 # hikari:
min-idle: 10 # driver-class-name: com.mysql.jdbc.Driver
max-wait: 60000 # url: jdbc:mysql://192.168.2.244:3306/cneeds_server?useUnicode=true&characterEncoding=UTF-8&useSSL=false
pool-prepared-statements: true # username: root
max-pool-prepared-statement-per-connection-size: 20 # password: cneeds!QAZ1qaz
time-between-eviction-runs-millis: 60000 # datasource:
min-evictable-idle-time-millis: 300000 # type: com.alibaba.druid.pool.DruidDataSource
#Oracle需要打开注释 # druid:
#validation-query: SELECT 1 FROM DUAL # driver-class-name: com.mysql.jdbc.Driver
test-while-idle: true # url: jdbc:mysql://192.168.2.244:3306/cneeds_server?useUnicode=true&characterEncoding=UTF-8&useSSL=false
test-on-borrow: false # username: root
test-on-return: false # password: cneeds!QAZ1qaz
stat-view-servlet: # initial-size: 10
enabled: true # max-active: 100
url-pattern: /druid/* # min-idle: 10
#login-username: admin # max-wait: 60000
#login-password: admin # pool-prepared-statements: true
filter: # max-pool-prepared-statement-per-connection-size: 20
stat: # time-between-eviction-runs-millis: 60000
log-slow-sql: true # min-evictable-idle-time-millis: 300000
slow-sql-millis: 1000 # #Oracle需要打开注释
merge-sql: false # #validation-query: SELECT 1 FROM DUAL
wall: # test-while-idle: true
config: # test-on-borrow: false
multi-statement-allow: true # test-on-return: false
# stat-view-servlet:
# enabled: true
# url-pattern: /druid/*
# #login-username: admin
# #login-password: admin
# filter:
# stat:
# log-slow-sql: true
# slow-sql-millis: 1000
# merge-sql: false
# wall:
# config:
# multi-statement-allow: true
eureka: eureka:
client: client:
service-url: service-url:
defaultZone: http://192.168.2.244:8761/eureka/ defaultZone: http://192.168.2.244:8761/eureka/
instance:
prefer-ip-address: true
server: server:
port: 9999 port: 9001
servlet:
context-path: /
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<module>cneeds-common-data</module> <module>cneeds-common-data</module>
<module>cneeds-common-utils</module> <module>cneeds-common-utils</module>
<module>cneeds-server-authorization</module> <module>cneeds-server-authorization</module>
<module>cneeds-common-pojo</module>
</modules> </modules>
<properties> <properties>
...@@ -29,6 +30,7 @@ ...@@ -29,6 +30,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<spring-cloud.version>Finchley.SR2</spring-cloud.version> <spring-cloud.version>Finchley.SR2</spring-cloud.version>
<swagger.version>2.7.0</swagger.version>
</properties> </properties>
<dependencyManagement> <dependencyManagement>
...@@ -58,6 +60,22 @@ ...@@ -58,6 +60,22 @@
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.version}</version>
</dependency>
</dependencies> </dependencies>
......
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