当前位置:网站首页>internship:完成新功能增設接口
internship:完成新功能增設接口
2022-07-08 02:21: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));
}
边栏推荐
- Mqtt x newsletter 2022-06 | v1.8.0 release, new mqtt CLI and mqtt websocket tools
- hutool工具类的使用,国内自己封装的工具包,挺好用的
- Interpretation of classic paper on model pruning: learning efficient revolutionary networks through network slimming
- BizDevOps与DevOps的关系
- CorelDRAW2022下载安装电脑系统要求技术规格
- 力扣5_876. 链表的中间结点
- Infrared dim small target detection: common evaluation indicators
- COMSOL --- construction of micro resistance beam model --- final temperature distribution and deformation --- addition of materials
- leetcode 866. Prime Palindrome | 866. prime palindromes
- 1331:【例1-2】后缀表达式的值
猜你喜欢

实现前缀树

Industrial Development and technological realization of vr/ar

喜欢测特曼的阿洛

Basic operation of color histogram
![[knowledge map paper] Devine: a generative anti imitation learning framework for knowledge map reasoning](/img/c1/4c147a613ba46d81c6805cdfd13901.jpg)
[knowledge map paper] Devine: a generative anti imitation learning framework for knowledge map reasoning

牛熊周期与加密的未来如何演变?看看红杉资本怎么说

UFS Power Management 介绍

leetcode 866. Prime Palindrome | 866. prime palindromes

Learn CV two loss function from scratch (2)

Gaussian filtering and bilateral filtering principle, matlab implementation and result comparison
随机推荐
Leetcode question brushing record | 27_ Removing Elements
hutool工具类的使用,国内自己封装的工具包,挺好用的
Leetcode featured 200 -- linked list
文盘Rust -- 给程序加个日志
Deep understanding of cross entropy loss function
JVM memory and garbage collection-3-runtime data area / heap area
LeetCode精选200道--链表篇
Leetcode featured 200 channels -- array article
咋吃都不胖的朋友,Nature告诉你原因:是基因突变了
Completion report of communication software development and Application
Principle of least square method and matlab code implementation
image enhancement
See how names are added to namespace STD from cmath file
EMQX 5.0 发布:单集群支持 1 亿 MQTT 连接的开源物联网消息服务器
谈谈 SAP iRPA Studio 创建的本地项目的云端部署问题
Infrared dim small target detection: common evaluation indicators
力扣4_412. Fizz Buzz
Leetcode question brushing record | 283_ Move zero
入侵检测——jsql
Thread deadlock -- conditions for deadlock generation