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 6d88d6cd
authored
Mar 17, 2022
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
假性离线API接口开发
1 parent
d09831da
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
4 deletions
src/main/java/cn/com/glsx/stdinterface/api/FakeOfficeClient.java
src/main/java/cn/com/glsx/stdinterface/dto/FakeOfflineFenceSnDto.java
src/main/java/cn/com/glsx/stdinterface/fallback/FakeOfficeFallbackImpl.java
src/main/java/cn/com/glsx/stdinterface/api/FakeOfficeClient.java
View file @
6d88d6c
...
@@ -4,13 +4,17 @@ import cn.com.glsx.stdinterface.dto.FakeOfflineFenceSnDto;
...
@@ -4,13 +4,17 @@ import cn.com.glsx.stdinterface.dto.FakeOfflineFenceSnDto;
import
cn.com.glsx.stdinterface.factory.FakeOfficeFallbackFactory
;
import
cn.com.glsx.stdinterface.factory.FakeOfficeFallbackFactory
;
import
com.glsx.plat.core.web.R
;
import
com.glsx.plat.core.web.R
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.
PostMapping
;
import
org.springframework.web.bind.annotation.
*
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
java.util.List
;
@FeignClient
(
name
=
"ne-shield-standard-interfaces"
,
path
=
"/nesi/fakeoffice"
,
fallbackFactory
=
FakeOfficeFallbackFactory
.
class
,
decode404
=
true
)
@FeignClient
(
name
=
"ne-shield-standard-interfaces"
,
path
=
"/nesi/fakeoffice"
,
fallbackFactory
=
FakeOfficeFallbackFactory
.
class
,
decode404
=
true
)
public
interface
FakeOfficeClient
{
public
interface
FakeOfficeClient
{
@GetMapping
(
value
=
"/getFakeOfficeData"
)
R
<
List
<
FakeOfflineFenceSnDto
>>
getFakeOfficeData
(
@RequestParam
String
uniqueFlag
);
@PostMapping
(
value
=
"storeFakeList"
)
@PostMapping
(
value
=
"storeFakeList"
)
@ResponseBody
@ResponseBody
R
storeFakeData
(
@RequestBody
FakeOfflineFenceSnDto
fakeOfflineFenceSnDto
);
R
storeFakeData
(
@RequestBody
FakeOfflineFenceSnDto
fakeOfflineFenceSnDto
);
...
...
src/main/java/cn/com/glsx/stdinterface/dto/FakeOfflineFenceSnDto.java
View file @
6d88d6c
package
cn
.
com
.
glsx
.
stdinterface
.
dto
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.util.Date
;
/** * 假性离线围栏数据dto * * @author yangll */
@Data
@Accessors
(
chain
=
true
)
public
class
FakeOfflineFenceSnDto
{
/** * 设备号 */
private
String
sn
;
/** * 是否在家庭围栏或者工作围栏内, 1表是在围栏内, 2表示不在围栏内 */
private
Integer
status
;
/** * 围栏类型: 1.家庭所在地围栏 2.工作所在地围栏 */
private
Integer
merchantType
;
/** * 进围栏时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
entryTime
;
/** * 出围栏时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
outTime
;
/** * 家庭所在地围栏|工作所在地围栏 */
private
String
addr
;
}
\ No newline at end of file
\ No newline at end of file
package
cn
.
com
.
glsx
.
stdinterface
.
dto
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.util.Date
;
/** * 假性离线围栏数据dto * * @author yangll */
@Data
@Accessors
(
chain
=
true
)
public
class
FakeOfflineFenceSnDto
{
/** * 设备号 */
private
String
sn
;
/** * 是否在家庭围栏或者工作围栏内, 1表是在围栏内, 2表示不在围栏内 */
private
Integer
status
;
/** * 围栏类型: 1.家庭所在地围栏 2.工作所在地围栏 */
private
Integer
merchantType
;
/** * 进围栏时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
entryTime
;
/** * 出围栏时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
outTime
;
/** * 家庭所在地围栏|工作所在地围栏 */
private
String
addr
;
/** * 唯一标识位 */
private
String
uniqueFlag
;
}
\ No newline at end of file
\ No newline at end of file
...
...
src/main/java/cn/com/glsx/stdinterface/fallback/FakeOfficeFallbackImpl.java
View file @
6d88d6c
...
@@ -21,6 +21,12 @@ public class FakeOfficeFallbackImpl implements FakeOfficeClient {
...
@@ -21,6 +21,12 @@ public class FakeOfficeFallbackImpl implements FakeOfficeClient {
@Override
@Override
public
R
getFakeOfficeData
(
String
uniqueFlag
)
{
log
.
warn
(
"getFakeOfficeData 熔断啦 {}"
,
cause
.
getMessage
());
return
R
.
ok
(
"服务异常"
);
}
@Override
public
R
storeFakeData
(
FakeOfflineFenceSnDto
fakeOfflineFenceSnDto
)
{
public
R
storeFakeData
(
FakeOfflineFenceSnDto
fakeOfflineFenceSnDto
)
{
log
.
warn
(
"storeFakeList 熔断啦 {}"
,
cause
.
getMessage
());
log
.
warn
(
"storeFakeList 熔断啦 {}"
,
cause
.
getMessage
());
return
R
.
ok
(
"服务异常"
);
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