mirror of
https://github.com/dalbodeule/snap-admin.git
synced 2025-06-08 21:38:21 +00:00
More 'dbAdmin' renaming
This commit is contained in:
parent
4d34595186
commit
1fbd337c22
@ -76,7 +76,7 @@ public class DataExportController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(DataExportFormat.class);
|
||||
|
||||
@Autowired
|
||||
private SnapAdmin dbAdmin;
|
||||
private SnapAdmin snapAdmin;
|
||||
|
||||
@Autowired
|
||||
private SnapAdminRepository repository;
|
||||
@ -131,7 +131,7 @@ public class DataExportController {
|
||||
@RequestParam MultiValueMap<String, String> otherParams) {
|
||||
if (raw == null) raw = false;
|
||||
|
||||
DbObjectSchema schema = dbAdmin.findSchemaByClassName(className);
|
||||
DbObjectSchema schema = snapAdmin.findSchemaByClassName(className);
|
||||
|
||||
if (!schema.isExportEnabled()) {
|
||||
throw new SnapAdminException("Export is not enabled for this table: " + schema.getTableName());
|
||||
|
@ -53,7 +53,7 @@ public class FileDownloadController {
|
||||
private SnapAdminRepository repository;
|
||||
|
||||
@Autowired
|
||||
private SnapAdmin dbAdmin;
|
||||
private SnapAdmin snapAdmin;
|
||||
|
||||
|
||||
/**
|
||||
@ -68,7 +68,7 @@ public class FileDownloadController {
|
||||
public ResponseEntity<byte[]> serveImage(@PathVariable String className,
|
||||
@PathVariable String fieldName, @PathVariable String id) {
|
||||
|
||||
DbObjectSchema schema = dbAdmin.findSchemaByClassName(className);
|
||||
DbObjectSchema schema = snapAdmin.findSchemaByClassName(className);
|
||||
|
||||
Optional<DbObject> object = repository.findById(schema, id);
|
||||
|
||||
@ -99,7 +99,7 @@ public class FileDownloadController {
|
||||
public ResponseEntity<byte[]> serveFile(@PathVariable String className,
|
||||
@PathVariable String fieldName, @PathVariable String id) {
|
||||
|
||||
DbObjectSchema schema = dbAdmin.findSchemaByClassName(className);
|
||||
DbObjectSchema schema = snapAdmin.findSchemaByClassName(className);
|
||||
|
||||
Optional<DbObject> object = repository.findById(schema, id);
|
||||
|
||||
|
@ -49,7 +49,7 @@ public class GlobalController {
|
||||
private UserConfiguration userConf;
|
||||
|
||||
@Autowired
|
||||
private SnapAdmin dbAdmin;
|
||||
private SnapAdmin snapAdmin;
|
||||
|
||||
@ExceptionHandler(SnapAdminException.class)
|
||||
public String handleException(Exception e, Model model, HttpServletResponse response) {
|
||||
@ -58,7 +58,7 @@ public class GlobalController {
|
||||
model.addAttribute("message", e.getMessage());
|
||||
model.addAttribute("snapadmin_userConf", userConf);
|
||||
model.addAttribute("snapadmin_baseUrl", getBaseUrl());
|
||||
model.addAttribute("snapadmin_version", dbAdmin.getVersion());
|
||||
model.addAttribute("snapadmin_version", snapAdmin.getVersion());
|
||||
model.addAttribute("snapadmin_properties", props);
|
||||
return "other/error";
|
||||
}
|
||||
@ -70,7 +70,7 @@ public class GlobalController {
|
||||
model.addAttribute("message", e.getMessage());
|
||||
model.addAttribute("snapadmin_userConf", userConf);
|
||||
model.addAttribute("snapadmin_baseUrl", getBaseUrl());
|
||||
model.addAttribute("snapadmin_version", dbAdmin.getVersion());
|
||||
model.addAttribute("snapadmin_version", snapAdmin.getVersion());
|
||||
model.addAttribute("snapadmin_properties", props);
|
||||
response.setStatus(404);
|
||||
return "other/error";
|
||||
@ -78,7 +78,7 @@ public class GlobalController {
|
||||
|
||||
@ModelAttribute("snapadmin_version")
|
||||
public String getVersion() {
|
||||
return dbAdmin.getVersion();
|
||||
return snapAdmin.getVersion();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -128,7 +128,7 @@ public class GlobalController {
|
||||
|
||||
@ModelAttribute("snapadmin_authenticated")
|
||||
public boolean isAuthenticated() {
|
||||
return dbAdmin.isAuthenticated();
|
||||
return snapAdmin.isAuthenticated();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ import tech.ailef.snapadmin.external.dto.AutocompleteSearchResult;
|
||||
@RequestMapping(value= {"/${snapadmin.baseUrl}/api/autocomplete", "/${snapadmin.baseUrl}/api/autocomplete/"})
|
||||
public class AutocompleteController {
|
||||
@Autowired
|
||||
private SnapAdmin dbAdmin;
|
||||
private SnapAdmin snapAdmin;
|
||||
|
||||
@Autowired
|
||||
private SnapAdminRepository repository;
|
||||
@ -55,7 +55,7 @@ public class AutocompleteController {
|
||||
*/
|
||||
@GetMapping("/{className}")
|
||||
public ResponseEntity<?> autocomplete(@PathVariable String className, @RequestParam String query) {
|
||||
DbObjectSchema schema = dbAdmin.findSchemaByClassName(className);
|
||||
DbObjectSchema schema = snapAdmin.findSchemaByClassName(className);
|
||||
|
||||
List<AutocompleteSearchResult> search = repository.search(schema, query)
|
||||
.stream().map(x -> new AutocompleteSearchResult(x))
|
||||
|
@ -66,7 +66,7 @@ public class SnapAdminRepository {
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
@Autowired
|
||||
private SnapAdmin dbAdmin;
|
||||
private SnapAdmin snapAdmin;
|
||||
|
||||
public SnapAdminRepository() {
|
||||
}
|
||||
@ -304,7 +304,7 @@ public class SnapAdminRepository {
|
||||
Object o = rs.getObject(i + 1);
|
||||
String columnName = metaData.getColumnName(i + 1);
|
||||
String tableName = metaData.getTableName(i + 1);
|
||||
DbQueryOutputField field = new DbQueryOutputField(columnName, tableName, dbAdmin);
|
||||
DbQueryOutputField field = new DbQueryOutputField(columnName, tableName, snapAdmin);
|
||||
|
||||
result.put(field, o);
|
||||
}
|
||||
|
@ -39,12 +39,12 @@ public class DbQueryOutputField {
|
||||
|
||||
private DbQueryResultRow result;
|
||||
|
||||
public DbQueryOutputField(String name, String table, SnapAdmin dbAdmin) {
|
||||
public DbQueryOutputField(String name, String table, SnapAdmin snapAdmin) {
|
||||
this.name = name;
|
||||
this.table = table;
|
||||
|
||||
try {
|
||||
DbObjectSchema schema = dbAdmin.findSchemaByTableName(table);
|
||||
DbObjectSchema schema = snapAdmin.findSchemaByTableName(table);
|
||||
DbField dbField = schema.getFieldByName(name);
|
||||
this.dbField = dbField;
|
||||
} catch (SnapAdminException e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user