当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- 程序员都应该知道的URI,一文帮你全面了解
- 写时复制集合 —— CopyOnWriteArrayList
- The vowels in the inverted string of leetcode
- 23 pictures, take you to the recommended system
- 1.操作系统是干什么的?
- Depth first search and breadth first search
- C / C + + Programming Notes: pointer! Understand pointer from memory, let you understand pointer completely
- A bunch of code forgot to indent? Shortcut teach you carefree!
- A brief introduction of C code to open or close the firewall example
- B. protocal has 7000eth assets in one week!
猜你喜欢
随机推荐
Installation record of SAP s / 4hana 2020
深度优先搜索和广度优先搜索
Leetcode-11: container with the most water
APP 莫名崩溃,开始以为是 Header 中 name 大小写的锅,最后发现原来是容器的错!
Leetcode-15: sum of three numbers
Several common playing methods of sub database and sub table and how to solve the problem of cross database query
Web上的分享(Share)API
This program cannot be started because msvcp120.dll is missing from your computer. Try to install the program to fix the problem
How to get started with rabbitmq
1. What does the operating system do?
Detailed analysis of OpenGL es framework (8) -- OpenGL es Design Guide
Android emulator error: x86 emulation currently requires hardware acceleration solution
Save code
Operation 2020.11.7-8
Concurrent linked queue: a non blocking unbounded thread safe queue
Programmers should know the URI, a comprehensive understanding of the article
How does semaphore, a thread synchronization tool that uses an up counter, look like?
老大问我:“建表为啥还设置个自增 id ?用流水号当主键不正好么?”
Bifrost 之 文件队列(一)
失业日志 11月5日








