当前位置:网站首页>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));
}
边栏推荐
- The circuit is shown in the figure, r1=2k Ω, r2=2k Ω, r3=4k Ω, rf=4k Ω. Find the expression of the relationship between output and input.
- OpenGL/WebGL着色器开发入门指南
- 【每日一题】736. Lisp 语法解析
- Infrared dim small target detection: common evaluation indicators
- 企业培训解决方案——企业培训考试小程序
- leetcode 865. Smallest Subtree with all the Deepest Nodes | 865.具有所有最深节点的最小子树(树的BFS,parent反向索引map)
- Yolov5 lite: how to speed up the Yolo model on CPU?
- Learn face detection from scratch: retinaface (including magic modified ghostnet+mbv2)
- #797div3 A---C
- Deep understanding of cross entropy loss function
猜你喜欢
咋吃都不胖的朋友,Nature告诉你原因:是基因突变了
Talk about the realization of authority control and transaction record function of SAP system
Learn face detection from scratch: retinaface (including magic modified ghostnet+mbv2)
Basic operation of color histogram
云原生应用开发之 gRPC 入门
1385:团伙(group)
COMSOL --- construction of micro resistance beam model --- final temperature distribution and deformation --- addition of materials
#797div3 A---C
Opengl/webgl shader development getting started guide
JVM memory and garbage collection -4-string
随机推荐
Yolov5 Lite: experiment and thinking of repovgg re parameterization on the industrial landing of Yolo
In depth understanding of the se module of the attention mechanism in CV
【每日一题】648. 单词替换
Popular science | what is soul binding token SBT? What is the value?
OpenGL/WebGL着色器开发入门指南
[knowledge map paper] r2d2: knowledge map reasoning based on debate dynamics
Applet running under the framework of fluent 3.0
Yolov5 lite: how to speed up the Yolo model on CPU?
鱼和虾走的路
XMeter Newsletter 2022-06|企业版 v3.2.3 发布,错误日志与测试报告图表优化
See how names are added to namespace STD from cmath file
Opencv face detection Haar cascade (1)
《通信软件开发与应用》课程结业报告
需要思考的地方
Which detector is more important, backbone or neck? The new work of Dharma hall has different answers
mysql报错ORDER BY clause is not in SELECT list, references column ‘‘which is not in SELECT list解决方案
Deeppath: a reinforcement learning method of knowledge graph reasoning
常见的磁盘格式以及它们之间的区别
喜欢测特曼的阿洛
Completion report of communication software development and Application