Commit a8972fd1 by zzrdark

1.修改项目结构

2.更改数据库连接
3.增加测试docker部署
parent dd03c0e1
......@@ -2,21 +2,25 @@
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile default="true" name="Default" enabled="true" />
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="cneeds-server-advice_control" />
<module name="cneeds-common-utils" />
<module name="cneeds-server-datashow" />
<module name="cneeds-server-logupload" />
<module name="cneeds-common-utils" />
<module name="cneeds-common-data" />
<module name="cneeds-server-logupload" />
<module name="cneeds-server-eureka" />
<module name="cneeds-server-device_activate" />
<module name="cneeds-server-user" />
<module name="cneeds-server-device" />
<module name="cneeds-server-authorization" />
</profile>
</annotationProcessing>
<bytecodeTargetLevel>
<module name="cneeds-server-advice-control" target="1.8" />
<module name="cneeds-server.device_activate" target="1.8" />
<module name="cneedsservereureka" target="1.5" />
</bytecodeTargetLevel>
</component>
......@@ -24,13 +28,15 @@
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
<module name="cneeds-common-data" 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-datashow" options="-parameters" />
<module name="cneeds-server-device" options="-parameters" />
<module name="cneeds-server-device_activate" options="-parameters" />
<module name="cneeds-server-eureka" options="-parameters" />
<module name="cneeds-server-logupload" options="-parameters" />
<module name="cneeds-server-user" options="-parameters" />
<module name="cneeds-server.device_activate" options="-parameters" />
</option>
</component>
</project>
\ No newline at end of file
......@@ -3,13 +3,20 @@
<component name="Encoding">
<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/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/cneeds-common-utils" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/cneeds-server-advice_control" 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-datashow" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/cneeds-server-datashow/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/cneeds-server-device" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/cneeds-server-device_activate" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/cneeds-server-device/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/cneeds-server-eureka" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/cneeds-server-eureka/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/cneeds-server-eureka/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/cneeds-server-logupload" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/cneeds-server-logupload/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/cneeds-server-user" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/cneeds-server-user/src/main/java" charset="UTF-8" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
......@@ -8,6 +11,11 @@
<option value="$PROJECT_DIR$/cneeds-server-advice_control/pom.xml" />
</list>
</option>
<option name="ignoredFiles">
<set>
<option value="$PROJECT_DIR$/cneeds-server-advice-control/pom.xml" />
</set>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
......
......@@ -10,13 +10,14 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>cneeds-common-data</artifactId>
<packaging>jar</packaging>
<properties>
<mybatis.spring.boot.version>1.3.0</mybatis.spring.boot.version>
<pagehelper.spring.boot.version>1.2.5</pagehelper.spring.boot.version>
<mysql.version>8.0.16</mysql.version>
<mybatisplus.version>3.1.2</mybatisplus.version>
<druid.version>1.1.13</druid.version>
</properties>
<dependencies>
......@@ -41,11 +42,28 @@
</exclusion>
</exclusions>
</dependency>
<!--<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
</dependency>
<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
......@@ -56,5 +56,19 @@ public class DeviceInfoEntity implements Serializable {
* 激活时间
*/
private Date activeTime;
/**
* 渠道商号
* 分隔符","
*/
public String channelNums;
/**
* 渠道号提示信息
*/
public String channelNumsMessage;
/**
* 0黑名单
* 1白名单
*/
public Integer channelRules;
}
package com.mx.cneeds.server.device.service;
package com.mx.cneeds.server.service.device;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.common.pager.PageUtils;
......
package com.mx.cneeds.server.device.service;
package com.mx.cneeds.server.service.device;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.common.pager.PageUtils;
......
package com.mx.cneeds.server.device.service;
package com.mx.cneeds.server.service.device;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.common.pager.PageUtils;
......
package com.mx.cneeds.server.device.service;
package com.mx.cneeds.server.service.device;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.common.pager.PageUtils;
......
package com.mx.cneeds.server.user.service;
package com.mx.cneeds.server.service.user;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.common.pager.PageUtils;
......
package com.mx.cneeds.server.user.service;
package com.mx.cneeds.server.service.user;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.common.pager.PageUtils;
......
package com.mx.cneeds.server.user.service;
package com.mx.cneeds.server.service.user;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.common.pager.PageUtils;
......
package com.mx.cneeds.server.user.service;
package com.mx.cneeds.server.service.user;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.common.pager.PageUtils;
......
package com.mx.cneeds.server.user.service;
package com.mx.cneeds.server.service.user;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.common.pager.PageUtils;
......
package com.mx.cneeds.server.user.service;
package com.mx.cneeds.server.service.user;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.common.pager.PageUtils;
......
package com.mx.cneeds.server.user.service;
package com.mx.cneeds.server.service.user;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mx.cneeds.common.pager.PageUtils;
......
package com.mx.cneeds.server.vo;
import lombok.Data;
import java.io.Serializable;
/**
* @ClassName SysUser
* @Author zzrdark
* @Date 2020-03-03 16:54
* @Description TODO
**/
@Data
public class UserVo implements Serializable {
private String username;
private String password;
}
mybatis-plus:
mapper-locations: classpath:mapper/*.xml
\ No newline at end of file
mapper-locations: classpath:mapper/*.xml
#实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage: com.mx.cneeds.server.entity
global-config:
#数据库相关配置
db-config:
#主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID";
id-type: AUTO
#字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断"
field-strategy: NOT_NULL
#驼峰下划线转换
column-underline: true
logic-delete-value: -1
logic-not-delete-value: 0
banner: false
#原生配置
configuration:
map-underscore-to-camel-case: true
cache-enabled: false
call-setters-on-nulls: true
jdbc-type-for-null: 'null'
......@@ -14,6 +14,9 @@
<result property="productSet" column="product_set"/>
<result property="createTime" column="create_time"/>
<result property="activeTime" column="active_time"/>
<result property="channelNums" column="channel_nums"/>
<result property="channelNumsMessage" column="channel_nums_message"/>
<result property="channelRules" column="channel_rules"/>
</resultMap>
......
......@@ -9,6 +9,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>cneeds-common-utils</artifactId>
<properties>
......
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4" />
\ No newline at end of file
......@@ -9,18 +9,35 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cneeds-server-advice_control</artifactId>
<artifactId>cneeds-server-authorization</artifactId>
<packaging>jar</packaging>
<dependencies>
<!-- for Spring Security -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
</dependencies>
<!-- for OAuth 2.0 -->
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>2.0.15.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-jwt</artifactId>
<version>1.0.8.RELEASE</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
package com.mx.cneeds.server.advice.control;
package com.mx.cneeds.server.anthorization;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
/**
* @ClassName AdviceControlApplication
* @ClassName AuthorizaitonApplication
* @Author zzrdark
* @Date 2020-01-06 14:50
* @Date 2020-03-03 17:04
* @Description TODO
**/
@SpringBootApplication
@EnableEurekaClient
public class AdviceControlApplication {
public class AuthorizaitonApplication {
public static void main(String[] args) {
new SpringApplicationBuilder(AdviceControlApplication.class).web(WebApplicationType.NONE).run(args);
SpringApplication.run(AuthorizaitonApplication.class, args);
}
}
package com.mx.cneeds.server.anthorization.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer;
import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer;
import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer;
import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerSecurityConfigurer;
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
@EnableAuthorizationServer
public class OAuth2AuthorizationServer extends AuthorizationServerConfigurerAdapter {
/**
* 用户认证
*/
@Autowired
private AuthenticationManager authenticationManager;
@Autowired
private UserDetailsService myUserDetailsService;
@Autowired
private PasswordEncoder passwordEncoder;
@Override
public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
endpoints.authenticationManager(authenticationManager);
endpoints.userDetailsService(myUserDetailsService);
endpoints.tokenStore(jwtTokenStore()).accessTokenConverter(jwtAccessTokenConverter());
}
/**
* 下面两个Bean是配置JWT令牌的
* @return
*/
@Bean
public TokenStore jwtTokenStore() {
return new JwtTokenStore(jwtAccessTokenConverter());
}
@Bean
public JwtAccessTokenConverter jwtAccessTokenConverter(){
JwtAccessTokenConverter converter = new JwtAccessTokenConverter();
// 对JWT进行前面的key
converter.setSigningKey("imooc");
return converter;
}
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
clients.inMemory()
// Client 账号、密码。
.withClient("clientapp").
secret(passwordEncoder.encode("112233"))
//只有在authorization_code模式下需要
// 配置回调地址,选填。
.redirectUris("http://localhost:9001/callback")
.authorizedGrantTypes(/*"authorization_code",*/"password")
// 可授权的 Scope
.scopes("all");
}
@Override
public void configure(AuthorizationServerSecurityConfigurer security) throws Exception {
security.passwordEncoder(new BCryptPasswordEncoder());
}
}
\ No newline at end of file
package com.mx.cneeds.server.anthorization.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;
@Component
public class MyUserDetailsService implements UserDetailsService {
@Autowired
private PasswordEncoder passwordEncoder;
/** (non-Javadoc)
* @see UserDetailsService#loadUserByUsername(String)
*/
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
return new User(username, passwordEncoder.encode("123456"),
AuthorityUtils.commaSeparatedStringToAuthorityList("ROLE_admin"));
}
}
\ No newline at end of file
server.port=8081
server.servlet.context-path=/server
spring.application.name= cneeds-server-authorization
\ No newline at end of file
......@@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>cneeds-server-datashow</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
......@@ -21,7 +21,37 @@
<artifactId>cneeds-common-data</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.mx.cneeds</groupId>
<artifactId>cneeds-common-utils</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!-- for Spring Security -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<!-- for OAuth 2.0 -->
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>2.0.15.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-jwt</artifactId>
<version>1.0.8.RELEASE</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
......@@ -3,6 +3,7 @@ package com.mx.cneeds.server.datashow;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* @ClassName DatashowApplication
......@@ -12,6 +13,7 @@ import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
**/
@SpringBootApplication
@EnableEurekaClient
@EnableSwagger2
public class DatashowApplication {
public static void main(String[] args) {
SpringApplication.run(DatashowApplication.class);
......
package com.mx.cneeds.server.device.web;
package com.mx.cneeds.server.datashow.web.device;
import java.util.Arrays;
import java.util.Map;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.result.R;
import com.mx.cneeds.common.validator.ValidatorUtils;
import com.mx.cneeds.server.device.service.DeviceInfoService;
import com.mx.cneeds.server.service.device.DeviceInfoService;
import com.mx.cneeds.server.entity.DeviceInfoEntity;
import org.springframework.beans.factory.annotation.Autowired;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.Map;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
......@@ -27,7 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
* @date 2020-01-09 15:09:01
*/
@RestController
@RequestMapping("sys/deviceinfo")
@RequestMapping("device/deviceinfo")
public class DeviceInfoController {
@Autowired
private DeviceInfoService deviceInfoService;
......@@ -89,4 +84,9 @@ public class DeviceInfoController {
return R.ok();
}
@RequestMapping("/getChannel_nums")
public void getChannel_nums(String imei){
//TODO 接口实现
}
}
package com.mx.cneeds.server.device.web;
package com.mx.cneeds.server.datashow.web.device;
import java.util.Arrays;
import java.util.Map;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.result.R;
import com.mx.cneeds.common.validator.ValidatorUtils;
import com.mx.cneeds.server.device.service.DeviceLogService;
import com.mx.cneeds.server.service.device.DeviceLogService;
import com.mx.cneeds.server.entity.DeviceLogEntity;
import org.springframework.beans.factory.annotation.Autowired;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.Map;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
......@@ -27,7 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
* @date 2020-01-09 15:09:01
*/
@RestController
@RequestMapping("sys/devicelog")
@RequestMapping("device/devicelog")
public class DeviceLogController {
@Autowired
private DeviceLogService deviceLogService;
......
package com.mx.cneeds.server.device.web;
package com.mx.cneeds.server.datashow.web.device;
import java.util.Arrays;
import java.util.Map;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.result.R;
import com.mx.cneeds.common.validator.ValidatorUtils;
import com.mx.cneeds.server.device.service.DeviceLogmediaService;
import com.mx.cneeds.server.service.device.DeviceLogmediaService;
import com.mx.cneeds.server.entity.DeviceLogmediaEntity;
import org.springframework.beans.factory.annotation.Autowired;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.Map;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
......@@ -27,7 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
* @date 2020-01-09 15:09:01
*/
@RestController
@RequestMapping("sys/devicelogmedia")
@RequestMapping("device/devicelogmedia")
public class DeviceLogmediaController {
@Autowired
private DeviceLogmediaService deviceLogmediaService;
......
package com.mx.cneeds.server.device.web;
package com.mx.cneeds.server.datashow.web.device;
import java.util.Arrays;
import java.util.Map;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.result.R;
import com.mx.cneeds.common.validator.ValidatorUtils;
import com.mx.cneeds.server.device.service.DeviceLogsettingService;
import com.mx.cneeds.server.service.device.DeviceLogsettingService;
import com.mx.cneeds.server.entity.DeviceLogsettingEntity;
import org.springframework.beans.factory.annotation.Autowired;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.Map;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
......@@ -27,7 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
* @date 2020-01-09 15:09:01
*/
@RestController
@RequestMapping("sys/devicelogsetting")
@RequestMapping("device/devicelogsetting")
public class DeviceLogsettingController {
@Autowired
private DeviceLogsettingService deviceLogsettingService;
......
package com.mx.cneeds.server.user.web;
import java.util.Arrays;
import java.util.Map;
package com.mx.cneeds.server.datashow.web.user;
import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.result.R;
import com.mx.cneeds.common.validator.ValidatorUtils;
import com.mx.cneeds.server.entity.SysDeptEntity;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
import com.mx.cneeds.server.user.service.SysDeptService;
import com.mx.cneeds.server.service.user.SysDeptService;
import org.springframework.beans.factory.annotation.Autowired;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.Map;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
......@@ -27,7 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
* @date 2020-01-09 15:09:01
*/
@RestController
@RequestMapping("sys/sysdept")
@RequestMapping("sys/dept")
public class SysDeptController {
@Autowired
private SysDeptService sysDeptService;
......
package com.mx.cneeds.server.user.web;
package com.mx.cneeds.server.datashow.web.user;
import java.util.Arrays;
import java.util.Map;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.result.R;
import com.mx.cneeds.common.validator.ValidatorUtils;
import com.mx.cneeds.server.entity.SysFuncEntity;
import com.mx.cneeds.server.user.service.SysFuncService;
import com.mx.cneeds.server.service.user.SysFuncService;
import org.springframework.beans.factory.annotation.Autowired;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.Map;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
......@@ -27,7 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
* @date 2020-01-09 15:09:01
*/
@RestController
@RequestMapping("sys/sysfunc")
@RequestMapping("sys/func")
public class SysFuncController {
@Autowired
private SysFuncService sysFuncService;
......
package com.mx.cneeds.server.user.web;
package com.mx.cneeds.server.datashow.web.user;
import java.util.Arrays;
import java.util.Map;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.result.R;
import com.mx.cneeds.common.validator.ValidatorUtils;
import com.mx.cneeds.server.entity.SysRoleEntity;
import com.mx.cneeds.server.user.service.SysRoleService;
import com.mx.cneeds.server.service.user.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.Map;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
......@@ -27,7 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
* @date 2020-01-09 15:09:01
*/
@RestController
@RequestMapping("sys/sysrole")
@RequestMapping("sys/role")
public class SysRoleController {
@Autowired
private SysRoleService sysRoleService;
......
package com.mx.cneeds.server.user.web;
package com.mx.cneeds.server.datashow.web.user;
import java.util.Arrays;
import java.util.Map;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.result.R;
import com.mx.cneeds.common.validator.ValidatorUtils;
import com.mx.cneeds.server.entity.SysRoleDeptEntity;
import com.mx.cneeds.server.user.service.SysRoleDeptService;
import com.mx.cneeds.server.service.user.SysRoleDeptService;
import org.springframework.beans.factory.annotation.Autowired;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.Map;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
......@@ -27,7 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
* @date 2020-01-09 15:09:01
*/
@RestController
@RequestMapping("sys/sysroledept")
@RequestMapping("sys/roledept")
public class SysRoleDeptController {
@Autowired
private SysRoleDeptService sysRoleDeptService;
......
package com.mx.cneeds.server.user.web;
package com.mx.cneeds.server.datashow.web.user;
import java.util.Arrays;
import java.util.Map;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.result.R;
import com.mx.cneeds.common.validator.ValidatorUtils;
import com.mx.cneeds.server.entity.SysRoleFuncEntity;
import com.mx.cneeds.server.user.service.SysRoleFuncService;
import com.mx.cneeds.server.service.user.SysRoleFuncService;
import org.springframework.beans.factory.annotation.Autowired;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.Map;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
......@@ -27,7 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
* @date 2020-01-09 15:09:01
*/
@RestController
@RequestMapping("sys/sysrolefunc")
@RequestMapping("sys/rolefunc")
public class SysRoleFuncController {
@Autowired
private SysRoleFuncService sysRoleFuncService;
......
package com.mx.cneeds.server.user.web;
package com.mx.cneeds.server.datashow.web.user;
import java.util.Arrays;
import java.util.Map;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.result.R;
import com.mx.cneeds.common.validator.ValidatorUtils;
import com.mx.cneeds.server.entity.SysUserEntity;
import com.mx.cneeds.server.user.service.SysUserService;
import com.mx.cneeds.server.service.user.SysUserService;
import com.mx.cneeds.server.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.Map;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
......@@ -27,11 +23,19 @@ import org.springframework.web.bind.annotation.RestController;
* @date 2020-01-09 15:09:01
*/
@RestController
@RequestMapping("sys/sysuser")
@RequestMapping("sys/user")
public class SysUserController {
@Autowired
private SysUserService sysUserService;
public R Login(UserVo userVo){
return new R().put("user","");
}
/**
* 列表
*/
......
package com.mx.cneeds.server.user.web;
package com.mx.cneeds.server.datashow.web.user;
import java.util.Arrays;
import java.util.Map;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.result.R;
import com.mx.cneeds.common.validator.ValidatorUtils;
import com.mx.cneeds.server.entity.SysUserRoleEntity;
import com.mx.cneeds.server.user.service.SysUserRoleService;
import com.mx.cneeds.server.service.user.SysUserRoleService;
import org.springframework.beans.factory.annotation.Autowired;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.Map;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
......@@ -27,8 +22,9 @@ import org.springframework.web.bind.annotation.RestController;
* @date 2020-01-09 15:09:01
*/
@RestController
@RequestMapping("sys/sysuserrole")
@RequestMapping("sys/userrole")
public class SysUserRoleController {
@Autowired
private SysUserRoleService sysUserRoleService;
......
spring:
profiles:
active: dev
datasource:
hikari:
driver-class-name: com.mysql.cj.jdbc.Driver
......
spring:
profiles:
active: dev
\ No newline at end of file
......@@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>cneeds-server-device</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
......@@ -29,4 +29,12 @@
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
......@@ -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.Query;
import com.mx.cneeds.server.dao.DeviceInfoDao;
import com.mx.cneeds.server.device.service.DeviceInfoService;
import com.mx.cneeds.server.service.device.DeviceInfoService;
import com.mx.cneeds.server.entity.DeviceInfoEntity;
import org.springframework.stereotype.Service;
import java.util.Map;
......
......@@ -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.Query;
import com.mx.cneeds.server.dao.DeviceLogDao;
import com.mx.cneeds.server.device.service.DeviceLogService;
import com.mx.cneeds.server.service.device.DeviceLogService;
import com.mx.cneeds.server.entity.DeviceLogEntity;
import org.springframework.stereotype.Service;
import java.util.Map;
......
......@@ -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.Query;
import com.mx.cneeds.server.dao.DeviceLogmediaDao;
import com.mx.cneeds.server.device.service.DeviceLogmediaService;
import com.mx.cneeds.server.service.device.DeviceLogmediaService;
import com.mx.cneeds.server.entity.DeviceLogmediaEntity;
import org.springframework.stereotype.Service;
import java.util.Map;
......
......@@ -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.Query;
import com.mx.cneeds.server.dao.DeviceLogsettingDao;
import com.mx.cneeds.server.device.service.DeviceLogsettingService;
import com.mx.cneeds.server.service.device.DeviceLogsettingService;
import com.mx.cneeds.server.entity.DeviceLogsettingEntity;
import org.springframework.stereotype.Service;
import java.util.Map;
......
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4" />
\ No newline at end of file
<?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>
<artifactId>cneeds-server.device_activate</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.mx.cneeds.server.device.activate;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
/**
* @ClassName DeviceActiveApplication
* @Author zzrdark
* @Date 2020-01-06 15:25
* @Description TODO
**/
@SpringBootApplication
@EnableEurekaClient
public class DeviceActiveApplication {
public static void main(String[] args) {
new SpringApplicationBuilder(DeviceActiveApplication.class).web(WebApplicationType.NONE).run(args);
}
}
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
......@@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>cneeds-server-eureka</artifactId>
<packaging>pom</packaging>
<packaging>jar</packaging>
......@@ -29,14 +29,14 @@
<!--<build>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>-->
</build>
</project>
\ No newline at end of file
......@@ -3,7 +3,8 @@ eureka:
service-url:
#defaultZone: http://eureka2:8762/eureka/
defaultZone: http://localhost:8761/eureka/
# register-with-eureka: false
## 单机的时候开启
register-with-eureka: false
fetch-registry: 'false'

# server:
# enable-self-preservation: false
......
......@@ -10,6 +10,14 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>cneeds-server-logupload</artifactId>
<packaging>jar</packaging>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
package com.mx.cneeds.server.logupload;
import org.springframework.boot.SpringApplication;
/**
* @ClassName LogUploadApplication
* @Author zzrdark
* @Date 2020-03-03 20:59
* @Description TODO
**/
public class LogUploadApplication {
public static void main(String[] args) {
SpringApplication.run(LogUploadApplication.class, args);
}
}
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
......@@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>cneeds-server-user</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
......@@ -27,6 +27,20 @@
<artifactId>cneeds-common-data</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
package com.mx.cneeds.server.user;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
......@@ -15,9 +16,9 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
**/
@SpringBootApplication
@EnableEurekaClient
@EnableSwagger2
@MapperScan("com.mx.cneeds.server.dao")
public class UserServerApplication {
public static void main(String[] args) {
new SpringApplicationBuilder(UserServerApplication.class).web(WebApplicationType.NONE).run(args);
new SpringApplicationBuilder(UserServerApplication.class).web(WebApplicationType.SERVLET).run(args);
}
}
......@@ -4,7 +4,7 @@ import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.pager.Query;
import com.mx.cneeds.server.dao.SysDeptDao;
import com.mx.cneeds.server.entity.SysDeptEntity;
import com.mx.cneeds.server.user.service.SysDeptService;
import com.mx.cneeds.server.service.user.SysDeptService;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......
......@@ -4,7 +4,7 @@ import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.pager.Query;
import com.mx.cneeds.server.dao.SysFuncDao;
import com.mx.cneeds.server.entity.SysFuncEntity;
import com.mx.cneeds.server.user.service.SysFuncService;
import com.mx.cneeds.server.service.user.SysFuncService;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......
......@@ -4,7 +4,7 @@ import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.pager.Query;
import com.mx.cneeds.server.dao.SysRoleDeptDao;
import com.mx.cneeds.server.entity.SysRoleDeptEntity;
import com.mx.cneeds.server.user.service.SysRoleDeptService;
import com.mx.cneeds.server.service.user.SysRoleDeptService;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......
......@@ -4,7 +4,7 @@ import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.pager.Query;
import com.mx.cneeds.server.dao.SysRoleFuncDao;
import com.mx.cneeds.server.entity.SysRoleFuncEntity;
import com.mx.cneeds.server.user.service.SysRoleFuncService;
import com.mx.cneeds.server.service.user.SysRoleFuncService;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......
......@@ -4,7 +4,7 @@ import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.pager.Query;
import com.mx.cneeds.server.dao.SysRoleDao;
import com.mx.cneeds.server.entity.SysRoleEntity;
import com.mx.cneeds.server.user.service.SysRoleService;
import com.mx.cneeds.server.service.user.SysRoleService;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......
......@@ -4,7 +4,7 @@ import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.pager.Query;
import com.mx.cneeds.server.dao.SysUserRoleDao;
import com.mx.cneeds.server.entity.SysUserRoleEntity;
import com.mx.cneeds.server.user.service.SysUserRoleService;
import com.mx.cneeds.server.service.user.SysUserRoleService;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......
......@@ -4,7 +4,7 @@ import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.pager.Query;
import com.mx.cneeds.server.dao.SysUserDao;
import com.mx.cneeds.server.entity.SysUserEntity;
import com.mx.cneeds.server.user.service.SysUserService;
import com.mx.cneeds.server.service.user.SysUserService;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......
spring:
application:
name: cneeds-server-user
datasource:
type: com.alibaba.druid.pool.DruidDataSource
druid:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://192.168.2.244:3306/cneeds_server?useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root
password: cneeds!QAZ1qaz
initial-size: 10
max-active: 100
min-idle: 10
max-wait: 60000
pool-prepared-statements: true
max-pool-prepared-statement-per-connection-size: 20
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
#Oracle需要打开注释
#validation-query: SELECT 1 FROM DUAL
test-while-idle: true
test-on-borrow: false
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:
client:
service-url:
defaultZone: http://192.168.2.244:8761/eureka/
server:
port: 9999
......@@ -17,12 +17,11 @@
<module>cneeds-server-eureka</module>
<module>cneeds-server-user</module>
<module>cneeds-server-device</module>
<module>cneeds-server-device_activate</module>
<module>cneeds-server-advice_control</module>
<module>cneeds-server-datashow</module>
<module>cneeds-server-logupload</module>
<module>cneeds-common-data</module>
<module>cneeds-common-utils</module>
<module>cneeds-server-authorization</module>
</modules>
<properties>
......@@ -53,10 +52,14 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
</dependencies>
</project>
\ 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