当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- 2.计算机硬件简介
- Leetcode-15: sum of three numbers
- leetcode之反转字符串中的元音字母
- How does pipedrive support quality publishing with 50 + deployments per day?
- AQS 都看完了,Condition 原理可不能少!
- Salesforce connect & external object
- Concurrent linked queue: a non blocking unbounded thread safe queue
- C++邻接矩阵
- 2020,Android开发者打破寒冬的利器是什么?
- Concurrent linked queue: a non blocking unbounded thread safe queue
猜你喜欢
App crashed inexplicably. At first, it thought it was the case of the name in the header. Finally, it was found that it was the fault of the container!
23张图,带你入门推荐系统
leetcode之反转字符串中的元音字母
Have you ever thought about why the transaction and refund have to be split into different tables
How to get started with rabbitmq
LeetCode-15:三数之和
几行代码轻松实现跨系统传递 traceId,再也不用担心对不上日志了!
Copy on write collection -- copyonwritearraylist
Core knowledge of C + + 11-17 template (2) -- class template
For the first time open CSDN, this article is for the past self and what is happening to you
随机推荐
老大问我:“建表为啥还设置个自增 id ?用流水号当主键不正好么?”
Combine theory with practice to understand CORS thoroughly
第五章编程
Unemployment log, November 5
Salesforce connect & external object
Android emulator error: x86 emulation currently requires hardware acceleration solution
Finally, the python project is released as exe executable program process
Talk about my understanding of FAAS with Alibaba cloud FC
1.操作系统是干什么的?
写时复制集合 —— CopyOnWriteArrayList
代码保存
老大问我:“建表为啥还设置个自增 id ?用流水号当主键不正好么?”
理论与实践相结合彻底理解CORS
重新开始学习离散数学
STC转STM32第一次开发
A solution to the problem that color picker (palette) cannot use shortcut keys in sublime Text3 plug-in
Several common playing methods of sub database and sub table and how to solve the problem of cross database query
Apache Iceberg 中三种操作表的方式
图节点分类与消息传递 - 知乎
First development of STC to stm32