当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- Five design patterns frequently used in development
- 1. What does the operating system do?
- Leetcode-15: sum of three numbers
- 失业日志 11月5日
- Bifrost 之 文件队列(一)
- STC转STM32第一次开发
- Pipedrive如何在每天部署50+次的情况下支持质量发布?
- Programmers should know the URI, a comprehensive understanding of the article
- 服务网格仍然很难 - cncf
- Share API on the web
猜你喜欢

GDI 及OPENGL的区别

RabbitMQ脑裂问题解决方案调查

常见特征金字塔网络FPN及变体

老大问我:“建表为啥还设置个自增 id ?用流水号当主键不正好么?”

A solution to the problem that color picker (palette) cannot use shortcut keys in sublime Text3 plug-in

OSChina 周一乱弹 —— 程序媛的青春

Bifrost 之 文件队列(一)

When iperf is installed under centos7, the solution of make: * no targets specified and no makefile found. Stop

Share API on the web

Factory pattern pattern pattern (simple factory, factory method, abstract factory pattern)
随机推荐
RabbitMQ脑裂问题解决方案调查
六家公司CTO讲述曾经历的“宕机噩梦”
AQS 都看完了,Condition 原理可不能少!
[Python从零到壹] 五.网络爬虫之BeautifulSoup基础语法万字详解
自然语言处理(NLP)路线图 - kdnuggets
Talk about my understanding of FAAS with Alibaba cloud FC
为什么我们不使用GraphQL? - Wundergraph
C/C++编程笔记:指针篇!从内存理解指针,让你完全搞懂指针
C / C + + Programming Notes: pointer! Understand pointer from memory, let you understand pointer completely
Save code
Concurrent linked queue: a non blocking unbounded thread safe queue
Factory pattern pattern pattern (simple factory, factory method, abstract factory pattern)
Concurrent linked queue: a non blocking unbounded thread safe queue
A brief introduction of C code to open or close the firewall example
2 普通模式
The vowels in the inverted string of leetcode
Huawei HCIA notes
First development of STC to stm32
老大问我:“建表为啥还设置个自增 id ?用流水号当主键不正好么?”
Installation record of SAP s / 4hana 2020