mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-01-24 14:24:47 +08:00
add project/project channel DAOs
This commit is contained in:
parent
3484464d4c
commit
83e70d678c
@ -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);
|
||||
}
|
15
src/main/java/me/minidigger/hangar/db/dao/ProjectDao.java
Normal file
15
src/main/java/me/minidigger/hangar/db/dao/ProjectDao.java
Normal 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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user