当前位置:网站首页>Internship: interface case implementation
Internship: interface case implementation
2022-06-30 04:19:00 【ahyo】
Following the previous demo When it's done Two copies of data were given , Both are json Format . Two interfaces are required return json Format data .
The essence : Two interfaces can be written under the same class , Run input url Output json Format data .
package com.hyd.daring.api;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hyd.daring.common.response.ResponseData;
import com.hyd.daring.model.module.ModuleScheduleInfo;
import com.hyd.daring.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/** * * demo Interface case * * @author yyp */
@RequestMapping("/Demo")
@RestController
@Api(tags = "demo 1/2")
@Validated
@Slf4j
public class Demo {
@Resource
private IBizTunnelService iBizTunnelService;
@RequestMapping(value = "/arg",method = RequestMethod.GET)
@ApiOperation(value = " Get the parameter settings ")
@ApiOperationSupport(order = 1)
public ResponseData<List<ModuleScheduleInfo>> moduleScheduleInfo ()
{
return new ResponseData<>(iBizTunnelService.moduleScheduleInfo());
}
@RequestMapping(value = "/arg1",method = RequestMethod.GET)
@ApiOperation(value = " Detailed coordinate parameters ")
@ApiOperationSupport(order=2)
public ResponseData<List<Map>> listResponseData()
{
return new ResponseData<>(iBizTunnelService.arg2());
}
}
public List<Map> arg2() {
List<Map> list=new ArrayList<>();
String[] str=new String[5];
str[0]="ybgg";
str[1]="zfxjj";
str[2]="gyzcjy";
str[3]="shbzjj";
str[4]="total";
Double[] doubles=new Double[5];
doubles[0]=137631.17;
doubles[1]=1404.3;
doubles[2]=0.29;
doubles[3]=0.0;
doubles[4]=139035.76;
Map<String,Object[]> map=new HashMap<>();
Map<String,Double>[] maps=new Map[3];
for (int i = 0; i < 3; i++) {
maps[i]=new HashMap<>();
}
for (int i = 0; i < 3; i++) {
if(i==0)
{
for (int j = 0; j <5; j++) {
maps[i].put(str[j],doubles[j]);
}
}
else
{
for (int k = 0; k <5; k++) {
maps[i].put(str[k],0.0);
}
}
}
Integer[] integers=new Integer[3];
integers[0]=2022;
integers[1]=2021;
integers[2]=2020;
map.put("xaxis",integers);
map.put("yaxis1",maps);
map.put("yaxis2",maps);
list.add(map);
return list;
}
}
边栏推荐
- 第十二天 进阶编程技术
- 在大厂外包呆了三年,颠覆了我的认知!
- After the win10 system uses the browser to download, the content is moved or deleted without reason
- 第九天 脚本與資源管理
- iMile 利用 Zadig 多云环境周部署千次,跨云跨地域持续交付全球业务
- Robot slam navigation core technology and practice Season 1: Chapter 0_ Slam development overview
- el-upload上傳文件(手動上傳,自動上傳,上傳進度)
- Es2016 key summary
- JS generator
- Project safety and quality
猜你喜欢

When easycvr deploys a server cluster, what is the reason why one is online and the other is offline?
![Blue Bridge Cup: magic cube rotation [Vocational group]](/img/ba/aeae2744f3aaa1052b5af452f990e2.jpg)
Blue Bridge Cup: magic cube rotation [Vocational group]

MySQL DDL change
![[fuzzy neural network prediction] water quality prediction based on fuzzy neural network, including Matlab source code](/img/88/038826ec6d16c8eb04d9ef2e01d47a.png)
[fuzzy neural network prediction] water quality prediction based on fuzzy neural network, including Matlab source code

Interview topic of MySQL

DBT product initial experience

Grasp grpc communication framework in simple terms

dotnet-exec 0.5.0 released

A solution to the problem of "couldn't open file /mnt/repodata/repomd.xml"

第九天 脚本与资源管理
随机推荐
01 backpack, dynamic planning
Implementation of aut, a self-developed transport layer protocol for sound network -- dev for dev column
The school training needs to make a registration page. It needs to open the database and save the contents entered on the registration page into the database
深度融合云平台,对象存储界的“学霸”ObjectScale来了
A solution to the problem of "couldn't open file /mnt/repodata/repomd.xml"
Ora-00907: missing right parenthesis problem supplement
FortiGate creates multiple corresponding DDNS dynamic domain names for multiple ADSL interfaces
Educoder group purchase suspension box page production
[Thesis reading | deep reading] dane:deep attributed network embedding
Explain the underlying principles of JVM garbage collection in simple terms
Named pipes for interprocess communication
网络层详解
Node red series (28): communication with Siemens PLC based on OPC UA node
Day 12 advanced programming techniques
Thinkphp5 implements import function
mysql更新数组形式的json串
Concatenation of Languages(UVA10887)
Refers to the difference between IP and *ip at output
An error occurs when sqlyog imports the database. Please help solve it!
各位大佬,flink 1.13.6,mysql-cdc2.2.0,抽取上来的datetime(6)类