Renaming Mobtools to Appsmith everywhere for consistency

This commit is contained in:
Arpit Mohan 2019-08-27 15:14:50 +05:30
parent 2758e26769
commit 06945ff10f
86 changed files with 221 additions and 221 deletions

View File

@ -8,11 +8,11 @@
<version>2.1.3.RELEASE</version> <version>2.1.3.RELEASE</version>
<relativePath/> <!-- lookup parent from repository --> <relativePath/> <!-- lookup parent from repository -->
</parent> </parent>
<groupId>com.mobtools</groupId> <groupId>com.appsmith</groupId>
<artifactId>server</artifactId> <artifactId>server</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<name>server</name> <name>server</name>
<description>This is the API server for the Mobtools project</description> <description>This is the API server for the Appsmith project</description>
<properties> <properties>
<java.version>11</java.version> <java.version>11</java.version>

View File

@ -1,4 +1,4 @@
package com.mobtools.server; package com.appsmith.server;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;

View File

@ -1,10 +1,10 @@
package com.mobtools.server.configurations; package com.appsmith.server.configurations;
import com.mobtools.server.domains.LoginSource; import com.appsmith.server.domains.LoginSource;
import com.mobtools.server.domains.User; import com.appsmith.server.domains.User;
import com.mobtools.server.domains.UserState; import com.appsmith.server.domains.UserState;
import com.mobtools.server.services.TenantService; import com.appsmith.server.services.UserService;
import com.mobtools.server.services.UserService; import com.appsmith.server.services.TenantService;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.security.core.Authentication; import org.springframework.security.core.Authentication;
import org.springframework.security.oauth2.client.OAuth2AuthorizedClient; import org.springframework.security.oauth2.client.OAuth2AuthorizedClient;

View File

