class ModulesController {

    @Autowired
    private ModulesService modulesService;

    @WebAspect
    @Operation(summary = "更新模块信息", description = "新增或更新对应的模块信息")
    @PutMapping
    public RespModel<String> save(@Validated @RequestBody ModulesDTO modules) {
        modulesService.save(modules.convertTo());
        return new RespModel<>(RespEnum.UPDATE_OK);
    }

    @WebAspect
    @Operation(summary = "查找模块列表", description = "查找对应项目id的模块列表")
    @Parameter(name = "projectId", description = "项目id")
    @GetMapping("/list")
    public RespModel<List<ModulesDTO>> findByProjectId(@RequestParam(name = "projectId") int projectId) {
        return new RespModel<>(
                RespEnum.SEARCH_OK,
                modulesService.findByProjectId(projectId)
                        .stream().map(TypeConverter::convertTo).collect(Collectors.toList())
        );
    }

    @WebAspect
    @Operation(summary = "删除模块", description = "删除对应id的模块")
    @Parameter(name = "id", description = "模块id")
    @DeleteMapping
    public RespModel<String> delete(@RequestParam(name = "id") int id) {<FILL_FUNCTION_BODY>}

    @WebAspect
    @Operation(summary = "查看模块信息", description = "查看对应id的模块信息")
    @Parameter(name = "id", description = "模块id")
    @GetMapping
    public RespModel<ModulesDTO> findById(@RequestParam(name = "id") int id) {
        Modules modules = modulesService.findById(id);
        if (modules != null) {
            return new RespModel<>(RespEnum.SEARCH_OK, modules.convertTo());
        } else {
            return new RespModel<>(RespEnum.ID_NOT_FOUND);
        }
    }
}

        if (modulesService.delete(id)) {
            return new RespModel<>(RespEnum.DELETE_OK);
        } else {
            return new RespModel<>(RespEnum.DELETE_FAIL);
        }
    
<no_super_class>