当前位置:网站首页>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;
}
}
边栏推荐
- Educoder group purchase suspension box page production
- Iterator of JS
- Thinkphp5 implements import function
- idea灰屏问题
- 7-3 single source shortest circuit for strange play upgrade
- base64.c
- Implementation steps of dynamic proxy
- A solution to the problem of "couldn't open file /mnt/repodata/repomd.xml"
- JS reflect
- 深度融合云平台,对象存储界的“学霸”ObjectScale来了
猜你喜欢

About manipulator on Intelligent Vision Group

Huawei cloud native - data development and datafactory

Educoder group purchase suspension box page production

Myrpc version 2

Basic knowledge of redis

(03). Net Maui actual combat basic control

Explain the underlying principles of JVM garbage collection in simple terms

第十二天 进阶编程技术

DBT product initial experience

el-upload上傳文件(手動上傳,自動上傳,上傳進度)
随机推荐
idea灰屏问题
技术分享| 融合调度中的广播功能设计
JS proxy
Unity 在编辑器中输入字符串时,转义字符的输入
[fuzzy neural network prediction] water quality prediction based on fuzzy neural network, including Matlab source code
Detailed explanation of data link layer
FortiGate creates multiple corresponding DDNS dynamic domain names for multiple ADSL interfaces
Detailed explanation of network layer
【WEBRTC】ADM: rtc_include_internal_audio_device 触发 RTC_DCHECK(adm) 断言
Clients accessing the daytime service (TCP)
With the deep integration of cloud platform, the "Xueba" objectscale in the object storage industry is coming
dotnet-exec 0.5.0 released
Configure specific source IP in SLA detection of FortiGate sdwan
Myrpc version 0
Qt 6.3.1Conan软件包发布
Knowledge - how to build rapport in sales with 3 simple skills
Indefinite parameters of JS function
第十天 数据的保存与加载
Jour 9 Gestion des scripts et des ressources
Day 12 advanced programming techniques