|
@ -1,9 +1,9 @@
|
|
package com.yihu.iot.controller.platform;
|
|
package com.yihu.iot.controller.platform;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
|
import com.yihu.iot.service.platform.IotInterfaceLogService;
|
|
import com.yihu.iot.service.platform.IotShareInterfaceService;
|
|
import com.yihu.iot.service.platform.IotShareInterfaceService;
|
|
import com.yihu.jw.entity.iot.platform.IotShareInterfaceDO;
|
|
import com.yihu.jw.entity.iot.platform.IotShareInterfaceDO;
|
|
import com.yihu.jw.restmodel.iot.company.IotCompanyVO;
|
|
|
|
|
|
import com.yihu.jw.restmodel.iot.platform.IotInterfaceLogVO;
|
|
import com.yihu.jw.restmodel.web.MixEnvelop;
|
|
import com.yihu.jw.restmodel.web.MixEnvelop;
|
|
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
|
|
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
|
|
import com.yihu.jw.rm.iot.IotRequestMapping;
|
|
import com.yihu.jw.rm.iot.IotRequestMapping;
|
|
@ -11,12 +11,7 @@ import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiParam;
|
|
import io.swagger.annotations.ApiParam;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @author HZY
|
|
* @author HZY
|
|
@ -31,6 +26,10 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
|
|
@Autowired
|
|
@Autowired
|
|
private IotShareInterfaceService iotShareInterfaceService;
|
|
private IotShareInterfaceService iotShareInterfaceService;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private IotInterfaceLogService iotInterfaceLogService;
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = IotRequestMapping.Platform.addInterface)
|
|
@PostMapping(value = IotRequestMapping.Platform.addInterface)
|
|
@ApiOperation(value = "新增共享接口",notes = "新增共享接口")
|
|
@ApiOperation(value = "新增共享接口",notes = "新增共享接口")
|
|
public MixEnvelop<IotShareInterfaceDO,IotShareInterfaceDO> addInterface(@ApiParam(name = "JSON",value = "接口JSON串") @RequestParam(value = "JSON",required = true)String json){
|
|
public MixEnvelop<IotShareInterfaceDO,IotShareInterfaceDO> addInterface(@ApiParam(name = "JSON",value = "接口JSON串") @RequestParam(value = "JSON",required = true)String json){
|
|
@ -97,6 +96,24 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = IotRequestMapping.Platform.delete)
|
|
|
|
@ApiOperation(value = "根据ID删除共享接口",notes = "根据ID删除共享接口")
|
|
|
|
public MixEnvelop<IotShareInterfaceDO,IotShareInterfaceDO> deleteById(@ApiParam(name = "id", value = "ID", defaultValue = "")
|
|
|
|
@RequestParam(value = "id", required = false) String id){
|
|
|
|
|
|
|
|
try {
|
|
|
|
iotShareInterfaceService.deleteById(id);
|
|
|
|
return MixEnvelop.getSuccess(IotRequestMapping.Platform.message_success_delete);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
return MixEnvelop.getError(e.getMessage());
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = IotRequestMapping.Platform.conditionQueryPage)
|
|
@PostMapping(value = IotRequestMapping.Platform.conditionQueryPage)
|
|
@ApiOperation(value = "条件查询分页",notes = "条件查询分页")
|
|
@ApiOperation(value = "条件查询分页",notes = "条件查询分页")
|
|
public MixEnvelop<IotShareInterfaceDO,IotShareInterfaceDO> conditionQueryPage(@ApiParam(name = "type", value = "业务类型", defaultValue = "")
|
|
public MixEnvelop<IotShareInterfaceDO,IotShareInterfaceDO> conditionQueryPage(@ApiParam(name = "type", value = "业务类型", defaultValue = "")
|
|
@ -123,4 +140,53 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = IotRequestMapping.Platform.findAllLog)
|
|
|
|
@ApiOperation(value = "分页查询所有接口日志信息",notes = "分页查询所有接口日志信息")
|
|
|
|
public MixEnvelop<IotInterfaceLogVO,IotInterfaceLogVO> findAllLog(@ApiParam(name = "page", value = "第几页", defaultValue = "")
|
|
|
|
@RequestParam(value = "page", required = false) Integer page,
|
|
|
|
@ApiParam(name = "size", value = "每页记录数", defaultValue = "")
|
|
|
|
@RequestParam(value = "size", required = false) Integer size){
|
|
|
|
|
|
|
|
try {
|
|
|
|
if(page == null|| page < 0){
|
|
|
|
page = 1;
|
|
|
|
}
|
|
|
|
if(size == null){
|
|
|
|
size = 10;
|
|
|
|
}
|
|
|
|
return iotInterfaceLogService.findAll(page,size);
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
return MixEnvelop.getError(e.getMessage());
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@GetMapping(value = IotRequestMapping.Platform.dataConsumption)
|
|
|
|
@ApiOperation(value = "接口数据消费分页查询",notes = "接口数据消费分页查询")
|
|
|
|
public MixEnvelop<IotInterfaceLogVO,IotInterfaceLogVO> dataConsumption(@ApiParam(name = "page", value = "第几页", defaultValue = "")
|
|
|
|
@RequestParam(value = "page", required = false) Integer page,
|
|
|
|
@ApiParam(name = "size", value = "每页记录数", defaultValue = "")
|
|
|
|
@RequestParam(value = "size", required = false) Integer size){
|
|
|
|
|
|
|
|
try {
|
|
|
|
if(page == null|| page < 0){
|
|
|
|
page = 1;
|
|
|
|
}
|
|
|
|
if(size == null){
|
|
|
|
size = 10;
|
|
|
|
}
|
|
|
|
return iotInterfaceLogService.dataConsumption(page,size);
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
return MixEnvelop.getError(e.getMessage());
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|