123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- package com.persagy.proxy.adm.controller;
- import cn.hutool.core.util.StrUtil;
- import com.alibaba.fastjson.JSONArray;
- import com.persagy.proxy.adm.model.AdmModelKey;
- import com.persagy.proxy.adm.request.AdmQueryCriteria;
- import com.persagy.proxy.adm.request.AdmResponse;
- import com.persagy.proxy.adm.service.IAdmModelKeyService;
- import com.persagy.proxy.adm.utils.AdmContextUtil;
- import com.persagy.proxy.common.entity.DmpResult;
- import com.persagy.proxy.common.entity.InstanceUrlParam;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.beans.factory.annotation.Value;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- /**
- * 模型操作
- * @author lvxy
- * @date 2021/8/25
- */
- @RestController
- @RequestMapping("/model")
- public class AdmModelController {
- @Autowired
- private IAdmModelKeyService service;
- @Value("${middleware.group.code}")
- private String groupCode;
- /**
- * 模型文件下载地址 key
- */
- @PostMapping("/key")
- public AdmResponse count(@RequestBody AdmQueryCriteria request) {
- InstanceUrlParam context = AdmContextUtil.toDmpContext();
- if(StrUtil.isBlank(context.getProjectId())) {
- return AdmResponse.failure("项目 id 不能为空");
- }
- DmpResult<JSONArray> result = service.doQuery(context, request);
- return AdmResponse.fromDmp(request, result, AdmModelKey.class);
- }
- }
|