Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-standard-interfaces-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit e9c4b4c7
authored
Sep 29, 2021
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
开发设备调频数据消费
1 parent
86cff86f
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
173 additions
and
0 deletions
.gitignore
src/main/java/cn/com/glsx/stdinterface/api/FreqRecordClient.java
src/main/java/cn/com/glsx/stdinterface/dto/FreqRecordDto.java
src/main/java/cn/com/glsx/stdinterface/factory/FreqRecordFallbackFactory.java
src/main/java/cn/com/glsx/stdinterface/fallback/FreqRecordFallbackImpl.java
.gitignore
0 → 100644
View file @
e9c4b4c
# Created by .ignore support plugin (hsz.mobi)
src/main/java/cn/com/glsx/stdinterface/api/FreqRecordClient.java
0 → 100644
View file @
e9c4b4c
package
cn
.
com
.
glsx
.
stdinterface
.
api
;
import
cn.com.glsx.stdinterface.dto.FreqRecordDto
;
import
cn.com.glsx.stdinterface.factory.FreqRecordFallbackFactory
;
import
com.glsx.plat.core.web.R
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestParam
;
/**
* @author zhouhaibao
* @date 2021/5/24 9:49
*/
@FeignClient
(
name
=
"ne-shield-standard-interfaces"
,
path
=
"/stdinterface/freqrecord"
,
fallbackFactory
=
FreqRecordFallbackFactory
.
class
,
decode404
=
true
)
public
interface
FreqRecordClient
{
/**
* 获取数据集合
*
* @return R
*/
@GetMapping
(
value
=
"/gethisbysnandseq"
)
R
getHisBySnAndSeq
(
@RequestParam
String
sn
,
@RequestParam
int
seq
);
/**
* 插入调频日志数据
*
* @param freqRecordDto
* @return
*/
@PostMapping
(
value
=
"/insertfreqrecord"
)
R
insertFreqRecord
(
@RequestBody
FreqRecordDto
freqRecordDto
);
/**
* 更新调频日志数据
*
* @param freqRecordDto
* @return
*/
@PostMapping
(
value
=
"/updatefreqrecord"
)
R
updateFreqRecord
(
@RequestBody
FreqRecordDto
freqRecordDto
);
}
src/main/java/cn/com/glsx/stdinterface/dto/FreqRecordDto.java
0 → 100644
View file @
e9c4b4c
package
cn
.
com
.
glsx
.
stdinterface
.
dto
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
java.util.Date
;
/**
* Created by youzq on 2019/3/14.
*/
@Data
public
class
FreqRecordDto
{
/**
* id
*/
private
Integer
id
;
/**
* 设备号
*/
private
String
sn
;
/**
* 设备回复,定位标志
*/
private
String
freqFlag
;
/**
* 接入接收指令时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
freqRecTime
;
/**
* 接入指令下发时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
freqSendTime
;
/**
* 设备回复时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
replyTime
;
/**
* 调频上点时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
deviceTime
;
/**
* 创建时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
createdTime
;
/**
* 更新时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
updatedTime
;
}
src/main/java/cn/com/glsx/stdinterface/factory/FreqRecordFallbackFactory.java
0 → 100644
View file @
e9c4b4c
package
cn
.
com
.
glsx
.
stdinterface
.
factory
;
import
cn.com.glsx.stdinterface.api.FreqRecordClient
;
import
cn.com.glsx.stdinterface.fallback.FreqRecordFallbackImpl
;
import
feign.hystrix.FallbackFactory
;
import
org.springframework.stereotype.Component
;
/**
* 项目名:ne-shield-insurancenter-api
* 包名: cn.com.glsx.insurance.factory
* 作者: Yanglinlong
* 日期: 2021/7/5 16:15
*/
@Component
public
class
FreqRecordFallbackFactory
implements
FallbackFactory
<
FreqRecordClient
>
{
@Override
public
FreqRecordClient
create
(
Throwable
throwable
)
{
FreqRecordFallbackImpl
fallback
=
new
FreqRecordFallbackImpl
();
fallback
.
setCause
(
throwable
);
return
fallback
;
}
}
src/main/java/cn/com/glsx/stdinterface/fallback/FreqRecordFallbackImpl.java
0 → 100644
View file @
e9c4b4c
package
cn
.
com
.
glsx
.
stdinterface
.
fallback
;
import
cn.com.glsx.stdinterface.api.FreqRecordClient
;
import
cn.com.glsx.stdinterface.dto.FreqRecordDto
;
import
com.glsx.plat.core.web.R
;
import
lombok.Setter
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
/**
* 项目名:ne-shield-insurancenter-api
* 包名: cn.com.glsx.insurance.fallback
* 作者: Yanglinlong
* 日期: 2021/7/5 16:16
*/
@Slf4j
@Component
public
class
FreqRecordFallbackImpl
implements
FreqRecordClient
{
@Setter
private
Throwable
cause
;
@Override
public
R
getHisBySnAndSeq
(
String
sn
,
int
seq
)
{
log
.
warn
(
"getHisBySnAndSeq 熔断啦 {}"
,
cause
.
getMessage
());
return
R
.
ok
(
"服务异常"
);
}
@Override
public
R
insertFreqRecord
(
FreqRecordDto
freqRecordDto
)
{
log
.
warn
(
"insertFreqRecord 熔断啦 {}"
,
cause
.
getMessage
());
return
R
.
ok
(
"服务异常"
);
}
@Override
public
R
updateFreqRecord
(
FreqRecordDto
freqRecordDto
)
{
log
.
warn
(
"updateFreqRecord 熔断啦 {}"
,
cause
.
getMessage
());
return
R
.
ok
(
"服务异常"
);
}
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment