Skip to content

Latest commit

 

History

History
129 lines (106 loc) · 3.08 KB

File metadata and controls

129 lines (106 loc) · 3.08 KB

Quick Start Guide

Installation

1. Clone the Repository

git clone <repository-url>
cd NameOps

2. Build the Project

mvn clean install

3. Run the Application

mvn spring-boot:run

The service will start on http://localhost:8080

Testing the API

Health Check

curl http://localhost:8080/api/v1/nameops/health

Get Naming Convention

curl http://localhost:8080/api/v1/nameops/convention

Generate a Device Name

curl -X POST http://localhost:8080/api/v1/nameops/generate \
  -H "Content-Type: application/json" \
  -d '{
    "area": "TB",
    "specificArea": "01",
    "device": "PS",
    "position": "10"
  }'

Validate a Device Name

curl -X POST http://localhost:8080/api/v1/nameops/validate \
  -H "Content-Type: application/json" \
  -d '{
    "name": "TB:01-PS10.01_01-RB"
  }'

API Documentation

Access the interactive Swagger UI documentation:

http://localhost:8080/swagger-ui.html

Development Tools

H2 Database Console

Access the H2 console for database inspection:

http://localhost:8080/h2-console

Connection Details:

  • JDBC URL: jdbc:h2:mem:nameops
  • Username: sa
  • Password: (leave empty)

Project Structure

NameOps/
├── src/
│   ├── main/
│   │   ├── java/
│   │   │   └── gov/bnl/eic/nameops/
│   │   │       ├── NameOpsApplication.java
│   │   │       └── controller/
│   │   │           └── NameController.java
│   │   └── resources/
│   │       └── application.properties
│   └── test/
│       └── java/
│           └── gov/bnl/eic/nameops/
│               └── NameOpsApplicationTests.java
├── resources/
│   ├── SWN_abbreviation_database(swn abv editable for EIC).csv
│   ├── es swn lattice(es_swn_lattice).csv
│   └── naming examples(Sheet1).csv
├── pom.xml
├── README.md
├── naming-convention.md
└── .gitignore

Next Steps

  1. Implement name generation logic in NameController.generateName()
  2. Implement validation logic in NameController.validateName()
  3. Load CSV data from resources directory
  4. Create service layer for business logic
  5. Add comprehensive unit and integration tests

Troubleshooting

Port Already in Use

If port 8080 is already in use, you can change it in application.properties:

server.port=8081

Maven Build Fails

Ensure you have Java 17 or higher:

java -version

Application Won't Start

Check the logs for detailed error messages:

tail -f logs/spring-boot.log