package com.persagy.proxy.adm.controller; import com.persagy.dmp.common.exception.BusinessException; import com.persagy.proxy.adm.model.AdmModelRel; import com.persagy.proxy.adm.request.AdmResponse; import com.persagy.proxy.adm.service.IAdmModelRelService; import com.persagy.proxy.adm.utils.AdmContextUtil; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; 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 java.util.List; /** * @ClassName AdmModelRelController * @Description: 模型修改设备元空间的建筑楼层信息 * @Author linhuili * @Date 2021/8/31 14:30 * @Version V1.0 **/ @RestController @RequestMapping("/rel/update") @Slf4j public class AdmModelRelController { @Value("${middleware.group.code}") private String groupCode; @Autowired private IAdmModelRelService service; /** * 模型修改设备元空间的建筑楼层信息 * @param admModelRel * @return * @throws Exception */ @PostMapping("/equip-ispace") public AdmResponse update(@RequestBody AdmModelRel admModelRel) throws Exception { if(StringUtils.isEmpty(admModelRel.getModelId())){ throw new BusinessException("模型ID不能为空"); } if(StringUtils.isEmpty(admModelRel.getFloorId())){ throw new BusinessException("楼层ID不能为空"); } List vos = service.doUpdateModelInfo(AdmContextUtil.toDmpContext(), AdmModelRel.class,admModelRel); return AdmResponse.success(vos); } }