当前位置:网站首页>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));
}
边栏推荐
- internship:完成新功能增设接口
- EMQX 5.0 发布:单集群支持 1 亿 MQTT 连接的开源物联网消息服务器
- Installing and using mpi4py
- The bank needs to build the middle office capability of the intelligent customer service module to drive the upgrade of the whole scene intelligent customer service
- 非分区表转换成分区表以及注意事项
- JVM memory and garbage collection-3-direct memory
- Force buckle 5_ 876. Intermediate node of linked list
- 1331:【例1-2】后缀表达式的值
- From starfish OS' continued deflationary consumption of SFO, the value of SFO in the long run
- Direct addition is more appropriate
猜你喜欢
JVM memory and garbage collection-3-object instantiation and memory layout
实现前缀树
云原生应用开发之 gRPC 入门
Deeppath: a reinforcement learning method of knowledge graph reasoning
Spock单元测试框架介绍及在美团优选的实践_第四章(Exception异常处理mock方式)
Key points of data link layer and network layer protocol
Thread deadlock -- conditions for deadlock generation
Deep understanding of softmax
Face based_ Recognition for face key point detection (1)
关于TXE和TC标志位的小知识
随机推荐
idea窗口不折叠
Deep understanding of softmax
JVM memory and garbage collection-3-direct memory
th:include的使用
#797div3 A---C
UFS Power Management 介绍
[knowledge atlas paper] minerva: use reinforcement learning to infer paths in the knowledge base
How does the bull bear cycle and encryption evolve in the future? Look at Sequoia Capital
VIM use
非分区表转换成分区表以及注意事项
Learn face detection from scratch: retinaface (including magic modified ghostnet+mbv2)
Popular science | what is soul binding token SBT? What is the value?
Leetcode question brushing record | 485_ Maximum number of consecutive ones
#797div3 A---C
生命的高度
Interpretation of classic paper on model pruning: learning efficient revolutionary networks through network slimming
Le chemin du poisson et des crevettes
Spock单元测试框架介绍及在美团优选的实践_第四章(Exception异常处理mock方式)
Beaucoup d'enfants ne savent pas grand - chose sur le principe sous - jacent du cadre orm, non, ice River vous emmène 10 minutes à la main "un cadre orm minimaliste" (collectionnez - le maintenant)
力扣5_876. 链表的中间结点