Commit 41a1df5a by gdj

增加aiInfo的curd接口

parent 46a765cf
...@@ -50,4 +50,28 @@ public class AiInfoController { ...@@ -50,4 +50,28 @@ public class AiInfoController {
return HttpResultResponse.success(paginationData); return HttpResultResponse.success(paginationData);
} }
@PostMapping("/add")
public HttpResultResponse<AiInfoDTO> addAiInfo(@RequestBody @Valid AiInfoDTO aiInfoDTO) {
AiInfoDTO dto = aiInfoService.createAiInfo(aiInfoDTO);
return HttpResultResponse.success(dto);
}
@GetMapping("/get")
public HttpResultResponse<AiInfoDTO> getAiInfo(@RequestParam Long id) {
AiInfoDTO dto = aiInfoService.getAiInfoById(id);
return HttpResultResponse.success(dto);
}
@PostMapping("/update")
public HttpResultResponse<Boolean> updateAiInfo(@RequestBody @Valid AiInfoDTO aiInfoDTO) {
boolean ok = aiInfoService.updateAiInfo(aiInfoDTO);
return HttpResultResponse.success(ok);
}
@PostMapping("/delete")
public HttpResultResponse<Boolean> deleteAiInfo(@RequestParam Long id) {
boolean ok = aiInfoService.deleteAiInfoById(id);
return HttpResultResponse.success(ok);
}
} }
...@@ -13,4 +13,12 @@ public interface IAiInfoService extends IService<AiInfoEntity> { ...@@ -13,4 +13,12 @@ public interface IAiInfoService extends IService<AiInfoEntity> {
PaginationData<AiInfoDTO> getAiInfoPageByParam(AiInfoSearchParam param, Long page, Long pageSize); PaginationData<AiInfoDTO> getAiInfoPageByParam(AiInfoSearchParam param, Long page, Long pageSize);
AiInfoDTO createAiInfo(AiInfoDTO dto);
AiInfoDTO getAiInfoById(Long id);
boolean updateAiInfo(AiInfoDTO dto);
boolean deleteAiInfoById(Long id);
} }
...@@ -112,4 +112,28 @@ public class AiInfoServiceImpl extends ServiceImpl<IAiInfoMapper, AiInfoEntity> ...@@ -112,4 +112,28 @@ public class AiInfoServiceImpl extends ServiceImpl<IAiInfoMapper, AiInfoEntity>
return aiInfoEntity; return aiInfoEntity;
} }
@Override
public AiInfoDTO createAiInfo(AiInfoDTO dto) {
AiInfoEntity entity = AiInfoDTOToEntity(dto);
this.save(entity);
return AiInfoEntityToDTO(entity);
}
@Override
public AiInfoDTO getAiInfoById(Long id) {
AiInfoEntity entity = this.getById(id);
return Objects.nonNull(entity) ? AiInfoEntityToDTO(entity) : null;
}
@Override
public boolean updateAiInfo(AiInfoDTO dto) {
AiInfoEntity entity = AiInfoDTOToEntity(dto);
return this.updateById(entity);
}
@Override
public boolean deleteAiInfoById(Long id) {
return this.removeById(id);
}
} }
...@@ -40,6 +40,9 @@ public class GlobalMVCConfigurer implements WebMvcConfigurer { ...@@ -40,6 +40,9 @@ public class GlobalMVCConfigurer implements WebMvcConfigurer {
excludePaths.add("/" + managePrefix + manageVersion + "/live/streams/start2"); excludePaths.add("/" + managePrefix + manageVersion + "/live/streams/start2");
excludePaths.add("/" + managePrefix + manageVersion + "/live/streams/stop2"); excludePaths.add("/" + managePrefix + manageVersion + "/live/streams/stop2");
excludePaths.add("/" + managePrefix + manageVersion + "/live/oneCapacity2"); excludePaths.add("/" + managePrefix + manageVersion + "/live/oneCapacity2");
// 放行 aiInfo 新增与修改接口
excludePaths.add("/" + managePrefix + manageVersion + "/aiInfo/add");
excludePaths.add("/" + managePrefix + manageVersion + "/aiInfo/update");
// Intercept for all request interfaces. // Intercept for all request interfaces.
registry.addInterceptor(authInterceptor).addPathPatterns("/**").excludePathPatterns(excludePaths); registry.addInterceptor(authInterceptor).addPathPatterns("/**").excludePathPatterns(excludePaths);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment