Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
app-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SuperHive
back-end
app-service
Commits
7d89e4d0
Commit
7d89e4d0
authored
Aug 14, 2020
by
lius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
创建了联系客服feign接口,在module下创建了customerservice包下实现联系客服功能
parent
cecea8b8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
170 additions
and
1 deletion
+170
-1
AuthFilter.java
...in/java/com/esv/freight/app/common/filter/AuthFilter.java
+4
-1
CustomerServiceInterface.java
...a/com/esv/freight/app/feign/CustomerServiceInterface.java
+32
-0
DriverCustomerServiceController.java
...erservice/controller/DriverCustomerServiceController.java
+57
-0
OwnerCustomerServiceController.java
...merservice/controller/OwnerCustomerServiceController.java
+57
-0
CustomerServiceVO.java
...ight/app/module/customerservice/vo/CustomerServiceVO.java
+20
-0
No files found.
src/main/java/com/esv/freight/app/common/filter/AuthFilter.java
View file @
7d89e4d0
...
...
@@ -44,7 +44,10 @@ public class AuthFilter implements Filter {
"/app/driverBackend/account/stop"
,
"/app/ownerBackend/account/stop"
,
"/app/driverBackend/password/reset"
,
"/app/esvActuator/health/diskSpace"
};
"/app/esvActuator/health/diskSpace"
,
"/app/driverBackend/carrier/customerservice"
,
"/app/goodsowner/customerservice"
};
@Autowired
private
ProtocolComponent
protocolComponent
;
...
...
src/main/java/com/esv/freight/app/feign/CustomerServiceInterface.java
0 → 100644
View file @
7d89e4d0
package
com
.
esv
.
freight
.
app
.
feign
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.PostMapping
;
/**
* @description:
* @project: app-service
* @name: com.esv.freight.app.feign.CustomerServiceInterface
* @author: 刘胜
* @email: <liusheng@esvtek.com>
* @createTime: 2020/8/12 14:13
* @version: 1.0
*/
@FeignClient
(
value
=
"freight-customer-service"
)
public
interface
CustomerServiceInterface
{
/**
* 获取货主客服电话
* author 刘胜
* createTime 2020/8/12 14:15
**/
@PostMapping
(
value
=
"/customer/goodsowner/customerservice"
)
JSONObject
ownerCustomer
();
/**
* 获取司机客服电话
* author 刘胜
* createTime 2020/8/12 14:17
**/
@PostMapping
(
value
=
"/customer/carrier/customerservice"
)
JSONObject
driverCustomer
();
}
src/main/java/com/esv/freight/app/module/customerservice/controller/DriverCustomerServiceController.java
0 → 100644
View file @
7d89e4d0
package
com
.
esv
.
freight
.
app
.
module
.
customerservice
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.esv.freight.app.common.component.TokenComponent
;
import
com.esv.freight.app.common.response.EResponse
;
import
com.esv.freight.app.feign.CustomerServiceInterface
;
import
com.esv.freight.app.module.customerservice.vo.CustomerServiceVO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @description:
* @project: app-service
* @name: com.esv.freight.app.module.customerservice.controller.DriverCustomerServiceController
* @author: 刘胜
* @email: <liusheng@esvtek.com>
* @createTime: 2020/8/12 13:32
* @version: 1.0
*/
@RestController
@RequestMapping
(
"/driverBackend/carrier"
)
@Slf4j
@Validated
public
class
DriverCustomerServiceController
{
private
CustomerServiceInterface
customerServiceInterface
;
private
TokenComponent
tokenComponent
;
@Autowired
public
DriverCustomerServiceController
(
CustomerServiceInterface
customerServiceInterface
,
TokenComponent
tokenComponent
)
{
this
.
customerServiceInterface
=
customerServiceInterface
;
this
.
tokenComponent
=
tokenComponent
;
}
/**
* description 获取司机客服电话
* param []
* return com.esv.freight.app.common.response.EResponse
* author 刘胜
* createTime 2020/8/12 14:50
**/
@PostMapping
(
"/customerservice"
)
public
EResponse
driverCustomer
(){
JSONObject
result
=
customerServiceInterface
.
driverCustomer
();
if
(
result
.
getInteger
(
"code"
)
!=
200
)
{
return
EResponse
.
error
(
result
.
getInteger
(
"code"
),
result
.
getString
(
"message"
));
}
CustomerServiceVO
customerServiceVO
=
new
CustomerServiceVO
();
JSONObject
data
=
result
.
getJSONObject
(
"data"
);
customerServiceVO
.
setPhone
(
data
.
getString
(
"phone"
));
return
EResponse
.
ok
(
customerServiceVO
);
}
}
src/main/java/com/esv/freight/app/module/customerservice/controller/OwnerCustomerServiceController.java
0 → 100644
View file @
7d89e4d0
package
com
.
esv
.
freight
.
app
.
module
.
customerservice
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.esv.freight.app.common.component.TokenComponent
;
import
com.esv.freight.app.common.response.EResponse
;
import
com.esv.freight.app.feign.CustomerServiceInterface
;
import
com.esv.freight.app.module.customerservice.vo.CustomerServiceVO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @description:
* @project: app-service
* @name: com.esv.freight.app.module.customerservice.controller.OwnerCustomerServiceController
* @author: 刘胜
* @email: <liusheng@esvtek.com>
* @createTime: 2020/8/12 13:31
* @version: 1.0
*/
@RestController
@RequestMapping
(
"/goodsowner"
)
@Slf4j
@Validated
public
class
OwnerCustomerServiceController
{
private
CustomerServiceInterface
customerServiceInterface
;
@Autowired
public
OwnerCustomerServiceController
(
CustomerServiceInterface
customerServiceInterface
)
{
this
.
customerServiceInterface
=
customerServiceInterface
;
}
/**
* description 获取货主客服电话
* param []
* return com.esv.freight.app.common.response.EResponse
* author 刘胜
* createTime 2020/8/12 14:35
**/
@PostMapping
(
"/customerservice"
)
public
EResponse
ownerCustomer
(){
JSONObject
result
=
customerServiceInterface
.
ownerCustomer
();
if
(
result
.
getInteger
(
"code"
)
!=
200
)
{
return
EResponse
.
error
(
result
.
getInteger
(
"code"
),
result
.
getString
(
"message"
));
}
CustomerServiceVO
customerServiceVO
=
new
CustomerServiceVO
();
JSONObject
data
=
result
.
getJSONObject
(
"data"
);
customerServiceVO
.
setPhone
(
data
.
getString
(
"phone"
));
return
EResponse
.
ok
(
customerServiceVO
);
}
}
src/main/java/com/esv/freight/app/module/customerservice/vo/CustomerServiceVO.java
0 → 100644
View file @
7d89e4d0
package
com
.
esv
.
freight
.
app
.
module
.
customerservice
.
vo
;
import
lombok.Data
;
/**
* @description: 客服电话VO
* @project: app-service
* @name: com.esv.freight.app.module.customerservice.vo.CustomerServiceVO
* @author: 刘胜
* @email: <liusheng@esvtek.com>
* @createTime: 2020/8/12 13:26
* @version: 1.0
*/
@Data
public
class
CustomerServiceVO
{
/**
* 客服电话
*/
private
String
phone
;
}
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