当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- After Android solves the setrequested orientation, the rotation of the mobile phone screen does not trigger the onconfigurationchanged method
- 程序员都应该知道的URI,一文帮你全面了解
- Introduction to nmon
- salesforce零基础学习(九十八)Salesforce Connect & External Object
- Combine theory with practice to understand CORS thoroughly
- 2 普通模式
- 重新开始学习离散数学
- Service grid is still difficult - CNCF
- Five design patterns frequently used in development
- WordPress Import 上传的文件尺寸超过php.ini中定义的upload_max_filesize值--&gt;解决方法。
猜你喜欢

STC转STM32第一次开发

EasyNTS上云网关设备在雪亮工程项目中的实战应用

基于链表的有界阻塞队列 —— LinkedBlockingQueue

基于链表的有界阻塞队列 —— LinkedBlockingQueue

Linked blocking queue based on linked list

Operation 2020.11.7-8

How to do thread dump analysis in Windows Environment

商品管理系统——SPU检索功能

APP 莫名崩溃,开始以为是 Header 中 name 大小写的锅,最后发现原来是容器的错!

GDI 及OPENGL的区别
随机推荐
ubuntu 上使用微信的新方案——手机投屏
Android emulator error: x86 emulation currently requires hardware acceleration solution
代码保存
Service grid is still difficult - CNCF
Chapter 5 programming
Several rolling captions based on LabVIEW
python生日贺卡制作以及细节问题的解决最后把python项目发布为exe可执行程序过程
Natural language processing (NLP) roadmap - KDnuggets
Save code
APP 莫名崩溃,开始以为是 Header 中 name 大小写的锅,最后发现原来是容器的错!
Leetcode-11: container with the most water
LeetCode-11:盛水最多的容器
Introduction to nmon
Linked blocking queue based on linked list
c++11-17 模板核心知识(二)—— 类模板
Teacher Liang's small class
Dark网站的后端为什么选择F#? - darklang
B. protocal has 7000eth assets in one week!
结合阿里云 FC 谈谈我对 FaaS 的理解
How to do thread dump analysis in Windows Environment