模板添加两个参数

This commit is contained in:
2025-02-19 14:36:27 +08:00
parent e87ce424fb
commit 373922bbbf
6 changed files with 21 additions and 16 deletions

View File

@ -19,6 +19,8 @@ import com.ycwl.basic.utils.ApiResponse;
import com.ycwl.basic.utils.JwtTokenUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -28,6 +30,7 @@ import java.util.List;
* @Authorlongbinbin
* @Date2024/12/5 10:22
*/
@Slf4j
@RestController
@RequestMapping("/api/mobile/scenic/v1")
@Api(tags = "景区相关接口")
@ -71,9 +74,14 @@ public class AppScenicController {
@ApiOperation("景区视频源素材列表")
@GetMapping("/face/{faceId}/contentList")
public ApiResponse<List<ContentPageVO>> contentList(@PathVariable Long faceId) {
public ApiResponse<List<ContentPageVO>> contentList(@PathVariable String faceId) {
if (!StringUtils.isNumeric(faceId)) {
log.error("请求异常, faceId: [{}]",faceId);
return ApiResponse.fail("请求异常");
}
Long id = Long.parseLong(faceId);
JwtInfo worker = JwtTokenUtil.getWorker();
List<ContentPageVO> contentPageVOS = appScenicService.faceContentList(worker.getUserId(), faceId);
List<ContentPageVO> contentPageVOS = appScenicService.faceContentList(worker.getUserId(), id);
return ApiResponse.success(contentPageVOS);
}

View File

@ -72,15 +72,8 @@ public class CustomExceptionHandle {
*/
@ExceptionHandler(value = Exception.class)
public ApiResponse<String> handle(Exception e) {
LOGGER.error("系统异常 -> {}", e.getMessage(), e);
String requestText = getRequestAsText();
new Thread(() -> NotifyFactory.via().sendTo(
new NotifyContent(
"帧途后台报错了!",
e.getMessage() + "\n---\n请求主体\n```\n" + requestText + "\n```\n---\n错误栈\n```\n" + getStackTrace(e) + "\n```"
),
"default_user"
)).start();
LOGGER.error("系统异常 -> {}\n{}", e.getMessage(), requestText, e);
return ApiResponse.buildResult(BizCodeEnum.SERVER_UNKONWN_ERROR);
}

View File

@ -76,5 +76,6 @@ public class TemplateEntity {
private Integer sort;
private Integer cropEnable;
private String onlyIf;
private String resolution;
private List<TemplateEntity> children;
}

View File

@ -86,6 +86,7 @@ public class TemplateRespVO {
private BigDecimal price;
private BigDecimal slashPrice;
private Integer sort;
private String resolution;
private Integer cropEnable;
private String onlyIf;
private List<TemplateRespVO> children;

View File

@ -70,9 +70,9 @@ public class TemplateServiceImpl implements TemplateService {
@Override
public ApiResponse<Integer> deleteById(Long id) {
int i = templateMapper.deleteById(id);
templateRepository.clearTemplateCache(id);
if (i > 0) {
templateMapper.deleteByPid(id);
templateRepository.clearTemplateCache(id);
return ApiResponse.success(i);
}else {
return ApiResponse.fail("删除模版失败");
@ -92,8 +92,8 @@ public class TemplateServiceImpl implements TemplateService {
item.setStatus(1);
templateMapper.add(item);
});
templateRepository.clearTemplateCache(template.getId());
}
templateRepository.clearTemplateCache(template.getId());
if (i > 0) {
return ApiResponse.success(true);
}else {
@ -120,7 +120,7 @@ public class TemplateServiceImpl implements TemplateService {
@Override
public void saveConfig(Long configId, TemplateConfigEntity config) {
config.setId(configId);
templateRepository.clearTemplateCache(config.getTemplateId());
templateMapper.updateConfigById(config);
templateRepository.clearTemplateCache(config.getTemplateId());
}
}