mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-22 07:03:53 +08:00
update:调整参数和音色删除接口,适应前端请求 (#732)
This commit is contained in:
+2
-3
@@ -3,7 +3,6 @@ package xiaozhi.modules.sys.controller;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -95,11 +94,11 @@ public class SysParamsController {
|
||||
return new Result<Void>();
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@PostMapping("/delete")
|
||||
@Operation(summary = "删除")
|
||||
@LogOperation("删除")
|
||||
@RequiresPermissions("sys:role:superAdmin")
|
||||
public Result<Void> delete(@RequestBody Long[] ids) {
|
||||
public Result<Void> delete(@RequestBody String[] ids) {
|
||||
// 效验数据
|
||||
AssertUtils.isArrayEmpty(ids, "id");
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ public interface SysParamsDao extends BaseDao<SysParamsEntity> {
|
||||
* @param ids ids
|
||||
* @return 返回参数编码列表
|
||||
*/
|
||||
List<String> getParamCodeList(Long[] ids);
|
||||
List<String> getParamCodeList(String[] ids);
|
||||
|
||||
/**
|
||||
* 根据参数编码,更新value
|
||||
|
||||
@@ -23,7 +23,7 @@ public interface SysParamsService extends BaseService<SysParamsEntity> {
|
||||
|
||||
void update(SysParamsDTO dto);
|
||||
|
||||
void delete(Long[] ids);
|
||||
void delete(String[] ids);
|
||||
|
||||
/**
|
||||
* 根据参数编码,获取参数的value值
|
||||
|
||||
+4
-2
@@ -132,11 +132,13 @@ public class SysParamsServiceImpl extends BaseServiceImpl<SysParamsDao, SysParam
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Long[] ids) {
|
||||
public void delete(String[] ids) {
|
||||
// 删除Redis数据
|
||||
List<String> paramCodeList = baseDao.getParamCodeList(ids);
|
||||
String[] paramCodes = paramCodeList.toArray(new String[paramCodeList.size()]);
|
||||
sysParamsRedis.delete(paramCodes);
|
||||
if (paramCodes.length > 0) {
|
||||
sysParamsRedis.delete(paramCodes);
|
||||
}
|
||||
|
||||
// 删除
|
||||
deleteBatchIds(Arrays.asList(ids));
|
||||
|
||||
+1
-2
@@ -3,7 +3,6 @@ package xiaozhi.modules.timbre.controller;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -82,7 +81,7 @@ public class TimbreController {
|
||||
return new Result<>();
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@PostMapping("/delete")
|
||||
@Operation(summary = "音色删除")
|
||||
@RequiresPermissions("sys:role:superAdmin")
|
||||
public Result<Void> delete(@RequestBody String[] ids) {
|
||||
|
||||
Reference in New Issue
Block a user