feat(developer): 完善开发者选项CRUD与SN查询逻辑
This commit is contained in:
@@ -0,0 +1,117 @@
|
||||
package com.youlai.boot.device.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.youlai.boot.common.enums.ActionTypeEnum;
|
||||
import com.youlai.boot.common.enums.LogModuleEnum;
|
||||
import com.youlai.boot.common.result.PageResult;
|
||||
import com.youlai.boot.common.result.Result;
|
||||
import com.youlai.boot.device.model.form.DeveloperForm;
|
||||
import com.youlai.boot.device.model.query.DeveloperQuery;
|
||||
import com.youlai.boot.device.model.vo.DeveloperVO;
|
||||
import com.youlai.boot.device.service.DeveloperService;
|
||||
import com.youlai.boot.device.service.DeviceService;
|
||||
import com.youlai.boot.framework.annotation.Log;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 设备开发者选项前端控制层
|
||||
*
|
||||
* @author TTSTD
|
||||
* @since 2026-04-27
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Tag(name = "17.设备开发者选项")
|
||||
@RequestMapping("/api/v1/developers")
|
||||
public class DeveloperController {
|
||||
|
||||
private final DeveloperService developerService;
|
||||
|
||||
private final DeviceService deviceService;
|
||||
|
||||
@Operation(summary = "开发者选项分页列表")
|
||||
@GetMapping
|
||||
@PreAuthorize("@ss.hasPerm('device:developer:list')")
|
||||
@Log(module = LogModuleEnum.DEVICE, value = ActionTypeEnum.LIST)
|
||||
public PageResult<DeveloperVO> page(@ParameterObject DeveloperQuery queryParams) {
|
||||
IPage<DeveloperVO> result = developerService.page(queryParams);
|
||||
return PageResult.success(result);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取开发者选项表单数据")
|
||||
@GetMapping("/{id}/form")
|
||||
@PreAuthorize("@ss.hasPerm('device:developer:list')")
|
||||
public Result<DeveloperForm> getDeveloperForm(
|
||||
@Parameter(description = "开发者选项配置ID") @PathVariable Long id
|
||||
) {
|
||||
return Result.success(developerService.getDeveloperFormData(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "新增开发者选项配置")
|
||||
@PostMapping
|
||||
@PreAuthorize("@ss.hasPerm('device:developer:create')")
|
||||
@Log(module = LogModuleEnum.DEVICE, value = ActionTypeEnum.INSERT)
|
||||
public Result<?> save(@RequestBody @Valid DeveloperForm developerForm) {
|
||||
return Result.judge(developerService.saveDeveloper(developerForm));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改开发者选项配置")
|
||||
@PutMapping("/{id}")
|
||||
@PreAuthorize("@ss.hasPerm('device:developer:update')")
|
||||
@Log(module = LogModuleEnum.DEVICE, value = ActionTypeEnum.UPDATE)
|
||||
public Result<?> update(
|
||||
@Parameter(description = "开发者选项配置ID") @PathVariable Long id,
|
||||
@RequestBody @Valid DeveloperForm developerForm
|
||||
) {
|
||||
return Result.judge(developerService.updateDeveloper(id, developerForm));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除开发者选项配置")
|
||||
@DeleteMapping("/{ids}")
|
||||
@PreAuthorize("@ss.hasPerm('device:developer:delete')")
|
||||
@Log(module = LogModuleEnum.DEVICE, value = ActionTypeEnum.DELETE)
|
||||
public Result<?> delete(
|
||||
@Parameter(description = "开发者选项配置ID,多个以英文逗号(,)分隔") @PathVariable String ids
|
||||
) {
|
||||
return Result.judge(developerService.deleteDevelopers(ids));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据设备序列号获取开发者选项开关")
|
||||
@GetMapping("/sn/{sn}")
|
||||
@PreAuthorize("@ss.hasPerm('device:developer:list')")
|
||||
public Result<Integer> getBySn(
|
||||
@Parameter(description = "设备序列号") @PathVariable String sn
|
||||
) {
|
||||
return Result.success(developerService.getDeveloperOptionsBySn(sn));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据设备序列号保存或更新开发者选项配置")
|
||||
@PutMapping("/sn/{sn}")
|
||||
@PreAuthorize("@ss.hasPerm('device:developer:update')")
|
||||
@Log(module = LogModuleEnum.DEVICE, value = ActionTypeEnum.UPDATE)
|
||||
public Result<?> saveOrUpdateBySn(
|
||||
@Parameter(description = "设备序列号") @PathVariable String sn,
|
||||
@Parameter(description = "开发者选项开关(0关闭,1开启)") @RequestParam Integer developerOptions
|
||||
) {
|
||||
return Result.judge(developerService.saveOrUpdateBySn(sn, developerOptions));
|
||||
}
|
||||
|
||||
@Operation(summary = "推送开发者模式指令到设备")
|
||||
@PostMapping("/sn/{sn}/push")
|
||||
@PreAuthorize("@ss.hasPerm('device:developer:push')")
|
||||
@Log(module = LogModuleEnum.DEVICE, value = ActionTypeEnum.DEVELOPER)
|
||||
public Result<?> push(
|
||||
@Parameter(description = "设备序列号") @PathVariable String sn
|
||||
) {
|
||||
return Result.judge(deviceService.setDeviceDeveloper(sn));
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,6 @@ import com.youlai.boot.device.model.entity.SnDeviceHardware;
|
||||
import com.youlai.boot.device.model.req.ApkInstallInfoReq;
|
||||
import com.youlai.boot.device.model.req.SnHardwareInfoReq;
|
||||
import com.youlai.boot.device.model.req.SnLocationReq;
|
||||
import com.youlai.boot.device.model.entity.SnDeveloper;
|
||||
import com.youlai.boot.device.model.entity.SnLocation;
|
||||
import com.youlai.boot.device.model.entity.SnScreenshot;
|
||||
import com.youlai.boot.device.model.vo.DeveloperOptionsVO;
|
||||
@@ -240,17 +239,9 @@ public class MobileController {
|
||||
return Result.failed("设备序列号不能为空");
|
||||
}
|
||||
|
||||
// 查询该设备的开发者选项配置
|
||||
SnDeveloper developerConfig = developerService.lambdaQuery()
|
||||
.eq(SnDeveloper::getSn, sn)
|
||||
.one();
|
||||
|
||||
// 查询该设备的开发者选项配置,未配置时默认关闭
|
||||
DeveloperOptionsVO vo = new DeveloperOptionsVO();
|
||||
if (developerConfig != null) {
|
||||
vo.setDeveloperOptions(developerConfig.getDeveloperOptions());
|
||||
} else {
|
||||
vo.setDeveloperOptions(0);
|
||||
}
|
||||
vo.setDeveloperOptions(developerService.getDeveloperOptionsBySn(sn));
|
||||
// 返回开发者选项开关状态
|
||||
return Result.success(vo);
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.youlai.boot.device.converter;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.youlai.boot.device.model.entity.SnDeveloper;
|
||||
import com.youlai.boot.device.model.form.DeveloperForm;
|
||||
import com.youlai.boot.device.model.vo.DeveloperVO;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备开发者选项对象转换器
|
||||
*
|
||||
* @author TTSTD
|
||||
* @since 2026-04-27
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface DeveloperConverter {
|
||||
|
||||
Page<DeveloperVO> toPageVo(Page<SnDeveloper> page);
|
||||
|
||||
SnDeveloper toEntity(DeveloperForm developerForm);
|
||||
|
||||
DeveloperForm toForm(SnDeveloper entity);
|
||||
|
||||
DeveloperVO toVo(SnDeveloper entity);
|
||||
|
||||
List<DeveloperVO> toVoList(List<SnDeveloper> list);
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* 设备截图实体
|
||||
* 设备开发者选项实体
|
||||
*/
|
||||
@TableName("sys_sn_developer")
|
||||
@Getter
|
||||
@@ -21,5 +21,5 @@ public class SnDeveloper extends BaseEntity {
|
||||
/**
|
||||
* 开发者选项开关(0关闭,1开启)
|
||||
*/
|
||||
private int developerOptions;
|
||||
private Integer developerOptions;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.youlai.boot.device.model.query;
|
||||
|
||||
import com.youlai.boot.common.base.BaseQuery;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 设备开发者选项查询对象
|
||||
*
|
||||
* @author TTSTD
|
||||
* @since 2026-04-27
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "设备开发者选项查询对象")
|
||||
public class DeveloperQuery extends BaseQuery {
|
||||
|
||||
@Schema(description = "关键字(设备序列号)")
|
||||
private String keywords;
|
||||
|
||||
@Schema(description = "开发者选项开关(0关闭,1开启)")
|
||||
private Integer developerOptions;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.youlai.boot.device.model.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 设备开发者选项视图对象
|
||||
*
|
||||
* @author TTSTD
|
||||
* @since 2026-04-27
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "设备开发者选项VO")
|
||||
public class DeveloperVO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "设备序列号")
|
||||
private String sn;
|
||||
|
||||
@Schema(description = "开发者选项开关(0关闭,1开启)")
|
||||
private Integer developerOptions;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@@ -1,11 +1,83 @@
|
||||
package com.youlai.boot.device.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.youlai.boot.device.model.entity.SnDeveloper;
|
||||
import com.youlai.boot.device.model.form.DeveloperForm;
|
||||
import com.youlai.boot.device.model.query.DeveloperQuery;
|
||||
import com.youlai.boot.device.model.vo.DeveloperVO;
|
||||
|
||||
/**
|
||||
* 设备开发者选项服务接口
|
||||
*
|
||||
* @author TTSTD
|
||||
* @since 2026-04-27
|
||||
*/
|
||||
public interface DeveloperService extends IService<SnDeveloper> {
|
||||
|
||||
/**
|
||||
* 分页查询开发者选项配置
|
||||
*
|
||||
* @param queryParams 查询参数
|
||||
* @return 分页列表
|
||||
*/
|
||||
IPage<DeveloperVO> page(DeveloperQuery queryParams);
|
||||
|
||||
/**
|
||||
* 获取开发者选项表单数据
|
||||
*
|
||||
* @param id 主键ID
|
||||
* @return 表单数据
|
||||
*/
|
||||
DeveloperForm getDeveloperFormData(Long id);
|
||||
|
||||
/**
|
||||
* 新增开发者选项配置
|
||||
*
|
||||
* @param developerForm 表单
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean saveDeveloper(DeveloperForm developerForm);
|
||||
|
||||
/**
|
||||
* 修改开发者选项配置
|
||||
*
|
||||
* @param id 主键ID
|
||||
* @param developerForm 表单
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean updateDeveloper(Long id, DeveloperForm developerForm);
|
||||
|
||||
/**
|
||||
* 批量删除开发者选项配置
|
||||
*
|
||||
* @param ids 主键ID,多个以英文逗号(,)分隔
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteDevelopers(String ids);
|
||||
|
||||
/**
|
||||
* 根据设备序列号保存或更新开发者选项配置
|
||||
*
|
||||
* @param sn 设备序列号
|
||||
* @param developerOptions 开发者选项开关(0关闭,1开启)
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean saveOrUpdateBySn(String sn, Integer developerOptions);
|
||||
|
||||
/**
|
||||
* 根据设备序列号删除开发者选项配置
|
||||
*
|
||||
* @param sn 设备序列号
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean removeBySn(String sn);
|
||||
|
||||
/**
|
||||
* 根据设备序列号获取开发者选项开关,不存在时返回 0
|
||||
*
|
||||
* @param sn 设备序列号
|
||||
* @return 开发者选项开关(0关闭,1开启)
|
||||
*/
|
||||
Integer getDeveloperOptionsBySn(String sn);
|
||||
}
|
||||
|
||||
@@ -1,16 +1,149 @@
|
||||
package com.youlai.boot.device.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.youlai.boot.device.converter.DeveloperConverter;
|
||||
import com.youlai.boot.device.mapper.DeveloperMapper;
|
||||
import com.youlai.boot.device.model.entity.SnDeveloper;
|
||||
import com.youlai.boot.device.model.form.DeveloperForm;
|
||||
import com.youlai.boot.device.model.query.DeveloperQuery;
|
||||
import com.youlai.boot.device.model.vo.DeveloperVO;
|
||||
import com.youlai.boot.device.service.DeveloperService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备开发者选项服务实现类
|
||||
*
|
||||
* @author TTSTD
|
||||
* @since 2026-04-27
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DeveloperServiceImpl extends ServiceImpl<DeveloperMapper, SnDeveloper> implements DeveloperService {
|
||||
|
||||
private final DeveloperConverter developerConverter;
|
||||
|
||||
@Override
|
||||
public IPage<DeveloperVO> page(DeveloperQuery queryParams) {
|
||||
Page<SnDeveloper> page = new Page<>(queryParams.getPageNum(), queryParams.getPageSize());
|
||||
String keywords = queryParams.getKeywords();
|
||||
LambdaQueryWrapper<SnDeveloper> queryWrapper = new LambdaQueryWrapper<SnDeveloper>()
|
||||
.like(StringUtils.isNotBlank(keywords), SnDeveloper::getSn, keywords)
|
||||
.eq(queryParams.getDeveloperOptions() != null, SnDeveloper::getDeveloperOptions, queryParams.getDeveloperOptions())
|
||||
.orderByDesc(SnDeveloper::getId);
|
||||
Page<SnDeveloper> pageList = this.page(page, queryWrapper);
|
||||
return developerConverter.toPageVo(pageList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeveloperForm getDeveloperFormData(Long id) {
|
||||
SnDeveloper entity = this.getById(id);
|
||||
Assert.notNull(entity, "开发者选项配置不存在");
|
||||
return developerConverter.toForm(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean saveDeveloper(DeveloperForm developerForm) {
|
||||
String sn = developerForm.getSn();
|
||||
Assert.isTrue(
|
||||
this.count(new LambdaQueryWrapper<SnDeveloper>().eq(SnDeveloper::getSn, sn)) == 0,
|
||||
"该设备的开发者选项配置已存在"
|
||||
);
|
||||
SnDeveloper entity = developerConverter.toEntity(developerForm);
|
||||
entity.setId(null);
|
||||
return this.save(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateDeveloper(Long id, DeveloperForm developerForm) {
|
||||
SnDeveloper existing = this.getById(id);
|
||||
Assert.notNull(existing, "开发者选项配置不存在");
|
||||
|
||||
String sn = developerForm.getSn();
|
||||
Assert.isTrue(
|
||||
this.count(new LambdaQueryWrapper<SnDeveloper>()
|
||||
.eq(SnDeveloper::getSn, sn)
|
||||
.ne(SnDeveloper::getId, id)) == 0,
|
||||
"该设备的开发者选项配置已存在"
|
||||
);
|
||||
|
||||
SnDeveloper entity = developerConverter.toEntity(developerForm);
|
||||
entity.setId(id);
|
||||
return this.updateById(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteDevelopers(String ids) {
|
||||
Assert.isTrue(StringUtils.isNotBlank(ids), "删除的开发者选项配置ID不能为空");
|
||||
List<Long> idList = Arrays.stream(ids.split(","))
|
||||
.filter(StringUtils::isNotBlank)
|
||||
.map(String::trim)
|
||||
.map(Long::parseLong)
|
||||
.toList();
|
||||
Assert.isTrue(!idList.isEmpty(), "删除的开发者选项配置ID不能为空");
|
||||
return this.removeByIds(idList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean saveOrUpdateBySn(String sn, Integer developerOptions) {
|
||||
Assert.isTrue(StringUtils.isNotBlank(sn), "设备序列号不能为空");
|
||||
Assert.notNull(developerOptions, "开发者选项开关不能为空");
|
||||
|
||||
SnDeveloper existingConfig = this.lambdaQuery()
|
||||
.eq(SnDeveloper::getSn, sn)
|
||||
.one();
|
||||
|
||||
SnDeveloper developerConfig = new SnDeveloper();
|
||||
developerConfig.setSn(sn);
|
||||
developerConfig.setDeveloperOptions(developerOptions);
|
||||
|
||||
boolean result;
|
||||
if (existingConfig != null) {
|
||||
developerConfig.setId(existingConfig.getId());
|
||||
result = this.updateById(developerConfig);
|
||||
log.info("更新开发者选项配置成功, sn: {}, developerOptions: {}", sn, developerOptions);
|
||||
} else {
|
||||
result = this.save(developerConfig);
|
||||
log.info("新增开发者选项配置成功, sn: {}, developerOptions: {}", sn, developerOptions);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeBySn(String sn) {
|
||||
Assert.isTrue(StringUtils.isNotBlank(sn), "设备序列号不能为空");
|
||||
boolean result = this.lambdaUpdate()
|
||||
.eq(SnDeveloper::getSn, sn)
|
||||
.remove();
|
||||
if (result) {
|
||||
log.info("删除开发者选项配置成功, sn: {}", sn);
|
||||
} else {
|
||||
log.warn("删除开发者选项配置失败,记录不存在, sn: {}", sn);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getDeveloperOptionsBySn(String sn) {
|
||||
if (StringUtils.isBlank(sn)) {
|
||||
return 0;
|
||||
}
|
||||
SnDeveloper developerConfig = this.lambdaQuery()
|
||||
.eq(SnDeveloper::getSn, sn)
|
||||
.one();
|
||||
if (developerConfig == null || developerConfig.getDeveloperOptions() == null) {
|
||||
return 0;
|
||||
}
|
||||
return developerConfig.getDeveloperOptions();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.youlai.boot.framework.security.util.SecurityUtils;
|
||||
import com.youlai.boot.device.mapper.DeviceMapper;
|
||||
import com.youlai.boot.device.model.entity.SnDeviceInfo;
|
||||
import com.youlai.boot.device.model.entity.SnDeveloper;
|
||||
import com.youlai.boot.device.model.query.DeviceQuery;
|
||||
import com.youlai.boot.device.model.vo.DeviceHardwareVO;
|
||||
import com.youlai.boot.device.model.vo.DevicePageVO;
|
||||
@@ -232,28 +231,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, SnDeviceInfo> i
|
||||
@Override
|
||||
public boolean addDeveloperConfig(String sn, Integer developerOptions) {
|
||||
try {
|
||||
// 检查是否已存在该设备的配置
|
||||
SnDeveloper existingConfig = developerService.lambdaQuery()
|
||||
.eq(SnDeveloper::getSn, sn)
|
||||
.one();
|
||||
|
||||
SnDeveloper developerConfig = new SnDeveloper();
|
||||
developerConfig.setSn(sn);
|
||||
developerConfig.setDeveloperOptions(developerOptions);
|
||||
|
||||
boolean result;
|
||||
if (existingConfig != null) {
|
||||
// 如果已存在,则更新
|
||||
developerConfig.setId(existingConfig.getId());
|
||||
result = developerService.updateById(developerConfig);
|
||||
log.info("更新开发者选项配置成功, sn: {}, developerOptions: {}", sn, developerOptions);
|
||||
} else {
|
||||
// 如果不存在,则新增
|
||||
result = developerService.save(developerConfig);
|
||||
log.info("新增开发者选项配置成功, sn: {}, developerOptions: {}", sn, developerOptions);
|
||||
}
|
||||
|
||||
return result;
|
||||
return developerService.saveOrUpdateBySn(sn, developerOptions);
|
||||
} catch (Exception e) {
|
||||
log.error("新增开发者选项配置失败, sn: {}", sn, e);
|
||||
return false;
|
||||
@@ -263,17 +241,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, SnDeviceInfo> i
|
||||
@Override
|
||||
public boolean deleteDeveloperConfig(String sn) {
|
||||
try {
|
||||
boolean result = developerService.lambdaUpdate()
|
||||
.eq(SnDeveloper::getSn, sn)
|
||||
.remove();
|
||||
|
||||
if (result) {
|
||||
log.info("删除开发者选项配置成功, sn: {}", sn);
|
||||
} else {
|
||||
log.warn("删除开发者选项配置失败,记录不存在, sn: {}", sn);
|
||||
}
|
||||
|
||||
return result;
|
||||
return developerService.removeBySn(sn);
|
||||
} catch (Exception e) {
|
||||
log.error("删除开发者选项配置失败, sn: {}", sn, e);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user