Skip to content

Commit

Permalink
add an entity, repository and springdoc-openapi-starter-webmvc-ui:2.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
zyro23 committed Jan 10, 2025
1 parent 5c50956 commit df9bed7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ repositories {
}

dependencies {
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.1'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-data-rest'
implementation 'org.springframework.boot:spring-boot-starter-web'
Expand Down
19 changes: 19 additions & 0 deletions src/main/java/com/example/demo/Foo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.example.demo;

import jakarta.persistence.*;

@Entity
public class Foo {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE)
@Column(nullable = false)
private Long id;

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}
}
8 changes: 8 additions & 0 deletions src/main/java/com/example/demo/FooRepository.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.example.demo;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

@RepositoryRestResource
public interface FooRepository extends JpaRepository<Foo, Long> {
}

0 comments on commit df9bed7

Please sign in to comment.