feat(device): 添加设备类型管理功能

- 在Device实体中添加了deviceType字段,并使用@TableField注解标记为非数据库字段
- 新增DeviceType实体类,用于表示设备类型信息
- 创建DeviceTypeController控制器,提供获取所有设备类型的接口
- 新增DeviceTypeService接口及其实现类DeviceTypeServiceImpl,实现设备类型相关业务逻辑
- 添加DriveTypeMapper接口,继承BaseMapper以支持对DeviceType的数据库操作
- 在ErrorCode常量类中增加了设备相关的错误码:DEVICE_NOT_FOUND和DEVICE_TYPE_NOT_FOUND
- 更新DeviceController,引入DeviceTypeResponse并优化代码结构
- 在DeviceMapper中新增selectOneWithTypeById方法,通过MyBatis注解实现关联查询设备及其类型信息
This commit is contained in:
Chaos
2025-11-21 06:54:12 +08:00
parent e23434ab48
commit 72a1e4d309
12 changed files with 190 additions and 2 deletions

View File

@@ -10,4 +10,11 @@ public interface DeviceService {
* @return 新建设备信息结果
*/
DeviceResponse createDevice(CreateDriveRequest createDriveRequest);
/**
* 根据id查询设备信息
* @param id 设备id
* @return 设备信息
*/
DeviceResponse getDeviceById(Long id);
}

View File

@@ -0,0 +1,13 @@
package cn.nopj.chaos_api.service;
import cn.nopj.chaos_api.dto.response.DeviceTypeResponse;
import java.util.List;
public interface DeviceTypeService {
/**
* 获取所有设备类型
* @return 所有设备类型
*/
List<DeviceTypeResponse> getAllDeviceTypes();
}