当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- 当我们聊数据质量的时候,我们在聊些什么?
- When we talk about data quality, what are we talking about?
- The vowels in the inverted string of leetcode
- 亚马逊的无服务器总线EventBridge支持事件溯源 - AWS
- 服务器性能监控神器nmon使用介绍
- 作业2020.11.7-8
- Several common playing methods of sub database and sub table and how to solve the problem of cross database query
- Have you ever thought about why the transaction and refund have to be split into different tables
- Linked list
- 2.计算机硬件简介
猜你喜欢
随机推荐
Several rolling captions based on LabVIEW
centos7下安装iperf时出现 make: *** No targets specified and no makefile found. Stop.的解决方案
一堆代码忘了缩进?快捷方式教你无忧无虑!
非阻塞的无界线程安全队列 —— ConcurrentLinkedQueue
老大问我:“建表为啥还设置个自增 id ?用流水号当主键不正好么?”
OSChina 周一乱弹 —— 程序媛的青春
A few lines of code can easily transfer traceid across systems, so you don't have to worry about losing the log!
OpenGL ES 框架详细解析(八) —— OpenGL ES 设计指南
商品管理系统——SPU检索功能
Exception capture and handling in C + +
Detailed analysis of OpenGL es framework (8) -- OpenGL es Design Guide
Tips in Android Development: requires permission android.permission write_ Settings solution
Talk about my understanding of FAAS with Alibaba cloud FC
Programmers should know the URI, a comprehensive understanding of the article
STC转STM32第一次开发
Copy on write collection -- copyonwritearraylist
File queue in Bifrost (1)
LeetCode-15:三数之和
2 普通模式
Why don't we use graphql? - Wundergraph






