当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- Bifrost 之 文件队列(一)
- C / C + + Programming Notes: pointer! Understand pointer from memory, let you understand pointer completely
- 亚马逊的无服务器总线EventBridge支持事件溯源 - AWS
- Introduction to nmon
- Factory pattern pattern pattern (simple factory, factory method, abstract factory pattern)
- centos7下安装iperf时出现 make: *** No targets specified and no makefile found. Stop.的解决方案
- 14. Introduction to kubenetes
- 链表
- 《MFC dialog中加入OpenGL窗体》
- WordPress Import 上传的文件尺寸超过php.ini中定义的upload_max_filesize值--&gt;解决方法。
猜你喜欢
ubuntu 上使用微信的新方案——手机投屏
LeetCode-15:三数之和
Several rolling captions based on LabVIEW
RabbitMQ脑裂问题解决方案调查
5 个我不可或缺的开源工具
How to reduce the resource consumption of istio agent through sidecar custom resource
APP 莫名崩溃,开始以为是 Header 中 name 大小写的锅,最后发现原来是容器的错!
AQS 都看完了,Condition 原理可不能少!
平台商业化能力的另一种表现形式SAAS
Android emulator error: x86 emulation currently requires hardware acceleration solution
随机推荐
EasyNTS上云网关设备在雪亮工程项目中的实战应用
2. Introduction to computer hardware
非阻塞的无界线程安全队列 —— ConcurrentLinkedQueue
代码保存
一堆代码忘了缩进?快捷方式教你无忧无虑!
When we talk about data quality, what are we talking about?
华为HCIA笔记
你有没有想过为什么交易和退款要拆开不同的表
Exception capture and handling in C + +
Detailed analysis of OpenGL es framework (8) -- OpenGL es Design Guide
老大问我:“建表为啥还设置个自增 id ?用流水号当主键不正好么?”
简单介绍c#通过代码开启或关闭防火墙示例
深度优先搜索和广度优先搜索
leetcode之反转字符串中的元音字母
A brief introduction of C code to open or close the firewall example
Apache Iceberg 中三种操作表的方式
C/C++编程笔记:指针篇!从内存理解指针,让你完全搞懂指针
The vowels in the inverted string of leetcode
A few lines of code can easily transfer traceid across systems, so you don't have to worry about losing the log!
梁老师小课堂|谈谈模板方法模式