当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- Investigation of solutions to rabbitmq cleft brain problem
- Dark网站的后端为什么选择F#? - darklang
- 服务网格仍然很难 - cncf
- Linked blocking queue based on linked list
- The vowels in the inverted string of leetcode
- 商品管理系统——SPU检索功能
- How to get started with rabbitmq
- 理论与实践相结合彻底理解CORS
- 使用递增计数器的线程同步工具 —— 信号量,它的原理是什么样子的?
- File queue in Bifrost (1)
猜你喜欢
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 设计指南
Web上的分享(Share)API
《MFC dialog中加入OpenGL窗体》
2.计算机硬件简介
Linked blocking queue based on linked list
2020,Android开发者打破寒冬的利器是什么?
作业2020.11.7-8
Concurrent linked queue: a non blocking unbounded thread safe queue
随机推荐
RabbitMQ快速入门详解
android开发中提示:requires permission android.permission write_settings解决方法
In 2020, what are the best tools for Android developers to break the cold winter?
3.你知道计算机是如何启动的吗?
Have you ever thought about why the transaction and refund have to be split into different tables
深度优先搜索和广度优先搜索
EasyNTS上云网关设备在雪亮工程项目中的实战应用
Android emulator error: x86 emulation currently requires hardware acceleration solution
平台商业化能力的另一种表现形式SAAS
当我们聊数据质量的时候,我们在聊些什么?
2 普通模式
Apache Iceberg 中三种操作表的方式
GDI 及OPENGL的区别
How does semaphore, a thread synchronization tool that uses an up counter, look like?
Several common playing methods of sub database and sub table and how to solve the problem of cross database query
Teacher Liang's small class
Concurrent linked queue: a non blocking unbounded thread safe queue
Several rolling captions based on LabVIEW
2. Introduction to computer hardware
Chapter 5 programming