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
07ddf46d
Commit
07ddf46d
authored
Apr 01, 2020
by
zzrdark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.日志上传模块
2.修改数据库
parent
c2410dad
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
320 additions
and
9 deletions
+320
-9
cneeds_server.sql
cneeds-common-data/db/cneeds_server.sql
+1
-1
DeviceInfoDao.java
...src/main/java/com/mx/cneeds/server/dao/DeviceInfoDao.java
+5
-1
DeviceLogEntity.java
...ain/java/com/mx/cneeds/server/entity/DeviceLogEntity.java
+1
-1
DeviceInfoDao.xml
...s-common-data/src/main/resources/mapper/DeviceInfoDao.xml
+10
-0
DeviceLogDao.xml
...ds-common-data/src/main/resources/mapper/DeviceLogDao.xml
+1
-1
DeviceLogDto.java
.../src/main/java/com/mx/cneeds/common/dto/DeviceLogDto.java
+80
-0
pom.xml
cneeds-server-datashow/pom.xml
+5
-0
RequestParamterConverter.java
.../mx/cneeds/common/converter/RequestParamterConverter.java
+11
-0
DeviceClient.java
...va/com/mx/cneeds/server/datashow/client/DeviceClient.java
+4
-0
LogFileClient.java
...a/com/mx/cneeds/server/datashow/client/LogFileClient.java
+28
-0
LogFileController.java
.../cneeds/server/datashow/web/device/LogFileController.java
+108
-0
DeviceInfoService.java
...om/mx/cneeds/server/device/service/DeviceInfoService.java
+3
-0
DeviceInfoServiceImpl.java
...eds/server/device/service/impl/DeviceInfoServiceImpl.java
+7
-0
DeviceInfoController.java
...com/mx/cneeds/server/device/web/DeviceInfoController.java
+13
-0
LogUploadApplication.java
.../com/mx/cneeds/server/logupload/LogUploadApplication.java
+4
-0
MybatisPlusConfig.java
.../mx/cneeds/server/logupload/config/MybatisPlusConfig.java
+25
-0
LogUploadController.java
...m/mx/cneeds/server/logupload/web/LogUploadController.java
+12
-3
application-dev.yml
...s-server-logupload/src/main/resources/application-dev.yml
+1
-1
application-dev.yml
cneeds-server-user/src/main/resources/application-dev.yml
+1
-1
No files found.
cneeds-common-data/db/cneeds_server.sql
View file @
07ddf46d
...
@@ -49,7 +49,7 @@ CREATE TABLE `device_log` (
...
@@ -49,7 +49,7 @@ CREATE TABLE `device_log` (
`create_time`
datetime
(
0
)
DEFAULT
NULL
COMMENT
'创建时间'
,
`create_time`
datetime
(
0
)
DEFAULT
NULL
COMMENT
'创建时间'
,
`device_id`
bigint
(
20
)
DEFAULT
NULL
COMMENT
'设备id'
,
`device_id`
bigint
(
20
)
DEFAULT
NULL
COMMENT
'设备id'
,
`status`
int
(
11
)
DEFAULT
NULL
COMMENT
'情况-1不可用 0未处理,1已查看'
,
`status`
int
(
11
)
DEFAULT
NULL
COMMENT
'情况-1不可用 0未处理,1已查看'
,
`c
t
eate_username`
varchar
(
50
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'创建人名字'
,
`c
r
eate_username`
varchar
(
50
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'创建人名字'
,
`user_id`
bigint
(
20
)
DEFAULT
NULL
,
`user_id`
bigint
(
20
)
DEFAULT
NULL
,
`repetition_steps`
varchar
(
300
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'复现步骤'
,
`repetition_steps`
varchar
(
300
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'复现步骤'
,
`logfile_url`
varchar
(
50
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'日志文件存放路径'
,
`logfile_url`
varchar
(
50
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'日志文件存放路径'
,
...
...
cneeds-common-data/src/main/java/com/mx/cneeds/server/dao/DeviceInfoDao.java
View file @
07ddf46d
...
@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...
@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
com.mx.cneeds.server.entity.DeviceInfoEntity
;
import
com.mx.cneeds.server.entity.DeviceInfoEntity
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.Collection
;
import
java.util.List
;
/**
/**
* 设备信息
* 设备信息
*
*
...
@@ -13,5 +16,6 @@ import org.apache.ibatis.annotations.Mapper;
...
@@ -13,5 +16,6 @@ import org.apache.ibatis.annotations.Mapper;
*/
*/
@Mapper
@Mapper
public
interface
DeviceInfoDao
extends
BaseMapper
<
DeviceInfoEntity
>
{
public
interface
DeviceInfoDao
extends
BaseMapper
<
DeviceInfoEntity
>
{
List
<
DeviceInfoEntity
>
queryDeviceByIds
(
Collection
<
Long
>
ids
);
}
}
cneeds-common-data/src/main/java/com/mx/cneeds/server/entity/DeviceLogEntity.java
View file @
07ddf46d
...
@@ -43,7 +43,7 @@ public class DeviceLogEntity implements Serializable {
...
@@ -43,7 +43,7 @@ public class DeviceLogEntity implements Serializable {
/**
/**
* 创建人名字
* 创建人名字
*/
*/
private
String
c
t
eateUsername
;
private
String
c
r
eateUsername
;
/**
/**
*
*
*/
*/
...
...
cneeds-common-data/src/main/resources/mapper/DeviceInfoDao.xml
View file @
07ddf46d
...
@@ -17,7 +17,16 @@
...
@@ -17,7 +17,16 @@
<result
property=
"channelNums"
column=
"channel_nums"
/>
<result
property=
"channelNums"
column=
"channel_nums"
/>
<result
property=
"channelNumsMessage"
column=
"channel_nums_message"
/>
<result
property=
"channelNumsMessage"
column=
"channel_nums_message"
/>
<result
property=
"channelRules"
column=
"channel_rules"
/>
<result
property=
"channelRules"
column=
"channel_rules"
/>
<result
property=
"seriesNum"
column=
"series_num"
/>
</resultMap>
</resultMap>
<select
id=
"queryDeviceByIds"
parameterType=
"collection"
resultMap=
"deviceInfoMap"
>
select d.*,p.series_num from device_info as d, product_series as p
where d.series_id = p.series_id
and d.device_id in
<foreach
item=
"deviceId"
collection=
"collection"
open=
"("
separator=
","
close=
")"
>
#{deviceId}
</foreach>
</select>
</mapper>
</mapper>
\ No newline at end of file
cneeds-common-data/src/main/resources/mapper/DeviceLogDao.xml
View file @
07ddf46d
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"deviceId"
column=
"device_id"
/>
<result
property=
"deviceId"
column=
"device_id"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"c
teateUsername"
column=
"ct
eate_username"
/>
<result
property=
"c
reateUsername"
column=
"cr
eate_username"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"repetitionSteps"
column=
"repetition_steps"
/>
<result
property=
"repetitionSteps"
column=
"repetition_steps"
/>
<result
property=
"logfileUrl"
column=
"logfile_url"
/>
<result
property=
"logfileUrl"
column=
"logfile_url"
/>
...
...
cneeds-common-pojo/src/main/java/com/mx/cneeds/common/dto/DeviceLogDto.java
0 → 100644
View file @
07ddf46d
package
com
.
mx
.
cneeds
.
common
.
dto
;
import
lombok.Data
;
import
java.util.Date
;
/**
* @ClassName DeviceLogDto
* @Author zzrdark
* @Date 2020-04-01 17:07
* @Description TODO
**/
@Data
public
class
DeviceLogDto
{
/**
* logId
*/
private
Long
logId
;
/**
* bug名字
*/
private
String
logName
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 设备id
*/
private
Long
deviceId
;
/**
* 情况-1不可用 0未处理,1已查看
*/
private
Integer
status
;
/**
* 创建人名字
*/
private
String
createUsername
;
/**
*
*/
private
Long
userId
;
/**
* 复现步骤
*/
private
String
repetitionSteps
;
/**
* 日志文件存放路径
*/
private
String
logfileUrl
;
/**
* 日志文件大小
*/
private
Long
logfileSize
;
/**
* 日志文件上传状态,-1,失败,0上传中,1完成
*/
private
Integer
logfileStatus
;
/**
* 设备版本
*/
private
String
deviceVersion
;
/**
* 产品系列号
*/
private
String
seriesNum
;
}
cneeds-server-datashow/pom.xml
View file @
07ddf46d
...
@@ -67,6 +67,11 @@
...
@@ -67,6 +67,11 @@
<artifactId>
springfox-swagger-ui
</artifactId>
<artifactId>
springfox-swagger-ui
</artifactId>
<version>
${swagger.version}
</version>
<version>
${swagger.version}
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.google.code.gson
</groupId>
<artifactId>
gson
</artifactId>
<version>
2.8.5
</version>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
cneeds-server-datashow/src/main/java/com/mx/cneeds/common/converter/RequestParamterConverter.java
View file @
07ddf46d
package
com
.
mx
.
cneeds
.
common
.
converter
;
package
com
.
mx
.
cneeds
.
common
.
converter
;
import
com.google.gson.Gson
;
import
com.google.gson.GsonBuilder
;
import
javax.xml.bind.DatatypeConverter
;
import
javax.xml.bind.DatatypeConverter
;
import
java.util.regex.Matcher
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
java.util.regex.Pattern
;
...
@@ -85,8 +88,16 @@ public class RequestParamterConverter {
...
@@ -85,8 +88,16 @@ public class RequestParamterConverter {
return
String
.
valueOf
(
chars
);
return
String
.
valueOf
(
chars
);
}
}
public
static
Gson
getGson
(){
Gson
gson
=
new
GsonBuilder
().
enableComplexMapKeySerialization
().
create
();
return
gson
;
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
// System.out.println(authorizationConverter("clientapp", "112233"));
// System.out.println(authorizationConverter("clientapp", "112233"));
System
.
out
.
println
(
toLine
(
"userName"
));
System
.
out
.
println
(
toLine
(
"userName"
));
}
}
}
}
cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/client/DeviceClient.java
View file @
07ddf46d
...
@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RequestBody;
...
@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Set
;
/**
/**
* @ClassName DeviceClient
* @ClassName DeviceClient
...
@@ -51,6 +52,9 @@ public interface DeviceClient {
...
@@ -51,6 +52,9 @@ public interface DeviceClient {
@PostMapping
(
"/device/info/infoByImei"
)
@PostMapping
(
"/device/info/infoByImei"
)
DeviceInfoDto
queryDeviceByImei
(
@RequestParam
String
imei
);
DeviceInfoDto
queryDeviceByImei
(
@RequestParam
String
imei
);
@PostMapping
(
"/device/info/infoByIds"
)
List
<
DeviceInfoDto
>
queryDeviceByIds
(
@RequestBody
Set
<
Long
>
ids
);
@PostMapping
(
"/device/info/importDevice"
)
@PostMapping
(
"/device/info/importDevice"
)
void
importDevice
(
@RequestBody
DevicesDto
dto
);
void
importDevice
(
@RequestBody
DevicesDto
dto
);
...
...
cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/client/LogFileClient.java
0 → 100644
View file @
07ddf46d
package
com
.
mx
.
cneeds
.
server
.
datashow
.
client
;
import
com.mx.cneeds.common.dto.PageDto
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.List
;
/**
* @ClassName LogFileCleint
* @Author zzrdark
* @Date 2020-04-01 14:53
* @Description TODO
**/
@FeignClient
(
name
=
"CNEEDS-SERVER-LOGUPLOAD"
)
public
interface
LogFileClient
{
@PostMapping
(
"/log/upload/list"
)
PageDto
logFileList
(
@RequestParam
Integer
page
,
@RequestParam
(
"limit"
)
Integer
pageSize
,
@RequestParam
(
"sidx"
)
String
orderField
,
@RequestParam
(
"order"
)
String
order
);
@PostMapping
(
"/log/upload/delete"
)
void
deleteLogFile
(
@RequestBody
List
<
Long
>
ids
);
}
cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/web/device/LogFileController.java
0 → 100644
View file @
07ddf46d
package
com
.
mx
.
cneeds
.
server
.
datashow
.
web
.
device
;
import
com.google.gson.Gson
;
import
com.google.gson.GsonBuilder
;
import
com.mx.cneeds.common.converter.RequestParamterConverter
;
import
com.mx.cneeds.common.dto.DeviceInfoDto
;
import
com.mx.cneeds.common.dto.DeviceLogDto
;
import
com.mx.cneeds.common.dto.PageDto
;
import
com.mx.cneeds.common.result.R
;
import
com.mx.cneeds.server.datashow.client.DeviceClient
;
import
com.mx.cneeds.server.datashow.client.LogFileClient
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Set
;
/**
* @ClassName LogFileController
* @Author zzrdark
* @Date 2020-04-01 15:14
* @Description TODO
**/
@RestController
@Slf4j
@RequestMapping
(
"/remotelog"
)
public
class
LogFileController
{
@Autowired
private
LogFileClient
logFileClient
;
@Autowired
private
DeviceClient
deviceClient
;
@PostMapping
(
"/logfile/list"
)
public
R
logFileList
(
@RequestParam
(
required
=
false
)
Integer
page
,
@RequestParam
(
required
=
false
)
Integer
pageSize
,
@RequestParam
(
required
=
false
)
String
sort
){
String
orderField
=
null
;
String
order
=
null
;
if
(
page
==
null
||
page
==
0
){
page
=
new
Integer
(
1
);
}
if
(
pageSize
==
null
||
pageSize
==
0
){
pageSize
=
new
Integer
(
10
);
}
if
(
StringUtils
.
isNotEmpty
(
sort
)
&&
StringUtils
.
isNotBlank
(
sort
.
trim
())){
if
(
sort
.
contains
(
"+"
)){
order
=
new
String
(
"asc"
);
}
if
(
sort
.
contains
(
"-"
)){
order
=
new
String
(
"desc"
);
}
orderField
=
sort
.
substring
(
1
);
orderField
=
RequestParamterConverter
.
toLine
(
orderField
);
}
PageDto
pageDto
=
logFileClient
.
logFileList
(
page
,
pageSize
,
orderField
,
order
);
Gson
gson
=
RequestParamterConverter
.
getGson
();
List
<
DeviceLogDto
>
deviceLogDtos
=
new
ArrayList
<>();
for
(
Object
deviceLogDto:
pageDto
.
getList
()
)
{
String
deviceLogDtoStr
=
gson
.
toJson
(
deviceLogDto
);
DeviceLogDto
dto
=
gson
.
fromJson
(
deviceLogDtoStr
,
DeviceLogDto
.
class
);
deviceLogDtos
.
add
(
dto
);
}
Set
<
Long
>
deviceSet
=
new
HashSet
<>();
deviceLogDtos
.
forEach
(
deviceLogDto
->
{
deviceSet
.
add
(
deviceLogDto
.
getDeviceId
());
});
List
<
DeviceInfoDto
>
deviceInfoDtos
=
deviceClient
.
queryDeviceByIds
(
deviceSet
);
deviceLogDtos
.
forEach
(
deviceLogDto
->
{
deviceInfoDtos
.
forEach
(
deviceInfoDto
->
{
if
(
deviceLogDto
.
getDeviceId
().
equals
(
deviceInfoDto
.
getDeviceId
())
){
deviceLogDto
.
setSeriesNum
(
deviceInfoDto
.
getSeriesNum
());
deviceLogDto
.
setDeviceVersion
(
deviceInfoDto
.
getDeviceVersion
());
}
});
});
pageDto
.
setList
(
deviceLogDtos
);
return
new
R
().
put
(
"data"
,
pageDto
);
}
@PostMapping
(
"/logfile/delete"
)
public
R
deleteLogFile
(
@RequestParam
(
value
=
"ids"
,
required
=
false
)
List
<
Long
>
ids
){
logFileClient
.
deleteLogFile
(
ids
);
return
R
.
ok
();
}
}
cneeds-server-device/src/main/java/com/mx/cneeds/server/device/service/DeviceInfoService.java
View file @
07ddf46d
...
@@ -6,6 +6,7 @@ import com.mx.cneeds.server.entity.DeviceInfoEntity;
...
@@ -6,6 +6,7 @@ import com.mx.cneeds.server.entity.DeviceInfoEntity;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Set
;
/**
/**
* 设备信息
* 设备信息
...
@@ -21,5 +22,7 @@ public interface DeviceInfoService extends IService<DeviceInfoEntity> {
...
@@ -21,5 +22,7 @@ public interface DeviceInfoService extends IService<DeviceInfoEntity> {
void
updateBatchByImei
(
List
<
DeviceInfoEntity
>
deviceInfoEntityList
);
void
updateBatchByImei
(
List
<
DeviceInfoEntity
>
deviceInfoEntityList
);
DeviceInfoEntity
queryDeviceByImei
(
String
imei
);
DeviceInfoEntity
queryDeviceByImei
(
String
imei
);
List
<
DeviceInfoEntity
>
queryDeviceByIds
(
Set
<
Long
>
ids
);
}
}
cneeds-server-device/src/main/java/com/mx/cneeds/server/device/service/impl/DeviceInfoServiceImpl.java
View file @
07ddf46d
...
@@ -67,4 +67,11 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoDao, DeviceInfo
...
@@ -67,4 +67,11 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoDao, DeviceInfo
return
deviceInfoEntity
;
return
deviceInfoEntity
;
}
}
@Override
public
List
<
DeviceInfoEntity
>
queryDeviceByIds
(
Set
<
Long
>
ids
){
List
<
DeviceInfoEntity
>
deviceInfoEntities
=
getBaseMapper
().
queryDeviceByIds
(
ids
);
return
deviceInfoEntities
;
}
}
}
cneeds-server-device/src/main/java/com/mx/cneeds/server/device/web/DeviceInfoController.java
View file @
07ddf46d
...
@@ -64,6 +64,19 @@ public class DeviceInfoController {
...
@@ -64,6 +64,19 @@ public class DeviceInfoController {
return
deviceInfoDto
;
return
deviceInfoDto
;
}
}
@RequestMapping
(
"/infoByIds"
)
public
List
<
DeviceInfoDto
>
infoByIds
(
@RequestBody
Set
<
Long
>
ids
){
List
<
DeviceInfoEntity
>
deviceInfoEntitys
=
deviceInfoService
.
queryDeviceByIds
(
ids
);
List
<
DeviceInfoDto
>
deviceInfoDtos
=
new
ArrayList
<>();
deviceInfoEntitys
.
forEach
(
deviceInfoEntity
->
{
DeviceInfoDto
deviceInfoDto
=
new
DeviceInfoDto
();
BeanUtils
.
copyProperties
(
deviceInfoEntity
,
deviceInfoDto
);
deviceInfoDtos
.
add
(
deviceInfoDto
);
});
return
deviceInfoDtos
;
}
/**
/**
* 保存
* 保存
*/
*/
...
...
cneeds-server-logupload/src/main/java/com/mx/cneeds/server/logupload/LogUploadApplication.java
View file @
07ddf46d
package
com
.
mx
.
cneeds
.
server
.
logupload
;
package
com
.
mx
.
cneeds
.
server
.
logupload
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
/**
/**
* @ClassName LogUploadApplication
* @ClassName LogUploadApplication
...
@@ -8,6 +10,8 @@ import org.springframework.boot.SpringApplication;
...
@@ -8,6 +10,8 @@ import org.springframework.boot.SpringApplication;
* @Date 2020-03-03 20:59
* @Date 2020-03-03 20:59
* @Description TODO
* @Description TODO
**/
**/
@SpringBootApplication
@MapperScan
(
"com.mx.cneeds.server.dao"
)
public
class
LogUploadApplication
{
public
class
LogUploadApplication
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
LogUploadApplication
.
class
,
args
);
SpringApplication
.
run
(
LogUploadApplication
.
class
,
args
);
...
...
cneeds-server-logupload/src/main/java/com/mx/cneeds/server/logupload/config/MybatisPlusConfig.java
0 → 100644
View file @
07ddf46d
package
com
.
mx
.
cneeds
.
server
.
logupload
.
config
;
import
com.baomidou.mybatisplus.core.injector.ISqlInjector
;
import
com.baomidou.mybatisplus.extension.injector.LogicSqlInjector
;
import
com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
public
class
MybatisPlusConfig
{
/**
* 分页插件
*/
@Bean
public
PaginationInterceptor
paginationInterceptor
()
{
return
new
PaginationInterceptor
();
}
@Bean
public
ISqlInjector
sqlInjector
()
{
return
new
LogicSqlInjector
();
}
}
\ No newline at end of file
cneeds-server-logupload/src/main/java/com/mx/cneeds/server/logupload/web/LogUploadController.java
View file @
07ddf46d
package
com
.
mx
.
cneeds
.
server
.
logupload
.
web
;
package
com
.
mx
.
cneeds
.
server
.
logupload
.
web
;
import
com.mx.cneeds.common.dto.DeviceLogDto
;
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.server.logupload.service.DeviceLogService
;
import
com.mx.cneeds.server.logupload.service.DeviceLogService
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.io.File
;
import
java.io.File
;
import
java.util.List
;
import
java.util.*
;
import
java.util.Map
;
/**
/**
* @ClassName LogUploadController
* @ClassName LogUploadController
...
@@ -19,7 +21,7 @@ import java.util.Map;
...
@@ -19,7 +21,7 @@ import java.util.Map;
* @Date 2020-03-27 15:26
* @Date 2020-03-27 15:26
* @Description TODO
* @Description TODO
**/
**/
@Controller
@
Rest
Controller
@RequestMapping
(
"/log/upload"
)
@RequestMapping
(
"/log/upload"
)
public
class
LogUploadController
{
public
class
LogUploadController
{
@Autowired
@Autowired
...
@@ -52,6 +54,13 @@ public class LogUploadController {
...
@@ -52,6 +54,13 @@ public class LogUploadController {
@RequestMapping
(
"/list"
)
@RequestMapping
(
"/list"
)
public
PageUtils
list
(
@RequestParam
Map
<
String
,
Object
>
params
){
public
PageUtils
list
(
@RequestParam
Map
<
String
,
Object
>
params
){
PageUtils
page
=
deviceLogService
.
queryPage
(
params
);
PageUtils
page
=
deviceLogService
.
queryPage
(
params
);
List
<
DeviceLogDto
>
list
=
new
ArrayList
<>();
page
.
getList
().
forEach
(
deivceLogEntity
->
{
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
();
BeanUtils
.
copyProperties
(
deivceLogEntity
,
deviceLogDto
);
list
.
add
(
deviceLogDto
);
});
page
.
setList
(
list
);
return
page
;
return
page
;
}
}
...
...
cneeds-server-logupload/src/main/resources/application-dev.yml
View file @
07ddf46d
...
@@ -50,7 +50,7 @@ eureka:
...
@@ -50,7 +50,7 @@ eureka:
defaultZone
:
http://192.168.2.244:8761/eureka/
defaultZone
:
http://192.168.2.244:8761/eureka/
instance
:
instance
:
prefer-ip-address
:
true
prefer-ip-address
:
true
ip-address
:
192.168.2.244
#
ip-address: 192.168.2.244
...
...
cneeds-server-user/src/main/resources/application-dev.yml
View file @
07ddf46d
...
@@ -62,7 +62,7 @@ eureka:
...
@@ -62,7 +62,7 @@ eureka:
defaultZone
:
http://192.168.2.244:8761/eureka/
defaultZone
:
http://192.168.2.244:8761/eureka/
instance
:
instance
:
prefer-ip-address
:
true
prefer-ip-address
:
true
#
ip-address: 192.168.2.244
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