package com.persagy.proxy.adm.controller; import com.persagy.proxy.adm.constant.AdmCommonConstant; import com.persagy.proxy.adm.model.AdmObjectInfo; import com.persagy.proxy.adm.model.AdmObjectType; import com.persagy.proxy.adm.request.AdmResponse; import com.persagy.proxy.adm.service.IAdmLabslService; import com.persagy.proxy.adm.utils.AdmContextUtil; import com.persagy.proxy.common.entity.InstanceUrlParam; import lombok.extern.slf4j.Slf4j; 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; import javax.ws.rs.QueryParam; import java.util.List; /** * @ClassName AdmLabslController * @Description: 蜡笔森林定制接口 * @Author linhuili * @Date 2021/9/17 20:01 * @Version V1.0 **/ @RestController @RequestMapping("/labsl") @Slf4j public class AdmLabslController { @Autowired private IAdmLabslService service; @Value("${middleware.group.code}") private String groupCode; /** * 查询项目下的设备类型 * @return * @throws Exception */ @PostMapping("/category") public AdmResponse queryCategory() throws Exception { InstanceUrlParam context = AdmContextUtil.toDmpContext(); return service.queryCategory(context, AdmObjectInfo.class); } /** * 查询项目下的空间类型 * @return * @throws Exception */ @PostMapping("/zone/type") public AdmResponse queryZoneType() throws Exception { InstanceUrlParam context = AdmContextUtil.toDmpContext(); return service.queryZoneType(context, AdmObjectInfo.class); } /** * 查询项目下的建筑楼层 * @return * @throws Exception */ @PostMapping("/building/floor") public AdmResponse queryBuildFloor(@QueryParam("projectId") String projectId) throws Exception { InstanceUrlParam context = AdmContextUtil.toDmpContext(); return service.queryBuildFloor(context, AdmObjectInfo.class); } /** * 查询设备包含设备类型 * @return * @throws Exception */ @PostMapping("/query/equip") public AdmResponse queryEquipType(@QueryParam("projectId") String projectId) throws Exception { InstanceUrlParam context = AdmContextUtil.toDmpContext(); return service.queryBuildFloor(context, AdmObjectInfo.class); } /** * 根据设备id统计设备所属的专业 * @return * @throws Exception */ @PostMapping("/major/category") public AdmResponse queryMajorCategory(@QueryParam("projectId") String projectId, @RequestBody List ids) throws Exception { InstanceUrlParam context = AdmContextUtil.toDmpContext(); return service.queryMajorCategory(context, ids , AdmObjectType.class); } }