@ -1,4 +1,4 @@
package com.mobtools.server.configurations; package com.appsmith.server.configurations;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
@ -8,7 +8,7 @@ import reactor.core.scheduler.Schedulers;
@Configuration @Configuration
public class CommonConfig { public class CommonConfig {
private String ELASTIC_THREAD_POOL_NAME = "mobtools-elastic-pool"; private String ELASTIC_THREAD_POOL_NAME = "appsmith-elastic-pool";
@Bean @Bean
public Scheduler scheduler() { public Scheduler scheduler() {

View File

@ -1,4 +1,4 @@
package com.mobtools.server.configurations; package com.appsmith.server.configurations;
import com.mongodb.reactivestreams.client.MongoClient; import com.mongodb.reactivestreams.client.MongoClient;
import com.mongodb.reactivestreams.client.MongoClients; import com.mongodb.reactivestreams.client.MongoClients;

View File

@ -1,9 +1,9 @@
package com.mobtools.server.configurations; package com.appsmith.server.configurations;
import com.mobtools.server.constants.Security; import com.appsmith.server.services.UserService;
import com.mobtools.server.services.TenantService; import com.appsmith.server.constants.Security;
import com.mobtools.server.services.UserService; import com.appsmith.server.services.TenantService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity; import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity;

View File

@ -1,4 +1,4 @@
package com.mobtools.server.constants; package com.appsmith.server.constants;
public interface Security { public interface Security {
String USER_ROLE = "USER_ROLE"; String USER_ROLE = "USER_ROLE";

View File

@ -1,4 +1,4 @@
package com.mobtools.server.constants; package com.appsmith.server.constants;
public interface Url { public interface Url {
String BASE_URL = "/api"; String BASE_URL = "/api";

View File

@ -1,9 +1,9 @@
package com.mobtools.server.controllers; package com.appsmith.server.controllers;
import com.mobtools.server.domains.BaseDomain; import com.appsmith.server.domains.BaseDomain;
import com.mobtools.server.dtos.ResponseDto; import com.appsmith.server.dtos.ResponseDto;
import com.mobtools.server.exceptions.MobtoolsException; import com.appsmith.server.services.CrudService;
import com.mobtools.server.services.CrudService; import com.appsmith.server.exceptions.AppsmithException;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@ -21,7 +21,7 @@ public abstract class BaseController<S extends CrudService, T extends BaseDomain
@PostMapping @PostMapping
@ResponseStatus(HttpStatus.CREATED) @ResponseStatus(HttpStatus.CREATED)
public Mono<ResponseDto<T>> create(@Valid @RequestBody T resource) throws MobtoolsException { public Mono<ResponseDto<T>> create(@Valid @RequestBody T resource) throws AppsmithException {
log.debug("Going to create resource {}", resource.getClass().getName()); log.debug("Going to create resource {}", resource.getClass().getName());
return service.create(resource) return service.create(resource)
.map(created -> new ResponseDto<>(HttpStatus.CREATED.value(), created, null)); .map(created -> new ResponseDto<>(HttpStatus.CREATED.value(), created, null));

View File

@ -1,4 +1,4 @@
package com.mobtools.server.controllers; package com.appsmith.server.controllers;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;

View File

@ -1,8 +1,8 @@
package com.mobtools.server.controllers; package com.appsmith.server.controllers;
import com.mobtools.server.constants.Url; import com.appsmith.server.domains.Layout;
import com.mobtools.server.domains.Layout; import com.appsmith.server.services.LayoutService;
import com.mobtools.server.services.LayoutService; import com.appsmith.server.constants.Url;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;

View File

@ -1,11 +1,11 @@
package com.mobtools.server.controllers; package com.appsmith.server.controllers;
import com.mobtools.server.constants.Url; import com.appsmith.server.domains.Plugin;
import com.mobtools.server.domains.Plugin; import com.appsmith.server.domains.Tenant;
import com.mobtools.server.domains.Tenant; import com.appsmith.server.dtos.PluginTenantDTO;
import com.mobtools.server.dtos.PluginTenantDTO; import com.appsmith.server.dtos.ResponseDto;
import com.mobtools.server.dtos.ResponseDto; import com.appsmith.server.services.PluginService;
import com.mobtools.server.services.PluginService; import com.appsmith.server.constants.Url;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;

View File

@ -1,9 +1,9 @@
package com.mobtools.server.controllers; package com.appsmith.server.controllers;
import com.mobtools.server.constants.Url; import com.appsmith.server.domains.Query;
import com.mobtools.server.domains.Query; import com.appsmith.server.dtos.CommandQueryParams;
import com.mobtools.server.dtos.CommandQueryParams; import com.appsmith.server.services.QueryService;
import com.mobtools.server.services.QueryService; import com.appsmith.server.constants.Url;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Flux; import reactor.core.publisher.Flux;

View File

@ -1,8 +1,8 @@
package com.mobtools.server.controllers; package com.appsmith.server.controllers;
import com.mobtools.server.constants.Url; import com.appsmith.server.services.ResourceService;
import com.mobtools.server.domains.Resource; import com.appsmith.server.constants.Url;
import com.mobtools.server.services.ResourceService; import com.appsmith.server.domains.Resource;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;

View File

@ -1,8 +1,8 @@
package com.mobtools.server.controllers; package com.appsmith.server.controllers;
import com.mobtools.server.constants.Url; import com.appsmith.server.domains.Setting;
import com.mobtools.server.domains.Setting; import com.appsmith.server.services.SettingService;
import com.mobtools.server.services.SettingService; import com.appsmith.server.constants.Url;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;

View File

@ -1,8 +1,8 @@
package com.mobtools.server.controllers; package com.appsmith.server.controllers;
import com.mobtools.server.constants.Url; import com.appsmith.server.domains.Tenant;
import com.mobtools.server.domains.Tenant; import com.appsmith.server.constants.Url;
import com.mobtools.server.services.TenantService; import com.appsmith.server.services.TenantService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;

View File

@ -1,9 +1,9 @@
package com.mobtools.server.controllers; package com.appsmith.server.controllers;
import com.mobtools.server.constants.Url; import com.appsmith.server.domains.Widget;
import com.mobtools.server.domains.Widget; import com.appsmith.server.dtos.ResponseDto;
import com.mobtools.server.dtos.ResponseDto; import com.appsmith.server.services.WidgetService;
import com.mobtools.server.services.WidgetService; import com.appsmith.server.constants.Url;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;

View File

@ -1,4 +1,4 @@
package com.mobtools.server.domains; package com.appsmith.server.domains;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;

View File

@ -1,4 +1,4 @@
package com.mobtools.server.domains; package com.appsmith.server.domains;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;

View File

@ -1,4 +1,4 @@
package com.mobtools.server.domains; package com.appsmith.server.domains;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;

View File

@ -1,4 +1,4 @@
package com.mobtools.server.domains; package com.appsmith.server.domains;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;

View File

@ -1,4 +1,4 @@
package com.mobtools.server.domains; package com.appsmith.server.domains;
public enum LoginSource { public enum LoginSource {
GOOGLE, FORM GOOGLE, FORM

View File

@ -1,4 +1,4 @@
package com.mobtools.server.domains; package com.appsmith.server.domains;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;

View File

@ -1,4 +1,4 @@
package com.mobtools.server.domains; package com.appsmith.server.domains;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;

View File

@ -1,4 +1,4 @@
package com.mobtools.server.domains; package com.appsmith.server.domains;
public enum PluginType { public enum PluginType {
DB, REST DB, REST

View File

@ -1,4 +1,4 @@
package com.mobtools.server.domains; package com.appsmith.server.domains;
public enum PricingPlan { public enum PricingPlan {
FREE, STARTUP, BUSINESS, ENTERPRISE FREE, STARTUP, BUSINESS, ENTERPRISE

View File

@ -1,4 +1,4 @@
package com.mobtools.server.domains; package com.appsmith.server.domains;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;

View File

@ -1,4 +1,4 @@
package com.mobtools.server.domains; package com.appsmith.server.domains;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;

View File

@ -1,4 +1,4 @@
package com.mobtools.server.domains; package com.appsmith.server.domains;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;

View File

@ -1,6 +1,6 @@
package com.mobtools.server.domains; package com.appsmith.server.domains;
import com.mobtools.server.dtos.AuthenticationDTO; import com.appsmith.server.dtos.AuthenticationDTO;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;

View File

@ -1,4 +1,4 @@
package com.mobtools.server.domains; package com.appsmith.server.domains;
import lombok.Getter; import lombok.Getter;

View File

@ -1,4 +1,4 @@
package com.mobtools.server.domains; package com.appsmith.server.domains;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;

View File

@ -1,4 +1,4 @@
package com.mobtools.server.domains; package com.appsmith.server.domains;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;

View File

@ -1,6 +1,6 @@
package com.mobtools.server.domains; package com.appsmith.server.domains;
import com.mobtools.server.dtos.TenantPluginStatus; import com.appsmith.server.dtos.TenantPluginStatus;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;

View File

@ -1,4 +1,4 @@
package com.mobtools.server.domains; package com.appsmith.server.domains;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;

View File

@ -1,4 +1,4 @@
package com.mobtools.server.domains; package com.appsmith.server.domains;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;

View File

@ -1,4 +1,4 @@
package com.mobtools.server.domains; package com.appsmith.server.domains;
public enum UserState { public enum UserState {
NEW, INVITED, ACTIVATED NEW, INVITED, ACTIVATED

View File

@ -1,4 +1,4 @@
package com.mobtools.server.domains; package com.appsmith.server.domains;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;

View File

@ -1,4 +1,4 @@
package com.mobtools.server.domains; package com.appsmith.server.domains;
public enum WidgetType { public enum WidgetType {
DB, DISPLAY DB, DISPLAY

View File

@ -1,4 +1,4 @@
package com.mobtools.server.dtos; package com.appsmith.server.dtos;
import lombok.*; import lombok.*;

View File

@ -1,4 +1,4 @@
package com.mobtools.server.dtos; package com.appsmith.server.dtos;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;

View File

@ -1,4 +1,4 @@
package com.mobtools.server.dtos; package com.appsmith.server.dtos;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;

View File

@ -1,6 +1,6 @@
package com.mobtools.server.dtos; package com.appsmith.server.dtos;
import com.mobtools.server.domains.PluginType; import com.appsmith.server.domains.PluginType;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;

View File

@ -1,4 +1,4 @@
package com.mobtools.server.dtos; package com.appsmith.server.dtos;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;

View File

@ -1,4 +1,4 @@
package com.mobtools.server.dtos; package com.appsmith.server.dtos;
import lombok.*; import lombok.*;

View File

@ -1,4 +1,4 @@
package com.mobtools.server.dtos; package com.appsmith.server.dtos;
public enum TenantPluginStatus { public enum TenantPluginStatus {
FREE, TRIAL, ACTIVATED FREE, TRIAL, ACTIVATED

View File

@ -0,0 +1,8 @@
package com.appsmith.server.exceptions;
public class AppsmithException extends Exception {
public AppsmithException(String msg) {
super(msg);
}
}

View File

@ -1,6 +1,6 @@
package com.mobtools.server.filters; package com.appsmith.server.filters;
import com.mobtools.server.helpers.LogHelper; import com.appsmith.server.helpers.LogHelper;
import org.slf4j.MDC; import org.slf4j.MDC;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.http.server.reactive.ServerHttpRequest;

View File

@ -1,6 +1,6 @@
package com.mobtools.server.filters; package com.appsmith.server.filters;
import com.mobtools.server.helpers.LogHelper; import com.appsmith.server.helpers.LogHelper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange; import org.springframework.web.server.ServerWebExchange;

View File

@ -1,4 +1,4 @@
package com.mobtools.server.helpers; package com.appsmith.server.helpers;
import org.slf4j.MDC; import org.slf4j.MDC;
import reactor.core.publisher.Signal; import reactor.core.publisher.Signal;

View File

@ -1,8 +1,8 @@
package com.mobtools.server.plugins; package com.appsmith.server.plugins;
import com.mobtools.server.domains.Query; import com.appsmith.server.services.PluginExecutor;
import com.mobtools.server.dtos.CommandQueryParams; import com.appsmith.server.domains.Query;
import com.mobtools.server.services.PluginExecutor; import com.appsmith.server.dtos.CommandQueryParams;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;

View File

@ -1,9 +1,9 @@
package com.mobtools.server.plugins; package com.appsmith.server.plugins;
import com.mobtools.server.domains.Property; import com.appsmith.server.services.PluginExecutor;
import com.mobtools.server.domains.Query; import com.appsmith.server.domains.Property;
import com.mobtools.server.dtos.CommandQueryParams; import com.appsmith.server.domains.Query;
import com.mobtools.server.services.PluginExecutor; import com.appsmith.server.dtos.CommandQueryParams;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.minidev.json.JSONObject; import net.minidev.json.JSONObject;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;

View File

@ -1,4 +1,4 @@
package com.mobtools.server.repositories; package com.appsmith.server.repositories;
import org.springframework.data.repository.NoRepositoryBean; import org.springframework.data.repository.NoRepositoryBean;
import org.springframework.data.repository.reactive.ReactiveCrudRepository; import org.springframework.data.repository.reactive.ReactiveCrudRepository;

View File

@ -1,6 +1,6 @@
package com.mobtools.server.repositories; package com.appsmith.server.repositories;
import com.mobtools.server.domains.Layout; import com.appsmith.server.domains.Layout;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@Repository @Repository

View File

@ -1,6 +1,6 @@
package com.mobtools.server.repositories; package com.appsmith.server.repositories;
import com.mobtools.server.domains.Plugin; import com.appsmith.server.domains.Plugin;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;

View File

@ -1,6 +1,6 @@
package com.mobtools.server.repositories; package com.appsmith.server.repositories;
import com.mobtools.server.domains.Query; import com.appsmith.server.domains.Query;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;

View File

@ -1,6 +1,6 @@
package com.mobtools.server.repositories; package com.appsmith.server.repositories;
import com.mobtools.server.domains.Resource; import com.appsmith.server.domains.Resource;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@Repository @Repository

View File

@ -1,6 +1,6 @@
package com.mobtools.server.repositories; package com.appsmith.server.repositories;
import com.mobtools.server.domains.Setting; import com.appsmith.server.domains.Setting;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;

View File

@ -1,6 +1,6 @@
package com.mobtools.server.repositories; package com.appsmith.server.repositories;
import com.mobtools.server.domains.Tenant; import com.appsmith.server.domains.Tenant;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;

View File

@ -1,6 +1,6 @@
package com.mobtools.server.repositories; package com.appsmith.server.repositories;
import com.mobtools.server.domains.User; import com.appsmith.server.domains.User;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;

View File

@ -1,6 +1,6 @@
package com.mobtools.server.repositories; package com.appsmith.server.repositories;
import com.mobtools.server.domains.Widget; import com.appsmith.server.domains.Widget;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;

View File

@ -1,8 +1,8 @@
package com.mobtools.server.services; package com.appsmith.server.services;
import com.mobtools.server.domains.BaseDomain; import com.appsmith.server.domains.BaseDomain;
import com.mobtools.server.exceptions.MobtoolsException; import com.appsmith.server.exceptions.AppsmithException;
import com.mobtools.server.repositories.BaseRepository; import com.appsmith.server.repositories.BaseRepository;
import com.mongodb.BasicDBObject; import com.mongodb.BasicDBObject;
import com.mongodb.DBObject; import com.mongodb.DBObject;
import org.springframework.data.mongodb.core.ReactiveMongoTemplate; import org.springframework.data.mongodb.core.ReactiveMongoTemplate;
@ -63,11 +63,11 @@ public abstract class BaseService<R extends BaseRepository, T extends BaseDomain
@Override @Override
public Mono<T> getById(ID id) { public Mono<T> getById(ID id) {
return repository.findById(id) return repository.findById(id)
.switchIfEmpty(Mono.error(new MobtoolsException("Unable to find resource with id: " + id.toString()))); .switchIfEmpty(Mono.error(new AppsmithException("Unable to find resource with id: " + id.toString())));
} }
@Override @Override
public Mono<T> create(T object) throws MobtoolsException { public Mono<T> create(T object) throws AppsmithException {
return repository.save(object); return repository.save(object);
} }

View File

@ -1,7 +1,7 @@
package com.mobtools.server.services; package com.appsmith.server.services;
import com.mobtools.server.domains.BaseDomain; import com.appsmith.server.domains.BaseDomain;
import com.mobtools.server.exceptions.MobtoolsException; import com.appsmith.server.exceptions.AppsmithException;
import reactor.core.publisher.Flux; import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;
@ -9,7 +9,7 @@ public interface CrudService<T extends BaseDomain, ID> {
Flux<T> get(); Flux<T> get();
Mono<T> create(T resource) throws MobtoolsException; Mono<T> create(T resource) throws AppsmithException;
Mono<T> update(ID id, T resource) throws Exception; Mono<T> update(ID id, T resource) throws Exception;

View File

@ -0,0 +1,6 @@
package com.appsmith.server.services;
import com.appsmith.server.domains.Layout;
public interface LayoutService extends CrudService<Layout, String> {
}

View File

@ -1,7 +1,7 @@
package com.mobtools.server.services; package com.appsmith.server.services;
import com.mobtools.server.domains.Layout; import com.appsmith.server.domains.Layout;
import com.mobtools.server.repositories.LayoutRepository; import com.appsmith.server.repositories.LayoutRepository;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.ReactiveMongoTemplate; import org.springframework.data.mongodb.core.ReactiveMongoTemplate;

View File

@ -1,11 +1,11 @@
package com.mobtools.server.services; package com.appsmith.server.services;
import com.github.mustachejava.DefaultMustacheFactory; import com.github.mustachejava.DefaultMustacheFactory;
import com.github.mustachejava.Mustache; import com.github.mustachejava.Mustache;
import com.github.mustachejava.MustacheFactory; import com.github.mustachejava.MustacheFactory;
import com.mobtools.server.domains.Query; import com.appsmith.server.domains.Query;
import com.mobtools.server.dtos.CommandQueryParams; import com.appsmith.server.dtos.CommandQueryParams;
import com.mobtools.server.dtos.Param; import com.appsmith.server.dtos.Param;
import reactor.core.publisher.Flux; import reactor.core.publisher.Flux;
import java.io.StringReader; import java.io.StringReader;

View File

@ -1,10 +1,10 @@
package com.mobtools.server.services; package com.appsmith.server.services;
import com.mobtools.server.domains.Plugin; import com.appsmith.server.domains.Plugin;
import com.mobtools.server.domains.PluginType; import com.appsmith.server.domains.PluginType;
import com.mobtools.server.domains.Tenant; import com.appsmith.server.domains.Tenant;
import com.mobtools.server.dtos.PluginTenantDTO; import com.appsmith.server.dtos.PluginTenantDTO;
import com.mobtools.server.exceptions.MobtoolsException; import com.appsmith.server.exceptions.AppsmithException;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;
public interface PluginService extends CrudService<Plugin, String> { public interface PluginService extends CrudService<Plugin, String> {
@ -19,7 +19,7 @@ public interface PluginService extends CrudService<Plugin, String> {
*/ */
PluginExecutor getPluginExecutor(PluginType pluginType, String className); PluginExecutor getPluginExecutor(PluginType pluginType, String className);
public Mono<Plugin> create(Plugin plugin) throws MobtoolsException; public Mono<Plugin> create(Plugin plugin) throws AppsmithException;
public Mono<Tenant> installPlugin(PluginTenantDTO plugin); public Mono<Tenant> installPlugin(PluginTenantDTO plugin);

View File

@ -1,15 +1,15 @@
package com.mobtools.server.services; package com.appsmith.server.services;
import com.mobtools.server.configurations.ClientUserRepository; import com.appsmith.server.configurations.ClientUserRepository;
import com.mobtools.server.domains.Plugin; import com.appsmith.server.domains.Plugin;
import com.mobtools.server.domains.PluginType; import com.appsmith.server.domains.PluginType;
import com.mobtools.server.domains.Tenant; import com.appsmith.server.domains.Tenant;
import com.mobtools.server.domains.TenantPlugin; import com.appsmith.server.domains.TenantPlugin;
import com.mobtools.server.dtos.PluginTenantDTO; import com.appsmith.server.dtos.PluginTenantDTO;
import com.mobtools.server.dtos.TenantPluginStatus; import com.appsmith.server.dtos.TenantPluginStatus;
import com.mobtools.server.exceptions.MobtoolsException; import com.appsmith.server.exceptions.AppsmithException;
import com.mobtools.server.repositories.PluginRepository; import com.appsmith.server.repositories.PluginRepository;
import com.mobtools.server.repositories.UserRepository; import com.appsmith.server.repositories.UserRepository;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.bson.types.ObjectId; import org.bson.types.ObjectId;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -69,9 +69,9 @@ public class PluginServiceImpl extends BaseService<PluginRepository, Plugin, Str
} }
@Override @Override
public Mono<Plugin> create(Plugin plugin) throws MobtoolsException { public Mono<Plugin> create(Plugin plugin) throws AppsmithException {
if (plugin.getId() != null) { if (plugin.getId() != null) {
throw new MobtoolsException("During create plugin, Id is not null. Can't create new plugin."); throw new AppsmithException("During create plugin, Id is not null. Can't create new plugin.");
} }
plugin.setDeleted(false); plugin.setDeleted(false);
return pluginRepository.save(plugin); return pluginRepository.save(plugin);

View File

@ -1,7 +1,7 @@
package com.mobtools.server.services; package com.appsmith.server.services;
import com.mobtools.server.domains.Query; import com.appsmith.server.domains.Query;
import com.mobtools.server.dtos.CommandQueryParams; import com.appsmith.server.dtos.CommandQueryParams;
import reactor.core.publisher.Flux; import reactor.core.publisher.Flux;
public interface QueryService extends CrudService<Query, String> { public interface QueryService extends CrudService<Query, String> {

View File

@ -1,9 +1,9 @@
package com.mobtools.server.services; package com.appsmith.server.services;
import com.mobtools.server.domains.Query; import com.appsmith.server.domains.Query;
import com.mobtools.server.dtos.CommandQueryParams; import com.appsmith.server.dtos.CommandQueryParams;
import com.mobtools.server.exceptions.MobtoolsException; import com.appsmith.server.exceptions.AppsmithException;
import com.mobtools.server.repositories.QueryRepository; import com.appsmith.server.repositories.QueryRepository;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.ReactiveMongoTemplate; import org.springframework.data.mongodb.core.ReactiveMongoTemplate;
@ -36,7 +36,7 @@ public class QueryServiceImpl extends BaseService<QueryRepository, Query, String
// 1. Fetch the query from the DB to get the type // 1. Fetch the query from the DB to get the type
Mono<Query> queryMono = repository.findByName(name) Mono<Query> queryMono = repository.findByName(name)
.switchIfEmpty(Mono.defer(() -> Mono.error(new MobtoolsException("Unable to find query by id: " + name)))); .switchIfEmpty(Mono.defer(() -> Mono.error(new AppsmithException("Unable to find query by id: " + name))));
// 2. Instantiate the implementation class based on the query type // 2. Instantiate the implementation class based on the query type
Mono<PluginExecutor> pluginExecutorMono = queryMono.map(queryObj -> Mono<PluginExecutor> pluginExecutorMono = queryMono.map(queryObj ->

View File

@ -0,0 +1,6 @@
package com.appsmith.server.services;
import com.appsmith.server.domains.Resource;
public interface ResourceService extends CrudService<Resource, String> {
}

View File

@ -1,11 +1,11 @@
package com.mobtools.server.services; package com.appsmith.server.services;
import com.mobtools.server.domains.Plugin; import com.appsmith.server.domains.Plugin;
import com.mobtools.server.domains.Resource; import com.appsmith.server.domains.Resource;
import com.mobtools.server.domains.Tenant; import com.appsmith.server.domains.Tenant;
import com.mobtools.server.domains.TenantPlugin; import com.appsmith.server.domains.TenantPlugin;
import com.mobtools.server.exceptions.MobtoolsException; import com.appsmith.server.exceptions.AppsmithException;
import com.mobtools.server.repositories.ResourceRepository; import com.appsmith.server.repositories.ResourceRepository;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -39,9 +39,9 @@ public class ResourceServiceImpl extends BaseService<ResourceRepository, Resourc
} }
@Override @Override
public Mono<Resource> create(@NotNull Resource resource) throws MobtoolsException { public Mono<Resource> create(@NotNull Resource resource) throws AppsmithException {
if (resource.getId() != null) { if (resource.getId() != null) {
throw new MobtoolsException("During create resource, Id is not null. Can't create new resource."); throw new AppsmithException("During create resource, Id is not null. Can't create new resource.");
} }
Mono<Tenant> tenantMono = tenantService.findById(tenantId); Mono<Tenant> tenantMono = tenantService.findById(tenantId);

View File

@ -1,6 +1,6 @@
package com.mobtools.server.services; package com.appsmith.server.services;
import com.mobtools.server.domains.Setting; import com.appsmith.server.domains.Setting;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;
public interface SettingService extends CrudService<Setting, String> { public interface SettingService extends CrudService<Setting, String> {

View File

@ -1,7 +1,7 @@
package com.mobtools.server.services; package com.appsmith.server.services;
import com.mobtools.server.domains.Setting; import com.appsmith.server.domains.Setting;
import com.mobtools.server.repositories.SettingRepository; import com.appsmith.server.repositories.SettingRepository;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.ReactiveMongoTemplate; import org.springframework.data.mongodb.core.ReactiveMongoTemplate;
import org.springframework.data.mongodb.core.convert.MongoConverter; import org.springframework.data.mongodb.core.convert.MongoConverter;

View File

@ -1,6 +1,6 @@
package com.mobtools.server.services; package com.appsmith.server.services;
import com.mobtools.server.domains.Tenant; import com.appsmith.server.domains.Tenant;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;
public interface TenantService extends CrudService<Tenant, String> { public interface TenantService extends CrudService<Tenant, String> {

View File

@ -1,9 +1,9 @@
package com.mobtools.server.services; package com.appsmith.server.services;
import com.mobtools.server.domains.Setting; import com.appsmith.server.domains.Setting;
import com.mobtools.server.domains.Tenant; import com.appsmith.server.domains.Tenant;
import com.mobtools.server.domains.TenantSetting; import com.appsmith.server.domains.TenantSetting;
import com.mobtools.server.repositories.TenantRepository; import com.appsmith.server.repositories.TenantRepository;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.ReactiveMongoTemplate; import org.springframework.data.mongodb.core.ReactiveMongoTemplate;

View File

@ -1,6 +1,6 @@
package com.mobtools.server.services; package com.appsmith.server.services;
import com.mobtools.server.domains.User; import com.appsmith.server.domains.User;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;
public interface UserService extends CrudService<User, String> { public interface UserService extends CrudService<User, String> {

View File

@ -1,7 +1,7 @@
package com.mobtools.server.services; package com.appsmith.server.services;
import com.mobtools.server.domains.User; import com.appsmith.server.domains.User;
import com.mobtools.server.repositories.UserRepository; import com.appsmith.server.repositories.UserRepository;
import org.springframework.data.mongodb.core.ReactiveMongoTemplate; import org.springframework.data.mongodb.core.ReactiveMongoTemplate;
import org.springframework.data.mongodb.core.convert.MongoConverter; import org.springframework.data.mongodb.core.convert.MongoConverter;
import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetails;

View File

@ -1,6 +1,6 @@
package com.mobtools.server.services; package com.appsmith.server.services;
import com.mobtools.server.domains.Widget; import com.appsmith.server.domains.Widget;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;
public interface WidgetService extends CrudService<Widget, String> { public interface WidgetService extends CrudService<Widget, String> {

View File

@ -1,7 +1,7 @@
package com.mobtools.server.services; package com.appsmith.server.services;
import com.mobtools.server.domains.Widget; import com.appsmith.server.domains.Widget;
import com.mobtools.server.repositories.WidgetRepository; import com.appsmith.server.repositories.WidgetRepository;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.ReactiveMongoTemplate; import org.springframework.data.mongodb.core.ReactiveMongoTemplate;

View File

@ -1,8 +0,0 @@
package com.mobtools.server.exceptions;
public class MobtoolsException extends Exception {
public MobtoolsException(String msg) {
super(msg);
}
}

View File

@ -1,6 +0,0 @@
package com.mobtools.server.services;
import com.mobtools.server.domains.Layout;
public interface LayoutService extends CrudService<Layout, String> {
}

View File

@ -1,6 +0,0 @@
package com.mobtools.server.services;
import com.mobtools.server.domains.Resource;
public interface ResourceService extends CrudService<Resource, String> {
}

View File

@ -6,7 +6,7 @@ spring.data.mongodb.port=27017
#spring.data.mongodb.password= #spring.data.mongodb.password=
logging.level.root=info logging.level.root=info
logging.level.com.mobtools=debug logging.level.com.appsmith=debug
logging.pattern.console=%X - %m%n logging.pattern.console=%X - %m%n
# JDBC Postgres properties # JDBC Postgres properties

View File

@ -4,7 +4,7 @@ spring.data.mongodb.uri=mongodb+srv://admin:Y9PuxM52gcP3Dgfo@mobtools-test-clust
spring.data.mongodb.authentication-database=admin spring.data.mongodb.authentication-database=admin
logging.level.root=info logging.level.root=info
logging.level.com.mobtools=debug logging.level.com.appsmith=debug
logging.pattern.console=%X - %m%n logging.pattern.console=%X - %m%n
# JDBC Postgres properties # JDBC Postgres properties

View File

@ -1,4 +1,4 @@
package com.mobtools.server; package com.appsmith.server;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;