|
@@ -51,6 +51,7 @@ public class DramaItemInfoController {
|
|
Result<IPage<DramaItemInfo>> result = new Result<IPage<DramaItemInfo>>();
|
|
Result<IPage<DramaItemInfo>> result = new Result<IPage<DramaItemInfo>>();
|
|
QueryWrapper<DramaItemInfo> queryWrapper = QueryGenerator.initQueryWrapper(dramaItemInfo, req.getParameterMap());
|
|
QueryWrapper<DramaItemInfo> queryWrapper = QueryGenerator.initQueryWrapper(dramaItemInfo, req.getParameterMap());
|
|
Page<DramaItemInfo> page = new Page<DramaItemInfo>(pageNo, pageSize);
|
|
Page<DramaItemInfo> page = new Page<DramaItemInfo>(pageNo, pageSize);
|
|
|
|
+ queryWrapper.orderByAsc("rank");
|
|
IPage<DramaItemInfo> pageList = dramaItemInfoService.page(page, queryWrapper);
|
|
IPage<DramaItemInfo> pageList = dramaItemInfoService.page(page, queryWrapper);
|
|
result.setSuccess(true);
|
|
result.setSuccess(true);
|
|
result.setResult(pageList);
|
|
result.setResult(pageList);
|
|
@@ -69,14 +70,6 @@ public class DramaItemInfoController {
|
|
public Result<DramaItemInfo> add(@RequestBody DramaItemInfo dramaItemInfo) {
|
|
public Result<DramaItemInfo> add(@RequestBody DramaItemInfo dramaItemInfo) {
|
|
Result<DramaItemInfo> result = new Result<>();
|
|
Result<DramaItemInfo> result = new Result<>();
|
|
try {
|
|
try {
|
|
- String buttonType = dramaItemInfo.getButtonType();
|
|
|
|
- if (buttonType.startsWith("dialogue")) {
|
|
|
|
- dramaItemInfo.setType("dialogue");
|
|
|
|
- String[] infos = buttonType.split("_");
|
|
|
|
- dramaItemInfo.setRoleId(Long.parseLong(infos[1]));
|
|
|
|
- } else if (buttonType.startsWith("scence")) {
|
|
|
|
- dramaItemInfo.setType("scence");
|
|
|
|
- }
|
|
|
|
dramaItemInfoService.save(dramaItemInfo);
|
|
dramaItemInfoService.save(dramaItemInfo);
|
|
result.success("添加成功!");
|
|
result.success("添加成功!");
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -101,20 +94,11 @@ public class DramaItemInfoController {
|
|
if (dramaItemInfoEntity == null) {
|
|
if (dramaItemInfoEntity == null) {
|
|
result.error500("未找到对应实体");
|
|
result.error500("未找到对应实体");
|
|
} else {
|
|
} else {
|
|
- String buttonType = dramaItemInfo.getButtonType();
|
|
|
|
- if (buttonType.startsWith("dialogue")) {
|
|
|
|
- dramaItemInfo.setType("dialogue");
|
|
|
|
- String[] infos = buttonType.split("_");
|
|
|
|
- dramaItemInfo.setRoleId(Long.parseLong(infos[1]));
|
|
|
|
- } else if (buttonType.startsWith("scence")) {
|
|
|
|
- dramaItemInfo.setType("scence");
|
|
|
|
- }
|
|
|
|
boolean ok = dramaItemInfoService.updateById(dramaItemInfo);
|
|
boolean ok = dramaItemInfoService.updateById(dramaItemInfo);
|
|
if (ok) {
|
|
if (ok) {
|
|
result.success("修改成功!");
|
|
result.success("修改成功!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|