Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cneeds-server
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhangzr
cneeds-server
Commits
e6c43358
Commit
e6c43358
authored
Apr 26, 2020
by
zzrdark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.add logging
2.增加 查询设备信息
parent
034fca8b
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
351 additions
and
29 deletions
+351
-29
compiler.xml
.idea/compiler.xml
+2
-2
workspace.xml
.idea/workspace.xml
+0
-0
OAuth2ResourceServer.java
...x/cneeds/server/datashow/config/OAuth2ResourceServer.java
+1
-0
DeviceController.java
...x/cneeds/server/datashow/web/device/DeviceController.java
+6
-0
LogFlieController.java
.../cneeds/server/datashow/web/device/LogFlieController.java
+7
-1
application-dev.yml
...ds-server-datashow/src/main/resources/application-dev.yml
+4
-0
application-prod.yml
...s-server-datashow/src/main/resources/application-prod.yml
+3
-0
application-test.yml
...s-server-datashow/src/main/resources/application-test.yml
+20
-0
logback-spring-dev.xml
...server-datashow/src/main/resources/logback-spring-dev.xml
+144
-0
logback-spring-prod.xml
...erver-datashow/src/main/resources/logback-spring-prod.xml
+144
-0
ProductSeriesService.java
...mx/cneeds/server/device/service/ProductSeriesService.java
+2
-0
ProductSeriesServiceImpl.java
.../server/device/service/impl/ProductSeriesServiceImpl.java
+8
-0
DeviceInfoController.java
...com/mx/cneeds/server/device/web/DeviceInfoController.java
+9
-1
application-test.yml
cneeds-server-device/src/main/resources/application-test.yml
+1
-25
No files found.
.idea/compiler.xml
View file @
e6c43358
...
...
@@ -11,12 +11,12 @@
<module
name=
"cneeds-common-utils"
/>
<module
name=
"cneeds-common-data"
/>
<module
name=
"cneeds-server-eureka"
/>
<module
name=
"cneeds-common-hadoop-dfs"
/>
<module
name=
"cneeds-common-pojo"
/>
<module
name=
"cneeds-server-device_activate"
/>
<module
name=
"cneeds-server-logupload"
/>
<module
name=
"cneeds-server-authorization"
/>
<module
name=
"cneeds-server-user"
/>
<module
name=
"cneeds-
server-logupload
"
/>
<module
name=
"cneeds-
common-hadoop-dfs
"
/>
<module
name=
"cneeds-server-device"
/>
</profile>
</annotationProcessing>
...
...
.idea/workspace.xml
View file @
e6c43358
This diff is collapsed.
Click to expand it.
cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/config/OAuth2ResourceServer.java
View file @
e6c43358
...
...
@@ -23,6 +23,7 @@ public class OAuth2ResourceServer extends ResourceServerConfigurerAdapter {
"/device/device/getChannel_nums"
,
"/wechat/wechatFileUpload"
,
"/wechat/wechatDownload/**"
,
"/logFile/logfile/DeviceLogFileUpload"
,
// "/user/info",
"/statics/**"
)
.
permitAll
()
...
...
cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/web/device/DeviceController.java
View file @
e6c43358
...
...
@@ -191,5 +191,11 @@ public class DeviceController {
}
@PostMapping
(
"/device/queryDeviceByImei"
)
public
R
queryDeviceByImei
(
@RequestParam
(
value
=
"imei"
)
String
imei
){
DeviceInfoDto
deviceInfoDto
=
deviceClient
.
queryDeviceByImei
(
imei
);
return
R
.
ok
().
put
(
"data"
,
deviceInfoDto
);
}
}
cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/web/device/LogFlieController.java
View file @
e6c43358
...
...
@@ -3,6 +3,7 @@ package com.mx.cneeds.server.datashow.web.device;
import
com.google.gson.Gson
;
import
com.mx.cneeds.common.UserUtils
;
import
com.mx.cneeds.common.constant.FilePath
;
import
com.mx.cneeds.common.constant.ResultCode
;
import
com.mx.cneeds.common.converter.RequestParamterConverter
;
import
com.mx.cneeds.common.dto.*
;
import
com.mx.cneeds.common.result.R
;
...
...
@@ -81,6 +82,11 @@ public class LogFlieController {
DeviceLogFileDto
dto
=
new
DeviceLogFileDto
();
BeanUtils
.
copyProperties
(
vo
,
dto
);
DeviceInfoDto
deviceInfoDto
=
deviceClient
.
queryDeviceByImei
(
dto
.
getImei
());
if
(
deviceInfoDto
==
null
){
return
R
.
error
(
ResultCode
.
NOTFOUND_IMEI
,
"没有该imei"
);
}
// 把图片存入oos 返回路径
StringBuffer
dir
=
new
StringBuffer
(
FilePath
.
LogFilePath
);
dir
.
append
(
vo
.
getLogAcceptId
());
...
...
@@ -88,7 +94,7 @@ public class LogFlieController {
dto
.
setLogfileUrl
(
dir
.
toString
()+
"/"
+
file
.
getOriginalFilename
());
dto
.
setLogfileSize
(
file
.
getSize
());
DeviceInfoDto
deviceInfoDto
=
deviceClient
.
queryDeviceByImei
(
dto
.
getImei
());
dto
.
setDeviceId
(
deviceInfoDto
.
getDeviceId
());
logFileClient
.
uploadLogFile
(
dto
);
return
R
.
ok
();
...
...
cneeds-server-datashow/src/main/resources/application-dev.yml
View file @
e6c43358
...
...
@@ -18,3 +18,6 @@ spring:
multipart
:
max-file-size
:
100000MB
max-request-size
:
100000MB
logging
:
config
:
classpath:logback-spring-dev.xml
\ No newline at end of file
cneeds-server-datashow/src/main/resources/application-prod.yml
View file @
e6c43358
...
...
@@ -17,3 +17,6 @@ spring:
multipart
:
max-file-size
:
100000MB
max-request-size
:
100000MB
logging
:
config
:
classpath:logback-spring-prod.xml
cneeds-server-datashow/src/main/resources/application-test.yml
View file @
e6c43358
eureka
:
client
:
service-url
:
defaultZone
:
http://192.168.2.244:8761/eureka/
instance
:
prefer-ip-address
:
true
spring
:
hadoop
:
hdfs
:
# hadoopConfigDir: D:\hadoop2.6_Win_x64\etc\hadoop
hadoopConfigDir
:
/home/fengte/hadoop/etc/hadoop/
hdfsUrl
:
hdfs://192.168.2.244:9100
defaultBlockSize
:
128000000
bufferSize
:
512000
servlet
:
multipart
:
max-file-size
:
100000MB
max-request-size
:
100000MB
cneeds-server-datashow/src/main/resources/logback-spring-dev.xml
0 → 100644
View file @
e6c43358
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include
resource=
"org/springframework/boot/logging/logback/base.xml"
/>
<contextName>
logback
</contextName>
<!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 -->
<property
name=
"log.path"
value=
"E:/cneedsLog/log/datashow"
/>
<!--<property name="log.path" value="/root/cneeds-server/cneedsLog" />-->
<!-- 彩色日志 -->
<!-- 彩色日志依赖的渲染类 -->
<conversionRule
conversionWord=
"clr"
converterClass=
"org.springframework.boot.logging.logback.ColorConverter"
/>
<conversionRule
conversionWord=
"wex"
converterClass=
"org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"
/>
<conversionRule
conversionWord=
"wEx"
converterClass=
"org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"
/>
<!-- 彩色日志格式 -->
<property
name=
"CONSOLE_LOG_PATTERN"
value=
"${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"
/>
<!--输出到控制台-->
<appender
name=
"CONSOLE"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
<filter
class=
"ch.qos.logback.classic.filter.ThresholdFilter"
>
<level>
info
</level>
</filter>
<encoder>
<Pattern>
${CONSOLE_LOG_PATTERN}
</Pattern>
<!-- 设置字符集 -->
<charset>
UTF-8
</charset>
</encoder>
</appender>
<!--输出到文件-->
<!-- 时间滚动输出 level为 DEBUG 日志 -->
<appender
name=
"DEBUG_FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- 正在记录的日志文件的路径及文件名 -->
<file>
${log.path}/log_debug.log
</file>
<!--日志文件输出格式-->
<encoder>
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n
</pattern>
<charset>
UTF-8
</charset>
<!-- 设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<!-- 日志归档 -->
<fileNamePattern>
${log.path}/debug/log-debug-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
100MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>
15
</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录debug级别的 -->
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<level>
debug
</level>
<onMatch>
ACCEPT
</onMatch>
<onMismatch>
DENY
</onMismatch>
</filter>
</appender>
<!-- 时间滚动输出 level为 INFO 日志 -->
<appender
name=
"INFO_FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- 正在记录的日志文件的路径及文件名 -->
<file>
${log.path}/log_info.log
</file>
<!--日志文件输出格式-->
<encoder>
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n
</pattern>
<charset>
UTF-8
</charset>
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<!-- 每天日志归档路径以及格式 -->
<fileNamePattern>
${log.path}/info/log-info-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
100MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>
15
</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录info级别的 -->
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<level>
info
</level>
<onMatch>
ACCEPT
</onMatch>
<onMismatch>
DENY
</onMismatch>
</filter>
</appender>
<!-- 时间滚动输出 level为 ERROR 日志 -->
<appender
name=
"ERROR_FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- 正在记录的日志文件的路径及文件名 -->
<file>
${log.path}/log_error.log
</file>
<!--日志文件输出格式-->
<encoder>
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n
</pattern>
<charset>
UTF-8
</charset>
<!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<fileNamePattern>
${log.path}/error/log-error-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
100MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>
15
</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录ERROR级别的 -->
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<level>
ERROR
</level>
<onMatch>
ACCEPT
</onMatch>
<onMismatch>
DENY
</onMismatch>
</filter>
</appender>
<root
level=
"debug"
>
<appender-ref
ref=
"CONSOLE"
/>
<appender-ref
ref=
"DEBUG_FILE"
/>
<appender-ref
ref=
"INFO_FILE"
/>
<appender-ref
ref=
"ERROR_FILE"
/>
</root>
<root
level=
"info"
>
<appender-ref
ref=
"INFO_FILE"
/>
</root>
<!--<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="TRACE" />-->
<!-- 开发、测试环境 -->
<springProfile
name=
"dev,test,pro"
>
<logger
name=
"org.springframework"
level=
"debug"
/>
<logger
name=
"org.springboot"
level=
"debug"
/>
<logger
name=
"com.mx"
level=
"debug"
/>
</springProfile>
<!--<!– 生产环境 –>
<springProfile name="pro">
<logger name="org.springframework" level="info"/>
<logger name="org.springboot" level="info" />
<logger name="com.mx" level="info" />
</springProfile>-->
</configuration>
\ No newline at end of file
cneeds-server-datashow/src/main/resources/logback-spring-prod.xml
0 → 100644
View file @
e6c43358
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include
resource=
"org/springframework/boot/logging/logback/base.xml"
/>
<contextName>
logback
</contextName>
<!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 -->
<!-- <property name="log.path" value="E:/cneedsLog/log" />-->
<property
name=
"log.path"
value=
"/root/cneeds-server/cneedsLog/datashow"
/>
<!-- 彩色日志 -->
<!-- 彩色日志依赖的渲染类 -->
<conversionRule
conversionWord=
"clr"
converterClass=
"org.springframework.boot.logging.logback.ColorConverter"
/>
<conversionRule
conversionWord=
"wex"
converterClass=
"org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"
/>
<conversionRule
conversionWord=
"wEx"
converterClass=
"org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"
/>
<!-- 彩色日志格式 -->
<property
name=
"CONSOLE_LOG_PATTERN"
value=
"${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"
/>
<!--输出到控制台-->
<appender
name=
"CONSOLE"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
<filter
class=
"ch.qos.logback.classic.filter.ThresholdFilter"
>
<level>
info
</level>
</filter>
<encoder>
<Pattern>
${CONSOLE_LOG_PATTERN}
</Pattern>
<!-- 设置字符集 -->
<charset>
UTF-8
</charset>
</encoder>
</appender>
<!--输出到文件-->
<!-- 时间滚动输出 level为 DEBUG 日志 -->
<appender
name=
"DEBUG_FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- 正在记录的日志文件的路径及文件名 -->
<file>
${log.path}/log_debug.log
</file>
<!--日志文件输出格式-->
<encoder>
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n
</pattern>
<charset>
UTF-8
</charset>
<!-- 设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<!-- 日志归档 -->
<fileNamePattern>
${log.path}/debug/log-debug-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
100MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>
15
</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录debug级别的 -->
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<level>
debug
</level>
<onMatch>
ACCEPT
</onMatch>
<onMismatch>
DENY
</onMismatch>
</filter>
</appender>
<!-- 时间滚动输出 level为 INFO 日志 -->
<appender
name=
"INFO_FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- 正在记录的日志文件的路径及文件名 -->
<file>
${log.path}/log_info.log
</file>
<!--日志文件输出格式-->
<encoder>
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n
</pattern>
<charset>
UTF-8
</charset>
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<!-- 每天日志归档路径以及格式 -->
<fileNamePattern>
${log.path}/info/log-info-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
100MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>
15
</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录info级别的 -->
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<level>
info
</level>
<onMatch>
ACCEPT
</onMatch>
<onMismatch>
DENY
</onMismatch>
</filter>
</appender>
<!-- 时间滚动输出 level为 ERROR 日志 -->
<appender
name=
"ERROR_FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- 正在记录的日志文件的路径及文件名 -->
<file>
${log.path}/log_error.log
</file>
<!--日志文件输出格式-->
<encoder>
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n
</pattern>
<charset>
UTF-8
</charset>
<!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<fileNamePattern>
${log.path}/error/log-error-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
100MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>
15
</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录ERROR级别的 -->
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<level>
ERROR
</level>
<onMatch>
ACCEPT
</onMatch>
<onMismatch>
DENY
</onMismatch>
</filter>
</appender>
<root
level=
"debug"
>
<appender-ref
ref=
"CONSOLE"
/>
<appender-ref
ref=
"DEBUG_FILE"
/>
<appender-ref
ref=
"INFO_FILE"
/>
<appender-ref
ref=
"ERROR_FILE"
/>
</root>
<root
level=
"info"
>
<appender-ref
ref=
"INFO_FILE"
/>
</root>
<!--<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="TRACE" />-->
<!-- 开发、测试环境 -->
<springProfile
name=
"dev,test,pro"
>
<logger
name=
"org.springframework"
level=
"debug"
/>
<logger
name=
"org.springboot"
level=
"debug"
/>
<logger
name=
"com.mx"
level=
"debug"
/>
</springProfile>
<!--<!– 生产环境 –>
<springProfile name="pro">
<logger name="org.springframework" level="info"/>
<logger name="org.springboot" level="info" />
<logger name="com.mx" level="info" />
</springProfile>-->
</configuration>
\ No newline at end of file
cneeds-server-device/src/main/java/com/mx/cneeds/server/device/service/ProductSeriesService.java
View file @
e6c43358
...
...
@@ -22,5 +22,7 @@ public interface ProductSeriesService extends IService<ProductSeriesEntity> {
List
<
ProductSeriesEntity
>
queryListById
(
Collection
<
Long
>
array
);
List
<
ProductSeriesEntity
>
queryList
(
Map
<
String
,
Object
>
params
);
ProductSeriesEntity
queryOne
(
Long
seriesId
);
}
cneeds-server-device/src/main/java/com/mx/cneeds/server/device/service/impl/ProductSeriesServiceImpl.java
View file @
e6c43358
...
...
@@ -39,7 +39,15 @@ public class ProductSeriesServiceImpl extends ServiceImpl<ProductSeriesDao, Prod
@Override
public
List
<
ProductSeriesEntity
>
queryList
(
Map
<
String
,
Object
>
params
)
{
return
baseMapper
.
queryList
(
params
);
}
@Override
public
ProductSeriesEntity
queryOne
(
Long
seriesId
){
ProductSeriesEntity
seriesEntity
=
getById
(
seriesId
);
return
seriesEntity
;
}
}
cneeds-server-device/src/main/java/com/mx/cneeds/server/device/web/DeviceInfoController.java
View file @
e6c43358
...
...
@@ -8,7 +8,9 @@ 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.device.service.ProductSeriesService
;
import
com.mx.cneeds.server.entity.DeviceInfoEntity
;
import
com.mx.cneeds.server.entity.ProductSeriesEntity
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
...
@@ -32,6 +34,9 @@ public class DeviceInfoController {
@Autowired
private
DeviceInfoService
deviceInfoService
;
@Autowired
private
ProductSeriesService
productSeriesService
;
/**
* 列表
*/
...
...
@@ -62,11 +67,14 @@ public class DeviceInfoController {
DeviceInfoDto
deviceInfoDto
=
new
DeviceInfoDto
();
if
(
deviceInfoEntity
!=
null
){
BeanUtils
.
copyProperties
(
deviceInfoEntity
,
deviceInfoDto
);
if
(
deviceInfoEntity
.
getSeriesId
()!=
null
){
ProductSeriesEntity
seriesEntity
=
productSeriesService
.
queryOne
(
deviceInfoEntity
.
getSeriesId
());
deviceInfoDto
.
setSeriesNum
(
seriesEntity
.
getSeriesNum
());
}
return
deviceInfoDto
;
}
else
{
return
null
;
}
}
@RequestMapping
(
"/infoByIds"
)
...
...
cneeds-server-device/src/main/resources/application-test.yml
View file @
e6c43358
...
...
@@ -50,29 +50,5 @@ eureka:
defaultZone
:
http://192.168.2.244:8761/eureka/
instance
:
prefer-ip-address
:
true
# ip-address: 192.168.2.244
mybatis-plus
:
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'
ip-address
:
192.168.2.244
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment