add project/project channel DAOs

This commit is contained in:
Jake Potrebic 2020-07-17 08:00:11 -07:00 committed by MiniDigger
parent 3484464d4c
commit 83e70d678c
2 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,15 @@
package me.minidigger.hangar.db.dao;
import me.minidigger.hangar.db.model.ProjectChannelsTable;
import org.jdbi.v3.sqlobject.customizer.BindBean;
import org.jdbi.v3.sqlobject.customizer.Timestamped;
import org.jdbi.v3.sqlobject.statement.GetGeneratedKeys;
import org.jdbi.v3.sqlobject.statement.SqlUpdate;
public interface ProjectChannelDao {
@SqlUpdate("insert into project_channels (created_at, name, color, project_id) values (:now, :name, :color, :projectId)")
@Timestamped
@GetGeneratedKeys
ProjectChannelsTable insert(@BindBean ProjectChannelsTable projectChannel);
}

View File

@ -0,0 +1,15 @@
package me.minidigger.hangar.db.dao;
import me.minidigger.hangar.db.model.ProjectsTable;
import org.jdbi.v3.sqlobject.customizer.BindBean;
import org.jdbi.v3.sqlobject.customizer.Timestamped;
import org.jdbi.v3.sqlobject.statement.GetGeneratedKeys;
import org.jdbi.v3.sqlobject.statement.SqlUpdate;
public interface ProjectDao {
@SqlUpdate("insert into projects (id, created_at, plugin_id, name, slug, owner_name, recommended_version_id, owner_id, topic_id, post_id, category, description, visibility, notes, keywords, homepage, issues, source, support, license_name, license_url, forum_sync) values (:id, :now, :pluginId, :name, :slug, :ownerName, :recommendedVersion, :ownerId, :topicId, :postId, :category, :description, :visibility, :notes, :keywords, :homepage, :issues, :source, :support, :licenseName, :licenseUrl, :forumSync)")
@Timestamped
@GetGeneratedKeys
ProjectsTable insert(@BindBean ProjectsTable project);
}