Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
order-group-application
order-group
Commits
501f4433
Commit
501f4433
authored
Apr 01, 2021
by
ping.wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FeignClient 修改
parent
9cd5930b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
142 additions
and
142 deletions
+142
-142
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/StoreServiceImpl.java
+0
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/UserServiceImpl.java
+2
-2
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/MemberToolsClient.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/StoreClient.java
+52
-52
shopping-cart-application-service/src/test/java/cn.freemud/client/StoreClientTest.java
+87
-87
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/StoreServiceImpl.java
View file @
501f4433
This diff is collapsed.
Click to expand it.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/UserServiceImpl.java
View file @
501f4433
...
...
@@ -72,8 +72,8 @@ public class UserServiceImpl implements UserService {
private
PartnerManager
partnerManager
;
// @Autowired
// private CustomerClient customerClient;
@Autowired
private
StoreClient
storeClient
;
//
@Autowired
//
private StoreClient storeClient;
// @Autowired
// private ShortMessageClient shortMessageClient;
// @Autowired
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/MemberToolsClient.java
View file @
501f4433
...
...
@@ -7,7 +7,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
@FeignClient
(
name
=
"
CustomerClient
"
,
url
=
"${saas.customertools.feign.url}"
)
@FeignClient
(
name
=
"
customer-service
"
,
url
=
"${saas.customertools.feign.url}"
)
@RequestMapping
(
produces
=
{
"application/json;charset=UTF-8"
})
public
interface
MemberToolsClient
{
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/StoreClient.java
View file @
501f4433
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @Title: StoreController
* @Package cn.freemud.controller
* @Description:
* @author: ping.wu
* @date: 2018/5/11 19:14
* @version V1.0
* @Copyright: 2018 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
package
cn
.
freemud
.
service
.
thirdparty
;
import
cn.freemud.entities.dto.*
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
@FeignClient
(
name
=
"CONSOLE-API"
,
url
=
"${saas.storeclient.feign.url}"
)
@RequestMapping
(
produces
=
{
"application/json;charset=UTF-8"
})
public
interface
StoreClient
{
/**
* 查询附近门店
*
* @param request
* @return
*/
@PostMapping
(
value
=
"/api/v2/organization/nearStoreList"
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
StoreBaseResponseDto
<
StoreListResponseDto
>
findNearStores
(
@RequestBody
NearStoreRequestDto
request
);
/**
* 查询单个门店信息
*
* @param request
* @return
*/
@PostMapping
(
value
=
"/api/v2/organization/get"
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
StoreBaseResponseDto
<
StoreResponseDto
>
getStoreInfo
(
@RequestBody
StoreInfoRequestDto
request
);
/**
* 查询门店轮播图
*
* @param request
* @return
*/
@PostMapping
(
value
=
"/api/v2/storeImage/list"
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
StoreBaseResponseDto
<
StoreImageListResponseDto
>
findStoreImages
(
@RequestBody
StoreImagesRequestDto
request
);
}
/
//
**
//
* All rights Reserved, Designed By www.freemud.cn
//
*
//
* @Title: StoreController
//
* @Package cn.freemud.controller
//
* @Description:
//
* @author: ping.wu
//
* @date: 2018/5/11 19:14
//
* @version V1.0
//
* @Copyright: 2018 www.freemud.cn Inc. All rights reserved.
//
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
//
*/
//
package cn.freemud.service.thirdparty;
//
//
import cn.freemud.entities.dto.*;
//
import org.springframework.cloud.openfeign.FeignClient;
//
import org.springframework.http.MediaType;
//
import org.springframework.web.bind.annotation.PostMapping;
//
import org.springframework.web.bind.annotation.RequestBody;
//
import org.springframework.web.bind.annotation.RequestMapping;
//
//
@FeignClient(name = "CONSOLE-API",url = "${saas.storeclient.feign.url}")
//
@RequestMapping(produces = {"application/json;charset=UTF-8"})
//
public interface StoreClient {
//
//
/**
//
* 查询附近门店
//
*
//
* @param request
//
* @return
//
*/
//
@PostMapping(value = "/api/v2/organization/nearStoreList", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
//
StoreBaseResponseDto<StoreListResponseDto> findNearStores(@RequestBody NearStoreRequestDto request);
//
//
/**
//
* 查询单个门店信息
//
*
//
* @param request
//
* @return
//
*/
//
@PostMapping(value = "/api/v2/organization/get", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
//
StoreBaseResponseDto<StoreResponseDto> getStoreInfo(@RequestBody StoreInfoRequestDto request);
//
//
/**
//
* 查询门店轮播图
//
*
//
* @param request
//
* @return
//
*/
//
@PostMapping(value = "/api/v2/storeImage/list", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
//
StoreBaseResponseDto<StoreImageListResponseDto> findStoreImages(@RequestBody StoreImagesRequestDto request);
//
}
shopping-cart-application-service/src/test/java/cn.freemud/client/StoreClientTest.java
View file @
501f4433
package
cn
.
freemud
.
client
;
import
cn.freemud.entities.dto.*
;
import
cn.freemud.service.thirdparty.StoreClient
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
java.util.List
;
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @version V1.0
* @Title: StoreClientTest
* @Package cn.freemud.client
* @Description: 测试
* @author: zhenghuan.yang
* @date: 2018/6/25 15:41
* @Copyright: 2018 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
@Slf4j
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
@EnableDiscoveryClient
@EnableFeignClients
@EnableAutoConfiguration
public
class
StoreClientTest
{
@Autowired
private
StoreClient
storeClient
;
/**
* 查询附近门店
*/
@Test
public
void
findNearStores
()
{
NearStoreRequestDto
nearStoreRequestDto
=
new
NearStoreRequestDto
();
nearStoreRequestDto
.
setPartnerId
(
"1832"
);
nearStoreRequestDto
.
setLatitude
(
"31.269248962402344"
);
nearStoreRequestDto
.
setLongitude
(
"121.37284088134766"
);
nearStoreRequestDto
.
setActiveFlag
(
"1"
);
nearStoreRequestDto
.
setTypeFlag
(
"3"
);
nearStoreRequestDto
.
setPageNo
(
1
);
nearStoreRequestDto
.
setPlaceOrderFlag
(
"1"
);
nearStoreRequestDto
.
setPageSize
(
100
);
nearStoreRequestDto
.
setDistance
(
"100000"
);
StoreBaseResponseDto
<
StoreListResponseDto
>
response
=
storeClient
.
findNearStores
(
nearStoreRequestDto
);
StoreListResponseDto
storeListResponseDto
=
response
.
getBizVO
();
List
<
StoreResponseDto
>
list
=
storeListResponseDto
.
getList
();
log
.
info
(
"storeId "
+
"freeDeliveryPrice "
+
"deliveryPrice "
+
"delivery"
);
for
(
StoreResponseDto
store:
list
){
String
insert
=
"INSERT INTO open_platform_partner_store_delivery_config (`partner_id`, `store_id`, `delivery_limit_amount`, `delivery_amount`, `default_delivery_range`, `add_range_count`, `add_range_amount`, `gmt_created`, `gmt_modified`) VALUES ('"
+
nearStoreRequestDto
.
getPartnerId
()+
"', '"
+
store
.
getStoreCode
()+
"','"
+
store
.
getFreeDeliveryPrice
()*
100
+
"','"
+
store
.
getDeliveryPrice
()*
100
+
"', '3000', '3000', '250', '2018-12-13 17:08:25', '2018-12-13 18:15:43');"
;
System
.
out
.
println
(
insert
);
/* System.out.println(store.getStoreCode()+" "+store.getFreeDeliveryPrice()+" "+store.getDeliveryPrice()+" "+store.getDelivery());*/
}
}
/**
* 查询单个门店信息
*/
@Test
public
void
getStoreInfo
()
{
StoreInfoRequestDto
storeInfoRequestDto
=
new
StoreInfoRequestDto
();
storeInfoRequestDto
.
setPartnerId
(
"360bb48b-5316-458a-903e-9a44c7f339b1"
);
storeInfoRequestDto
.
setStoreCode
(
""
);
StoreBaseResponseDto
<
StoreResponseDto
>
storeBaseResponseDto
=
storeClient
.
getStoreInfo
(
storeInfoRequestDto
);
log
.
info
(
"storeBaseResponseDto==="
+
storeBaseResponseDto
);
}
/**
* 查询门店轮播图
*/
@Test
public
void
findStoreImages
()
{
StoreImagesRequestDto
toreImagesRequestDto
=
new
StoreImagesRequestDto
();
toreImagesRequestDto
.
setPartnerId
(
"360bb48b-5316-458a-903e-9a44c7f339b1"
);
toreImagesRequestDto
.
setBusinessId
(
""
);
toreImagesRequestDto
.
setTypeFlag
(
1
);
StoreBaseResponseDto
<
StoreImageListResponseDto
>
storeBaseResponseDto
=
storeClient
.
findStoreImages
(
toreImagesRequestDto
);
log
.
info
(
"storeBaseResponseDto==="
+
storeBaseResponseDto
);
}
}
//
package cn.freemud.client;
//
//
import cn.freemud.entities.dto.*;
//
import cn.freemud.service.thirdparty.StoreClient;
//
import lombok.extern.slf4j.Slf4j;
//
import org.junit.Test;
//
import org.junit.runner.RunWith;
//
import org.springframework.beans.factory.annotation.Autowired;
//
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
//
import org.springframework.boot.test.context.SpringBootTest;
//
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
//
import org.springframework.cloud.openfeign.EnableFeignClients;
//
import org.springframework.test.context.junit4.SpringRunner;
//
//
import java.util.List;
//
/
//
**
//
* All rights Reserved, Designed By www.freemud.cn
//
*
//
* @version V1.0
//
* @Title: StoreClientTest
//
* @Package cn.freemud.client
//
* @Description: 测试
//
* @author: zhenghuan.yang
//
* @date: 2018/6/25 15:41
//
* @Copyright: 2018 www.freemud.cn Inc. All rights reserved.
//
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
//
*/
//
@Slf4j
//
@RunWith(SpringRunner.class)
//
@SpringBootTest
//
@EnableDiscoveryClient
//
@EnableFeignClients
//
@EnableAutoConfiguration
//
public class StoreClientTest {
//
@Autowired
//
private StoreClient storeClient;
//
//
/**
//
* 查询附近门店
//
*/
//
@Test
//
public void findNearStores() {
//
NearStoreRequestDto nearStoreRequestDto=new NearStoreRequestDto();
//
nearStoreRequestDto.setPartnerId("1832");
//
nearStoreRequestDto.setLatitude("31.269248962402344");
//
nearStoreRequestDto.setLongitude("121.37284088134766");
//
nearStoreRequestDto.setActiveFlag("1");
//
nearStoreRequestDto.setTypeFlag("3");
//
nearStoreRequestDto.setPageNo(1);
//
nearStoreRequestDto.setPlaceOrderFlag("1");
//
nearStoreRequestDto.setPageSize(100);
//
nearStoreRequestDto.setDistance("100000");
//
StoreBaseResponseDto<StoreListResponseDto> response = storeClient.findNearStores(nearStoreRequestDto);
//
StoreListResponseDto storeListResponseDto=response.getBizVO();
//
List<StoreResponseDto> list=storeListResponseDto.getList();
//
log.info("storeId " + "freeDeliveryPrice "+"deliveryPrice " +"delivery" );
//
for (StoreResponseDto store:list){
//
String insert="INSERT INTO open_platform_partner_store_delivery_config (`partner_id`, `store_id`, `delivery_limit_amount`, `delivery_amount`, `default_delivery_range`, `add_range_count`, `add_range_amount`, `gmt_created`, `gmt_modified`) VALUES ('"+nearStoreRequestDto.getPartnerId()+"', '"+store.getStoreCode()+"','"+store.getFreeDeliveryPrice()*100+"','"+store.getDeliveryPrice()*100+"', '3000', '3000', '250', '2018-12-13 17:08:25', '2018-12-13 18:15:43');";
//
System.out.println(insert);
//
/* System.out.println(store.getStoreCode()+" "+store.getFreeDeliveryPrice()+" "+store.getDeliveryPrice()+" "+store.getDelivery());*/
//
}
//
}
//
/**
//
* 查询单个门店信息
//
*/
//
@Test
//
public void getStoreInfo() {
//
StoreInfoRequestDto storeInfoRequestDto=new StoreInfoRequestDto();
//
storeInfoRequestDto.setPartnerId("360bb48b-5316-458a-903e-9a44c7f339b1");
//
storeInfoRequestDto.setStoreCode("");
//
StoreBaseResponseDto<StoreResponseDto> storeBaseResponseDto = storeClient.getStoreInfo(storeInfoRequestDto);
//
log.info("storeBaseResponseDto==="+storeBaseResponseDto);
//
}
//
/**
//
* 查询门店轮播图
//
*/
//
@Test
//
public void findStoreImages() {
//
StoreImagesRequestDto toreImagesRequestDto=new StoreImagesRequestDto();
//
toreImagesRequestDto.setPartnerId("360bb48b-5316-458a-903e-9a44c7f339b1");
//
toreImagesRequestDto.setBusinessId("");
//
toreImagesRequestDto.setTypeFlag(1);
//
StoreBaseResponseDto<StoreImageListResponseDto> storeBaseResponseDto = storeClient.findStoreImages(toreImagesRequestDto);
//
log.info("storeBaseResponseDto==="+storeBaseResponseDto);
//
}
//
}
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