{"id":15567083,"url":"https://github.com/yafatek/restfu-core","last_synced_at":"2026-04-29T18:34:10.764Z","repository":{"id":48199780,"uuid":"362599415","full_name":"yafatek/restfu-core","owner":"yafatek","description":"Build Simple yet Easy APIs Like Thunder Speed With less code and Time","archived":false,"fork":false,"pushed_at":"2024-01-08T10:04:51.000Z","size":164,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T05:16:11.439Z","etag":null,"topics":["hibernate","java","java16","library","microservice","rest-api","restclient","restful-api","spring-boot","springboot","springjpa"],"latest_commit_sha":null,"homepage":"https://yafatek.github.io/restfu-core/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yafatek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["yafatek"]}},"created_at":"2021-04-28T20:33:54.000Z","updated_at":"2022-01-02T10:21:01.000Z","dependencies_parsed_at":"2024-12-09T04:07:06.836Z","dependency_job_id":"a0b6fc50-5060-495d-ac61-b12ac13ea16d","html_url":"https://github.com/yafatek/restfu-core","commit_stats":{"total_commits":42,"total_committers":3,"mean_commits":14.0,"dds":"0.45238095238095233","last_synced_commit":"d7df11260d1b55e2fff0eb929e9d44cf005ba43f"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/yafatek/restfu-core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yafatek%2Frestfu-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yafatek%2Frestfu-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yafatek%2Frestfu-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yafatek%2Frestfu-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yafatek","download_url":"https://codeload.github.com/yafatek/restfu-core/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yafatek%2Frestfu-core/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32439234,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T18:12:22.909Z","status":"ssl_error","status_checked_at":"2026-04-29T18:11:33.322Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hibernate","java","java16","library","microservice","rest-api","restclient","restful-api","spring-boot","springboot","springjpa"],"created_at":"2024-10-02T17:09:53.901Z","updated_at":"2026-04-29T18:34:10.745Z","avatar_url":"https://github.com/yafatek.png","language":"Java","funding_links":["https://github.com/sponsors/yafatek"],"categories":[],"sub_categories":[],"readme":"### RESTFULL Generic Lib\n\n1- Getting started\n--\n1. Getting the Package:\n   you can easily get the package from maven central\n   * Maven:\n    ```xml\n    \u003cdependency\u003e\n        \u003cgroupId\u003edev.yafatek\u003c/groupId\u003e\n        \u003cartifactId\u003eyafatek-restcore\u003c/artifactId\u003e\n        \u003cversion\u003e1.0.108\u003c/version\u003e\n    \u003c/dependency\u003e\n    ```\n   * gradle:\n    ```groovy\n     implementation 'dev.yafatek:yafatek-restcore:1.0.108'\n   ```\n   * kotlin DSL:\n   ```kotlin\n     implementation(\"dev.yafatek:yafatek-restcore:1.0.108\")\n   ```\n2- need more?\n-- \ncheck out our repository: https://search.maven.org/artifact/dev.yafatek/yafatek-restcore\n\n3. Usage:\n   * simple Usage: by create a repository that extends the GenericRepo\n   ```java\n    @Repository\n    public interface DemoRepo extends GenericRepo\u003cDemoEntity, UUID\u003e {\n      // CODE HERE\n     }\n   ```\n   * create repo object in RestController class\n   ```java\n    private final CustomersRepo\u003cCustomer, UUID\u003e customersRepo;\n   ```\n   * and autowire it in the constructor.\n   ```java\n      public CustomerConsumer( CustomersRepo\u003cCustomer, UUID\u003e customersRepo) {\n         this.customersRepo = customersRepo;\n        }\n   ```\n   * to start using the api we need to create an object from: ApiService\u003c\u003e interface:\n   ```java\n   private final ApiServices\u003cCustomer, UUID\u003e customerService;\n   ```\n   * then pass the repositrory that we create to the initalization of the api in the constructor\n   ```java\n    public CustomerConsumer( CustomersRepo\u003cCustomer, UUID\u003e customersRepo) {\n         this.customersRepo = customersRepo;\n         this.customerService = new ApiServicesWrapper\u003cCustomer, UUID\u003e(customersRepo) {};\n        }\n  \n   ```\n3- Full Demo:\n--\n* full demo of the api can be found at the following Code\n\n```java\npackage dev.yafatek.restcore.unittest.v1;\n\nimport ApiUtils;\nimport dev.yafatek.restcore.domain.DemoEntity;\nimport dev.yafatek.restcore.domain.DemoRepo;\nimport dev.yafatek.restcore.services.ApiServices;\nimport dev.yafatek.restcore.wrappers.ApiServicesWrapper;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.springframework.web.bind.annotation.*;\n\nimport java.time.Instant;\nimport java.util.UUID;\n\n@RestController\n@RequestMapping(\"api/v1/d\")\npublic class DemoController {\n    protected static final Logger LOGGER = LoggerFactory.getLogger(DemoController.class);\n    protected final DemoRepo\u003cDemoEntity, UUID\u003e demoEntityUUIDDemoRepo;\n    protected ApiServices\u003cDemoEntity, UUID\u003e apiServices;\n\n    public DemoController(DemoRepo\u003cDemoEntity, UUID\u003e demoEntityUUIDDemoRepo) {\n        this.apiServices = new ApiServicesWrapper\u003c\u003e(demoEntityUUIDDemoRepo) {\n        };\n        this.demoEntityUUIDDemoRepo = demoEntityUUIDDemoRepo;\n    }\n\n    @GetMapping\n    public Object get() {\n        LOGGER.info(\" [*] debugging: apiService: {}\", apiServices);\n        LOGGER.info(\" [*] debugging: demo Repo: {}\", demoEntityUUIDDemoRepo);\n        // save dummy Data.\n\n        return apiServices\n                .getAll();\n\n\n    }\n\n    @GetMapping(value = \"/query\")\n    public Object getOne(@RequestParam(\"target\") String uuid) {\n        return apiServices.getById(UUID.fromString(uuid));\n    }\n\n    @GetMapping(value = \"/by-date\")\n    public Object byDate(@RequestParam(\"offset\") String after) {\n        return apiServices.getAllAfter(ApiUtils.stringToInstant(after));\n    }\n\n    @PatchMapping\n    public Object update(@RequestBody DummyUpdate dummy) {\n        DemoEntity demoEntity = new DemoEntity(dummy.getDescription(), dummy.getAttribute());\n        demoEntity.setModified(Instant.now());\n        return apiServices.updateById(demoEntity, UUID.fromString(dummy.getId()));\n    }\n\n    @DeleteMapping(value = \"/secure/delete\")\n    public Object deleteOne(@RequestParam(\"target\") String target) {\n        return apiServices.deleteById(UUID.fromString(target));\n    }\n\n    @DeleteMapping(value = \"/secure/bulk-delete\")\n    public Object bulkDelete() {\n        return apiServices.bulkDelete();\n    }\n\n    @PostMapping\n    public Object post(@RequestBody Dummy dummy) {\n        LOGGER.info(\" [.] Saving Dummy Data: {}\", dummy);\n        // UUID id, Instant created, String description, String attribute\n        return apiServices.saveEntity(new DemoEntity(UUID.randomUUID(), Instant.now(), dummy.getDescription(), dummy.getAttribute()));\n    }\n\n\n    static class DummyUpdate {\n        protected String id;\n        protected String description;\n        protected String attribute;\n\n        public DummyUpdate() {\n        }\n\n        public String getId() {\n            return id;\n        }\n\n        public void setId(String id) {\n            this.id = id;\n        }\n\n        public String getDescription() {\n            return description;\n        }\n\n        public void setDescription(String description) {\n            this.description = description;\n        }\n\n        public String getAttribute() {\n            return attribute;\n        }\n\n        public void setAttribute(String attribute) {\n            this.attribute = attribute;\n        }\n    }\n\n    static class Dummy {\n        protected String description;\n        protected String attribute;\n\n        public Dummy() {\n        }\n\n        public String getDescription() {\n            return description;\n        }\n\n        public void setDescription(String description) {\n            this.description = description;\n        }\n\n        public String getAttribute() {\n            return attribute;\n        }\n\n        public void setAttribute(String attribute) {\n            this.attribute = attribute;\n        }\n\n        @Override\n        public String toString() {\n            return \"Dummy{\" +\n                    \"description='\" + description + '\\'' +\n                    \", attribute='\" + attribute + '\\'' +\n                    '}';\n        }\n    }\n}\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyafatek%2Frestfu-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyafatek%2Frestfu-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyafatek%2Frestfu-core/lists"}