Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
项目统一框架
amos-boot-biz
Commits
f7e65093
Commit
f7e65093
authored
Mar 10, 2023
by
litengwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口不需要token
parent
aad60da0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
10 deletions
+36
-10
EquipmentDetailController.java
...oin/equipmanage/controller/EquipmentDetailController.java
+1
-1
FireFightingSystemController.java
.../equipmanage/controller/FireFightingSystemController.java
+13
-3
FeignBasicAuthRequestInterceptor.java
.../equipmanage/remote/FeignBasicAuthRequestInterceptor.java
+22
-6
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/EquipmentDetailController.java
View file @
f7e65093
...
...
@@ -238,7 +238,7 @@ public class EquipmentDetailController extends AbstractBaseController {
}
@RequestMapping
(
value
=
"/selectequipmentDateByCode"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据code查询"
,
notes
=
"根据code查询"
)
public
EquipmentDate
selectequipmentDateByCode
(
@RequestParam
String
code
,
@RequestParam
(
required
=
false
)
Long
stockDetailId
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/FireFightingSystemController.java
View file @
f7e65093
...
...
@@ -6,6 +6,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.component.robot.AmosRequestContext
;
import
com.yeejoin.equipmanage.common.entity.*
;
import
com.yeejoin.equipmanage.common.utils.SpringUtils
;
import
com.yeejoin.equipmanage.fegin.JcsFeign
;
...
...
@@ -26,6 +27,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
...
...
@@ -143,6 +145,8 @@ public class FireFightingSystemController extends AbstractBaseController {
IEquipmentService
iEquipmentService
;
@Autowired
FireFightingSystemMapper
fireFightingSystemMapper
;
@Autowired
private
AmosRequestContext
amosAuth
;
@Value
(
"${equipment.hierarchy}"
)
private
String
hierarchy
;
...
...
@@ -909,27 +913,33 @@ public class FireFightingSystemController extends AbstractBaseController {
/**
* 获取点位图,区域树数据
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"获取点位图,区域树数据"
,
notes
=
"消防系统点位图使用"
)
@GetMapping
(
value
=
"/point/tree"
)
public
List
<
PointTreeVo
>
getPointTree
(
@RequestParam
(
required
=
false
)
String
systemId
,
@RequestParam
(
required
=
false
)
String
bizOrgCode
,
@RequestParam
(
required
=
false
)
String
type
)
{
RequestContext
.
setAppKey
(
amosAuth
.
getAppKey
());
RequestContext
.
setProduct
(
amosAuth
.
getProduct
());
RequestContext
.
setToken
(
amosAuth
.
getToken
());
return
fireFightingSystemService
.
getPointTree
(
systemId
,
bizOrgCode
,
type
);
}
@RequestMapping
(
value
=
"/{systemCode}/system/detail"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
"通过系统code查询消防系统及部件信息"
)
public
Map
<
String
,
Object
>
getSystemDetailByCode
(
@PathVariable
String
systemCode
)
{
return
fireFightingSystemService
.
getSystemDetailByCode
(
systemCode
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取系统分类树"
,
notes
=
"获取系统分类树"
)
@GetMapping
(
value
=
"/systemAndEquipmentTreeByBziOrgCode"
)
public
List
<
OrgMenuDto
>
systemAndEquipmentTreeByBziOrgCode
()
{
RequestContext
.
setAppKey
(
amosAuth
.
getAppKey
());
RequestContext
.
setProduct
(
amosAuth
.
getProduct
());
RequestContext
.
setToken
(
amosAuth
.
getToken
());
return
fireFightingSystemService
.
systemAndEquipmentTreeByBziOrgCode
();
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/remote/FeignBasicAuthRequestInterceptor.java
View file @
f7e65093
...
...
@@ -10,6 +10,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import
feign.RequestInterceptor
;
import
feign.RequestTemplate
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
public
class
FeignBasicAuthRequestInterceptor
implements
RequestInterceptor
{
public
...
...
@@ -27,13 +28,28 @@ public class FeignBasicAuthRequestInterceptor implements RequestInterceptor {
String
authToken
=
request
.
getHeader
(
"token"
);
/* If token not found get it from request parameter */
if
(
StringUtils
.
isBlank
(
authToken
))
{
authToken
=
request
.
getHeader
(
"X-Access-Token"
);
if
(
StringUtils
.
isBlank
(
RequestContext
.
getToken
()))
{
authToken
=
request
.
getHeader
(
"X-Access-Token"
);
template
.
header
(
"X-Access-Token"
,
authToken
);
template
.
header
(
"token"
,
authToken
);
template
.
header
(
"appKey"
,
request
.
getHeader
(
"appKey"
));
template
.
header
(
"product"
,
request
.
getHeader
(
"product"
));
template
.
header
(
"clientType"
,
"feignClient"
);
}
else
{
template
.
header
(
"X-Access-Token"
,
RequestContext
.
getToken
());
System
.
out
.
println
(
RequestContext
.
getToken
());
template
.
header
(
"token"
,
RequestContext
.
getToken
());
template
.
header
(
"appKey"
,
RequestContext
.
getAppKey
());
template
.
header
(
"product"
,
RequestContext
.
getProduct
());
template
.
header
(
"clientType"
,
"feignClient"
);
}
}
else
{
template
.
header
(
"X-Access-Token"
,
authToken
);
template
.
header
(
"token"
,
authToken
);
template
.
header
(
"appKey"
,
request
.
getHeader
(
"appKey"
));
template
.
header
(
"product"
,
request
.
getHeader
(
"product"
));
template
.
header
(
"clientType"
,
"feignClient"
);
}
template
.
header
(
"X-Access-Token"
,
authToken
);
template
.
header
(
"token"
,
authToken
);
template
.
header
(
"appKey"
,
request
.
getHeader
(
"appKey"
));
template
.
header
(
"product"
,
request
.
getHeader
(
"product"
));
template
.
header
(
"clientType"
,
"feignClient"
);
}
}
}
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