GithubHelp home page GithubHelp logo

htoonlin / masterapi Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 2.19 MB

It will generate RESTful API for CRUD operations.

License: Apache License 2.0

Java 100.00%
jersey2 hibernate restful-api java

masterapi's Introduction

MasterAPI

This RESTful framework was developed by following:

So, you have to know about these frameworks and libraries. Getting Started

Version 3 Changelog

  • Upgrade maven libraries
  • Remove and Reduce
    • Remove SESSION management to prevent multi session creation
    • Remove JSP Web Page
    • Remove application path "api"
    • Generate upload directory ({basePath}/upload) if does not exist in setting (com.sdm.path.upload)
    • Remove GeoIPCache
    • Hide (Null/Empty) property in JSON Response
  • Change routeList path (sample/customers/route => /sample/customers/~info)
  • Auth allowed userName/email
  • Performance Improvement and Bug Fixed
  • Use Exceptions instead of MessageModel for ErrorMessages

3.1 Changelog

  • Changed JSP Template => Velocity Template

3.2 Changelog

  • Full Info for User AuditInfo
  • Support Firebase Cloud Messaging
MessageModel(204, "...") => throw new NullPointerException("...") 
MessageModel(400, "...") => throw new InvalidRequestException("...", "...", "...")

New Rest Resources

@Path("sample/customers")
public class CustomerResource extends RestResource<CustomerEntity, Integer> {
    public CustomerResource() {
        super();
    }
}

Getting started

Require properties to edit in hibernate.cfg.xml

Change database configuration at (line: 8-11)

<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/{your_db_schema}?zeroDateTimeBehavior=convertToNull&amp;useUnicode=true&amp;characterEncoding=UTF-8</property>
<property name="hibernate.connection.username">{your_db_user}</property>
<property name="hibernate.connection.password">{your_db_password}</property>
<property name="hibernate.default_schema">{your_db_schema}</property>

Require properties to edit in log4j.properties

Change Log directory name at (line: 15)

log4j.appender.fileAppender.File={your_log_directory}/sundew-api.log

Require properties to edit in setting.properties

Change directory for system at (line: 9, 10)

com.sdm.path={system_root_directory}
com.sdm.path.storage={file_upload_directory}

Change mail setting for system mail service at (line: 45-49). You can use your gmail account.

com.sdm.mail.host=smtp.gmail.com
com.sdm.mail.port=465
com.sdm.mail.is_auth=true
com.sdm.mail.user={your_gmail_account}
com.sdm.mail.password={your_gmail_password}

Ready for your API system now!


Package Structure

entity (Table Modeling)*

- Naming Standard
	- Property => camelCase
	- Class => {ObjectNameWithCamelCase}Entity

resource (Request/Response Manager)*

- Naming Standard
	- Class => {ResourceNameWithCamelCase}Resource

request (Request from Client Object)

- Naming Standard
	- Property => camelCase
	- Class => {ObjectNameWithCamelCase}Request

response (Response to Client Object)

  • Naming Standard
    • Property => camelCase
    • Class => {ObjectNameWithCamelCase}Response

util (Other Helper/Manager)

dao (Database Accessing Manager)

  • Naming Standard
    • Property => camelCase
    • Class => {ObjectNameWithCamelCase}DAO

DATABASE Standard

  • Table => tbl_{name_with_snake_case}
  • View => vw_{name_with_snake_case}
  • Procedure => proc_{name_with_snake_case}
  • User Columns => {nameWithCamelCase}

masterapi's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

masterapi's Issues

Scheduler

  • Daily/Weekly/Monthly DB Backup
  • Archives to logs file
  • etc..

Login

Third Party Login with (Facebook, Gmail, etc ...)

Export/Import

Add new export and import methods in RestResource by Export Type

  • Excel Import with Operation Status (I => Insert, U => Update, D => Delete)
  • Excel Export Data with Select All / Filter
  • Excel Export Data with Excel Template

Multilanguage

  • Add lang column as a table default column on DB
  • Auto data filtering by lang

Queuing

  • Send Mail by Queue Process
  • Data Broadcasting
  • System notification

POST QUERY

Add GroupBy, Having, Aggregate Function, etc on Post Query

Auth Notification Mail

  • Send User Login/Authentication Failed Mail to User
  • Send Activate email with link for auto activate

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.