forked from 2pm.tech/traqtor
[Closes #3] Crypto added to core
parent
f06d2ebcb8
commit
50cf58da9a
@ -0,0 +1,13 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:13-alpine
|
||||||
|
volumes:
|
||||||
|
- ../postgres/:/var/lib/postgresql/data
|
||||||
|
environment:
|
||||||
|
- POSTGRES_INITDB_ARGS=--encoding=UTF8 --locale=en_US.UTF-8 --lc-collate=en_US.UTF-8 --lc-ctype=en_US.UTF-8 --lc-messages=en_US.UTF-8 --lc-monetary=en_US.UTF-8 --lc-numeric=en_US.UTF-8 --lc-time=en_US.UTF-8
|
||||||
|
- POSTGRES_USER=traqtor
|
||||||
|
- POSTGRES_PASSWORD=traqtor
|
||||||
|
ports:
|
||||||
|
- 10240:5432
|
||||||
@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
CURRENT_UID=$(id -u):$(id -g) docker-compose -f ./.dev/docker/dev-env.yml -p traqtor --compatibility up
|
||||||
@ -1,45 +1,12 @@
|
|||||||
package two.pm.traqtor;
|
package two.pm.traqtor;
|
||||||
|
|
||||||
import io.quarkus.runtime.annotations.QuarkusMain;
|
import io.quarkus.runtime.annotations.QuarkusMain;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
|
|
||||||
import org.apache.cayenne.ObjectContext;
|
|
||||||
import org.apache.cayenne.configuration.server.ServerRuntime;
|
|
||||||
import org.apache.cayenne.log.JdbcEventLogger;
|
|
||||||
import org.apache.cayenne.log.NoopJdbcEventLogger;
|
|
||||||
import org.apache.cayenne.query.SQLExec;
|
|
||||||
import io.quarkus.runtime.Quarkus;
|
import io.quarkus.runtime.Quarkus;
|
||||||
|
|
||||||
@QuarkusMain
|
@QuarkusMain
|
||||||
public class TraQtor {
|
public class TraQtor {
|
||||||
// public static ServerRuntime cayenneRuntime;
|
|
||||||
|
|
||||||
public static void main(String... args) {
|
public static void main(String... args) {
|
||||||
// if (cayenneRuntime == null) {
|
|
||||||
|
|
||||||
// .performInTransaction(() -> {
|
|
||||||
// // ... do some changes
|
|
||||||
// context.commitChanges();
|
|
||||||
|
|
||||||
// // ... do more changes
|
|
||||||
// context.commitChanges();
|
|
||||||
|
|
||||||
// return true;
|
|
||||||
// });
|
|
||||||
|
|
||||||
// Module cryptoExtensions = CryptoModule.extend()
|
|
||||||
// .keyStore("file:///mykeystore", "keystorepassword".toCharArray(), "keyalias")
|
|
||||||
// .compress()
|
|
||||||
// .module();
|
|
||||||
|
|
||||||
// cayenneRuntime =
|
|
||||||
// ServerRuntime.builder().addConfig("cayenne/cayenne-traqtor.xml")
|
|
||||||
// .addModule(binder ->
|
|
||||||
// binder.bind(JdbcEventLogger.class).to(NoopJdbcEventLogger.class)).build();
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
System.out.println("Running main method");
|
System.out.println("Running main method");
|
||||||
Quarkus.run(args);
|
Quarkus.run(args);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,30 @@
|
|||||||
|
package two.pm.traqtor.db;
|
||||||
|
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
|
import org.apache.cayenne.Cayenne;
|
||||||
|
|
||||||
|
import two.pm.traqtor.db.auto._SystemUser;
|
||||||
|
|
||||||
|
public class SystemUser extends _SystemUser {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public DTO dto() {
|
||||||
|
return new DTO(Cayenne.longPKForObject(this), email, password);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final class DTO {
|
||||||
|
|
||||||
|
public String email;
|
||||||
|
public String password;
|
||||||
|
public String id;
|
||||||
|
|
||||||
|
public DTO(long id, String email, String password) {
|
||||||
|
this.id = Long.toHexString(id);
|
||||||
|
this.email = email;
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,21 +0,0 @@
|
|||||||
package two.pm.traqtor.db;
|
|
||||||
|
|
||||||
import two.pm.traqtor.db.auto._User;
|
|
||||||
|
|
||||||
public class User extends _User {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
public static class DTO {
|
|
||||||
|
|
||||||
public String email;
|
|
||||||
public String id;
|
|
||||||
|
|
||||||
public DTO(String id, String email) {
|
|
||||||
this.id = id;
|
|
||||||
this.email = email;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<graphs xmlns="http://cayenne.apache.org/schema/10/graph">
|
<graphs xmlns="http://cayenne.apache.org/schema/10/graph">
|
||||||
<graph type="ER" scale="1.0">
|
<graph type="ER" scale="1.0">
|
||||||
<entity name="user" x="23.0" y="20.0" width="35.0" height="62.0"/>
|
<entity name="system_user" x="23.0" y="20.0" width="115.0" height="77.0"/>
|
||||||
</graph>
|
</graph>
|
||||||
</graphs>
|
</graphs>
|
||||||
|
|||||||
Binary file not shown.
Loading…
Reference in New Issue