当前位置:网站首页>Commodity management system -- integrate warehouse services and obtain warehouse list
Commodity management system -- integrate warehouse services and obtain warehouse list
2020-11-09 07:35:00 【osc_kiub62pt】
One The configuration file application.yml
# Registration center address and project name
cloud:
nacos:
discovery:
server-addr: 127.0.0.1:8848
application:
name: gulimall-ware
Two Turn on the service registration discovery function
@EnableFeignClients
// Turn on the service registration discovery function
@EnableDiscoveryClient
@SpringBootApplication
public class GulimallWareApplication {
public static void main(String[] args) {
SpringApplication.run(GulimallWareApplication.class, args);
}
}
3、 ... and Gateway microservice configuration
# Configure inventory system routing
- id: ware_route
uri: lb://gulimall-ware
predicates:
- Path=/api/ware/**
filters:
- RewritePath=/api/(?<segment>.*),/$\{segment}
Four controller
/**
* Function description : Warehouse information paging query
*
* @param params Paging conditions
* @return R Data returned to the front end
* @author cakin
* @date 2020/11/8
* @description:
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params) {
PageUtils page = wareInfoService.queryPage(params);
return R.ok().put("page", page);
}
5、 ... and Service layer
/**
* Function description : Warehouse information paging query
*
* @param params Pagination filter conditions
* @return PageUtils Paging information
* @author cakin
* @date 2020/11/8
*/
@Override
public PageUtils queryPage(Map<String, Object> params) {
// Query criteria
QueryWrapper<WareInfoEntity> wareInfoEntityQueryWrapper = new QueryWrapper<>();
// Keyword search
String key = (String) params.get("key");
if (!StringUtils.isEmpty(key)) {
wareInfoEntityQueryWrapper.eq("id", key)
.or().like("name", key)
.or().like("address", key)
.or().like("areacode", key);
}
// Paging query
IPage<WareInfoEntity> page = this.page(new Query<WareInfoEntity>().getPage(params), wareInfoEntityQueryWrapper);
return new PageUtils(page);
}
6、 ... and test
版权声明
本文为[osc_kiub62pt]所创,转载请带上原文链接,感谢
边栏推荐
- Factory pattern pattern pattern (simple factory, factory method, abstract factory pattern)
- 3.你知道计算机是如何启动的吗?
- 商品管理系统——SPU检索功能
- Combine theory with practice to understand CORS thoroughly
- 20201108编程练习——练习3
- 架构中台图
- Platform in architecture
- AQS 都看完了,Condition 原理可不能少!
- Finally, the python project is released as exe executable program process
- Oschina plays disorderly on Monday
猜你喜欢
Exception capture and handling in C + +
1. What does the operating system do?
分库分表的几种常见玩法及如何解决跨库查询等问题
C / C + + Programming Notes: pointer! Understand pointer from memory, let you understand pointer completely
A few lines of code can easily transfer traceid across systems, so you don't have to worry about losing the log!
Android 解决setRequestedOrientation之后手机屏幕的旋转不触发onConfigurationChanged方法
第五章编程
linx7.5 初始安装
Operation 2020.11.7-8
作业2020.11.7-8
随机推荐
Share API on the web
The vowels in the inverted string of leetcode
Android emulator error: x86 emulation currently requires hardware acceleration solution
When we talk about data quality, what are we talking about?
分库分表的几种常见玩法及如何解决跨库查询等问题
服务器性能监控神器nmon使用介绍
重新开始学习离散数学
Save code
For the first time open CSDN, this article is for the past self and what is happening to you
Talk about my understanding of FAAS with Alibaba cloud FC
写时复制集合 —— CopyOnWriteArrayList
Programmers should know the URI, a comprehensive understanding of the article
3.你知道计算机是如何启动的吗?
EasyNTS上云网关设备在雪亮工程项目中的实战应用
Finally, the python project is released as exe executable program process
Leetcode-11: container with the most water
Adding OpenGL form to MFC dialog
ubuntu 上使用微信的新方案——手机投屏
卧槽,这年轻人不讲武德,应届生凭“小抄”干掉5年老鸟,成功拿到字节20Koffer
C++之异常捕获和处理