当前位置:网站首页>internship:完成新功能增设接口
internship:完成新功能增设接口
2022-07-08 01:13:00 【ahyo】
后端就是为前端提供接口文档数据,至于网页的页面布局不需要后端去实现,只管页面所呈现的数据即可,以及再那些模块需要返回数据。
对于新增功能界面的接口写法 创建service层和controller层时,对应继承的MyBatis-plus所准备的工具类的泛型中的mapper是不一样的。也就是 一个service接口对应一个Impl。
编写相关的类作为接口的实现基础:
@Service
public class BizScheduleRecordServiceImplDemo extends ServiceImpl<BizScheduleRecordMapper, BizScheduleRecord> implements IBizScheduleRecordServiceDemo {
@Resource
private BizTunnelMapper tunnelMapper;
@Override
public ScheduleInfoModelDemo jinchiInfo(Integer tunnelId) {
BizTunnel tunnel = tunnelMapper.selectById(tunnelId);
ScheduleInfoModelDemo demo=new ScheduleInfoModelDemo();
demo.setTunnelId(tunnelId);
demo.setTunnelName(tunnel.getName());
demo.setLength(7.0);
if(tunnel.getName().equals(""))
{
ScheduleInfoModelDemo.DataDetail dataDetail=new ScheduleInfoModelDemo.DataDetail();
dataDetail.setZhangzmRatio(0.50)
.setErcRatio(0.50)
.setErceWholejinchi(3171)
.setZzmWholejinchi(3171);
demo.setPdx(dataDetail);
demo.setPdd(dataDetail);
}
if(tunnel.getName().equals(""))
{
ScheduleInfoModelDemo.DataDetail dataDetail=new ScheduleInfoModelDemo.DataDetail();
dataDetail.setZhangzmRatio(0.50)
.setErcRatio(0.50)
.setErceWholejinchi(3171)
.setZzmWholejinchi(3171);
demo.setEnter(dataDetail);
demo.setExit(dataDetail);
}
return demo;
}
}
接口:
@RequestMapping(value = "/**", method = RequestMethod.GET)
@ApiOperation(value = "")
@ApiOperationSupport(order = 8)
public ResponseData<ScheduleInfoModelDemo> tunnelschedule(@ApiParam(name = "tunnelId",value = "id", required = true) Integer tunnelId) {
return new ResponseData<>(scheduleRecordService.jinchiInfo(tunnelId));
}
边栏推荐
- Nmap tool introduction and common commands
- image enhancement
- Height of life
- Force buckle 4_ 412. Fizz Buzz
- 【每日一题】648. 单词替换
- XXL job of distributed timed tasks
- PHP calculates personal income tax
- JVM memory and garbage collection-3-runtime data area / method area
- Semantic segmentation | learning record (4) expansion convolution (void convolution)
- LeetCode精选200道--链表篇
猜你喜欢
UFS Power Management 介绍
Kwai applet guaranteed payment PHP source code packaging
"Hands on learning in depth" Chapter 2 - preparatory knowledge_ 2.2 data preprocessing_ Learning thinking and exercise answers
XXL job of distributed timed tasks
burpsuite
A comprehensive and detailed explanation of static routing configuration, a quick start guide to static routing
Spock单元测试框架介绍及在美团优选的实践_第二章(static静态方法mock方式)
leetcode 865. Smallest Subtree with all the Deepest Nodes | 865.具有所有最深节点的最小子树(树的BFS,parent反向索引map)
关于TXE和TC标志位的小知识
Give some suggestions to friends who are just getting started or preparing to change careers as network engineers
随机推荐
金融业数字化转型中,业务和技术融合需要经历三个阶段
常见的磁盘格式以及它们之间的区别
In depth analysis of ArrayList source code, from the most basic capacity expansion principle, to the magic iterator and fast fail mechanism, you have everything you want!!!
Random walk reasoning and learning in large-scale knowledge base
WPF custom realistic wind radar chart control
Nmap tool introduction and common commands
Many friends don't know the underlying principle of ORM framework very well. No, glacier will take you 10 minutes to hand roll a minimalist ORM framework (collect it quickly)
Introduction to Microsoft ad super Foundation
力扣6_1342. 将数字变成 0 的操作次数
分布式定时任务之XXL-JOB
Leetcode question brushing record | 485_ Maximum number of consecutive ones
Semantic segmentation | learning record (5) FCN network structure officially implemented by pytoch
Keras深度学习实战——基于Inception v3实现性别分类
Introduction to QT: video player
Le chemin du poisson et des crevettes
2022年5月互联网医疗领域月度观察
List of top ten domestic industrial 3D visual guidance enterprises in 2022
Deep understanding of cross entropy loss function
Redisson distributed lock unlocking exception
谈谈 SAP 系统的权限管控和事务记录功能的实现