|
@@ -5,6 +5,7 @@ import com.github.pagehelper.PageInfo;
|
|
|
import com.museum.common.util.Result;
|
|
|
import com.museum.domain.entity.PartEntity;
|
|
|
import com.museum.domain.entity.RoamEntity;
|
|
|
+import com.museum.domain.entity.TypeEntity;
|
|
|
import com.museum.domain.request.*;
|
|
|
import com.museum.domain.response.RoamResponse;
|
|
|
import com.museum.service.PartService;
|
|
@@ -83,14 +84,22 @@ public class RoamController extends BaseController {
|
|
|
|
|
|
@ApiOperation("详情")
|
|
|
@GetMapping("detail/{id}")
|
|
|
- public Result<RoamEntity> detail(@PathVariable Long id) {
|
|
|
+ public Result<RoamResponse> detail(@PathVariable Long id) {
|
|
|
RoamEntity entity = roamService.findById(id);
|
|
|
|
|
|
if (entity == null) {
|
|
|
log.error("对象不存在: {}", id);
|
|
|
return Result.failure("对象不存在");
|
|
|
}
|
|
|
- return Result.success(entity);
|
|
|
+
|
|
|
+ RoamResponse roamResponse = new RoamResponse();
|
|
|
+ BeanUtils.copyProperties(entity, roamResponse);
|
|
|
+
|
|
|
+ TypeEntity typeEntity = typeService.findById(entity.getTypeId());
|
|
|
+ String typeName = typeEntity != null ? typeEntity.getName() : "";
|
|
|
+ roamResponse.setTypeName(typeName);
|
|
|
+
|
|
|
+ return Result.success(roamResponse);
|
|
|
}
|
|
|
|
|
|
@WebControllerLog(description = "部件管理-删除")
|