Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/main/java/com/amigoscode/framework/annotations/Component.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.amigoscode.framework.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

// Marks a class as a managed component — equivalent to Spring's @Component.
// This is a generic stereotype annotation for any managed component that doesn't fit into more specific categories.
// The framework will automatically create an instance of this class and manage its lifecycle.
// Other classes can then have this component injected via @Autowired.
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface Component {
}
17 changes: 17 additions & 0 deletions src/main/java/com/amigoscode/framework/annotations/GetMapping.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.amigoscode.framework.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

// Maps a method to an HTTP GET request — equivalent to Spring's @GetMapping.
// @Target(ElementType.METHOD) means this annotation can only be placed on methods.
// value() holds the URL path pattern, e.g. @GetMapping("/api/users").
// It defaults to "" so a method can just say @GetMapping and inherit the whole path
// from the controller's @RequestMapping.
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface GetMapping {
String value() default ""; // The URL path this method handles, appended to the controller's base path
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.amigoscode.framework.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

// Maps a method to an HTTP POST request — equivalent to Spring's @PostMapping.
// @Target(ElementType.METHOD) means this annotation can only be placed on methods.
// value() holds the URL path pattern, e.g. @PostMapping("/api/users").
// It defaults to "" so a method can just say @PostMapping and inherit the whole path
// from the controller's @RequestMapping.
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface PostMapping {
String value() default ""; // The URL path this method handles, appended to the controller's base path
}
14 changes: 14 additions & 0 deletions src/main/java/com/amigoscode/framework/annotations/Repository.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.amigoscode.framework.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

// Marks a class as a repository — equivalent to Spring's @Repository.
// Repositories handle data access operations and are typically used for database interactions.
// The framework will automatically create an instance of this class and manage its lifecycle.
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface Repository {
}