Commit 4bfc8b2e authored by mcb's avatar mcb

no message

parent 0b6d8222
......@@ -125,4 +125,96 @@ public class DmpApiMangeController {
}
return jsonResult;
}
/**
* 根据apiid获取API详情
*
* @author Bellamy
* @since 2021-01-19
*/
@ApiOperation(value = "获取API详情", notes = "获取API详情")
@GetMapping(value = "/getApiInfo")
@ApiImplicitParam(name = "id", value = "ApiId", required = true)
public JsonResult getApiInfoByApiId(@RequestParam String id, HttpServletRequest httpRequest) {
if (StringUtils.isEmpty(id)) {
return JsonResult.error(ResultCode.PARAMS_ERROR, "apiId不能为空!");
}
JsonResult jsonResult = new JsonResult();
try {
jsonResult = dmpApiMangeService.queryApiInfoByApiId(id);
} catch (Exception e) {
jsonResult.setMessage(e.getMessage());
jsonResult.setCode(ResultCode.INTERNAL_SERVER_ERROR);
e.printStackTrace();
}
return jsonResult;
}
/**
* 授权给组织-提交保存
*
* @author Bellamy
* @since 2021-01-19
*/
@ApiOperation(value = "授权给组织-提交保存", notes = "授权给组织-提交保存")
@PostMapping(value = "/addApiAuthToOrg")
public JsonResult addApiAuthToOrg(@RequestBody @Validated AuthUserApiReq req, HttpServletRequest httpRequest) {
JsonResult jsonResult = new JsonResult();
try {
jsonResult = dmpApiMangeService.addApiAuthToOrg(req);
} catch (Exception e) {
jsonResult.setMessage(e.getMessage());
jsonResult.setCode(ResultCode.INTERNAL_SERVER_ERROR);
e.printStackTrace();
}
return jsonResult;
}
/**
* API测试
*
* @author Bellamy
* @since 2021-01-19
*/
@ApiOperation(value = "API测试", notes = "API测试")
@GetMapping(value = "/apiTestInfo")
@ApiImplicitParam(name = "apiKey", value = "apiKey", required = true)
public JsonResult getApiTestInfo(@RequestParam String apiKey, HttpServletRequest httpRequest) {
if (StringUtils.isEmpty(apiKey)) {
return JsonResult.error(ResultCode.PARAMS_ERROR, "apiKey不能为空!");
}
JsonResult jsonResult = new JsonResult();
try {
jsonResult = dmpApiMangeService.apiTestInfo(apiKey);
} catch (Exception e) {
jsonResult.setMessage(e.getMessage());
jsonResult.setCode(ResultCode.INTERNAL_SERVER_ERROR);
e.printStackTrace();
}
return jsonResult;
}
/**
* 查看日志
*
* @author Bellamy
* @since 2021-01-19
*/
@ApiOperation(value = "查看日志", notes = "查看日志")
@PostMapping(value = "/checkApiLogInfo")
public JsonResult checkApiLogInfo(@RequestBody LogInfoListReq req, HttpServletRequest httpRequest) {
if (StringUtils.isEmpty(req.getApiKey())) {
return JsonResult.error(ResultCode.PARAMS_ERROR, "apiKey不能为空!");
}
JsonResult jsonResult = new JsonResult();
try {
jsonResult = dmpApiMangeService.checkApiLogInfo(req);
} catch (Exception e) {
jsonResult.setMessage(e.getMessage());
jsonResult.setCode(ResultCode.INTERNAL_SERVER_ERROR);
e.printStackTrace();
}
return jsonResult;
}
}
\ No newline at end of file
package com.jz.dmp.modules.controller.dataService.bean;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
/**
* @ClassName: AuthUserApiReq
* @Description: API认证授权
* @Author: Bellamy
* @Date 2021/1/19
* @Version 1.0
*/
@Data
@ApiModel("API认证授权")
public class AuthUserApiReq implements Serializable {
@ApiModelProperty(value = "apiKey唯一标识",required = true)
@NotNull(message = "apiKey唯一标识不能为空")
@NotEmpty(message = "apiKey唯一标识不能为空")
private String apiKey;
@ApiModelProperty(value = "组织编码",required = true)
@NotNull(message = "组织编码不能为空")
@NotEmpty(message = "组织编码不能为空")
private String orgCode;
@ApiModelProperty(value = "授权方式:POWER_CALL_MODE 按次调用 ,RECORD_TIME_MODE 按时间调用,PERMANENT_TIME_MODE 永久有效",required = true)
@NotNull(message = "授权方式不能为空")
private String authMode;
@ApiModelProperty(value = "创建用户",required = false)
private String createUser;
}
package com.jz.dmp.modules.controller.dataService.bean;
import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @ClassName: AuthListInfoReq
* @Description: 日志信息列表请求对象
* @Author: Bellamy
* @Date 2021/1/18
* @Version 1.0
*/
@Data
@ApiModel("日志信息列表请求对象")
public class LogInfoListReq extends BasePageBean implements Serializable {
@ApiModelProperty(value = "ApiKey")
private String apiKey;
}
......@@ -42,5 +42,37 @@ public interface DmpApiMangeService {
* @author Bellamy
* @since 2021-01-18
*/
JsonResult delApiInfo(String apiKey,String type) throws Exception;
JsonResult delApiInfo(String apiKey, String type) throws Exception;
/**
* 根据apiid获取API详情
*
* @author Bellamy
* @since 2021-01-19
*/
JsonResult queryApiInfoByApiId(String id) throws Exception;
/**
* 授权给组织-提交保存
*
* @author Bellamy
* @since 2021-01-19
*/
JsonResult addApiAuthToOrg(AuthUserApiReq req) throws Exception;
/**
* API测试
*
* @author Bellamy
* @since 2021-01-19
*/
JsonResult apiTestInfo(String apiKey) throws Exception;
/**
* 查看日志
*
* @author Bellamy
* @since 2021-01-19
*/
JsonResult checkApiLogInfo(LogInfoListReq req) throws Exception;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment