package com.persagy.proxy.report.controller;

import com.persagy.proxy.adm.request.AdmResponse;
import com.persagy.proxy.dictionary.service.IAdmGraphicTypeService;
import com.persagy.proxy.adm.utils.AdmContextUtil;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.ws.rs.QueryParam;

/**
 * ADM 窗户 API
 * @author xujiaheng
 * @date 2021-09-3
 */
@RestController
@RequestMapping("/rel")
public class AdmRelationController {

    @Autowired
    private IAdmGraphicTypeService service;

    /**
     * 创建
     * @param
     * @return
     * @throws Exception
     */
    @PostMapping("/equip/category")
    public AdmResponse equipRel(@QueryParam("projectId") String projectId) {
        //组装上下文条件
        InstanceUrlParam context = AdmContextUtil.toDmpContext();
        AdmResponse res = service.query(context);
        return res;
    }
}
