horse, mdb: include id in lobby conversations
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline was successful

This commit is contained in:
2026-09-17 12:59:28 -04:00
parent 6828b1bd88
commit 0ffd2c099a
4 changed files with 22 additions and 7 deletions
+2
View File
@@ -28,6 +28,8 @@ type AffinityDetail struct {
// Conversation describes a lobby conversation. // Conversation describes a lobby conversation.
type Conversation struct { type Conversation struct {
// ID is the conversation ID.
ID int32 `json:"id"`
// CharacterID is the ID of the character who has the conversation as // CharacterID is the ID of the character who has the conversation as
// a gallery entry. // a gallery entry.
CharacterID CharacterID `json:"chara_id"` CharacterID CharacterID `json:"chara_id"`
+8 -7
View File
@@ -89,13 +89,14 @@ func Umas(ctx context.Context, db *sqlitex.Pool) ([]horse.Uma, error) {
func Conversations(ctx context.Context, db *sqlitex.Pool) ([]horse.Conversation, error) { func Conversations(ctx context.Context, db *sqlitex.Pool) ([]horse.Conversation, error) {
return load(ctx, db, make([]horse.Conversation, 0, 1024), conversationSQL, func(s *sqlite.Stmt) horse.Conversation { return load(ctx, db, make([]horse.Conversation, 0, 1024), conversationSQL, func(s *sqlite.Stmt) horse.Conversation {
return horse.Conversation{ return horse.Conversation{
CharacterID: horse.CharacterID(s.ColumnInt(0)), ID: s.ColumnInt32(0),
Number: s.ColumnInt(1), CharacterID: horse.CharacterID(s.ColumnInt(1)),
Location: horse.LobbyConversationLocationID(s.ColumnInt(2)), Number: s.ColumnInt(2),
Chara1: horse.CharacterID(s.ColumnInt(3)), Location: horse.LobbyConversationLocationID(s.ColumnInt(3)),
Chara2: horse.CharacterID(s.ColumnInt(4)), Chara1: horse.CharacterID(s.ColumnInt(4)),
Chara3: horse.CharacterID(s.ColumnInt(5)), Chara2: horse.CharacterID(s.ColumnInt(5)),
ConditionType: s.ColumnInt(6), Chara3: horse.CharacterID(s.ColumnInt(6)),
ConditionType: s.ColumnInt(7),
} }
}) })
} }
+11
View File
@@ -238,12 +238,14 @@ func TestConversations(t *testing.T) {
} }
want := []horse.Conversation{ want := []horse.Conversation{
{ {
ID: 1,
CharacterID: 1001, CharacterID: 1001,
Number: 1, Number: 1,
Location: 410, Location: 410,
Chara1: 1001, Chara1: 1001,
}, },
{ {
ID: 2,
CharacterID: 1001, CharacterID: 1001,
Number: 2, Number: 2,
Location: 510, Location: 510,
@@ -251,6 +253,7 @@ func TestConversations(t *testing.T) {
ConditionType: 1, ConditionType: 1,
}, },
{ {
ID: 3,
CharacterID: 1001, CharacterID: 1001,
Number: 3, Number: 3,
Location: 310, Location: 310,
@@ -258,6 +261,7 @@ func TestConversations(t *testing.T) {
ConditionType: 1, ConditionType: 1,
}, },
{ {
ID: 76,
CharacterID: 1001, CharacterID: 1001,
Number: 4, Number: 4,
Location: 120, Location: 120,
@@ -266,6 +270,7 @@ func TestConversations(t *testing.T) {
ConditionType: 2, ConditionType: 2,
}, },
{ {
ID: 77,
CharacterID: 1001, CharacterID: 1001,
Number: 5, Number: 5,
Location: 520, Location: 520,
@@ -274,6 +279,7 @@ func TestConversations(t *testing.T) {
ConditionType: 3, ConditionType: 3,
}, },
{ {
ID: 126,
CharacterID: 1001, CharacterID: 1001,
Number: 6, Number: 6,
Location: 430, Location: 430,
@@ -283,12 +289,14 @@ func TestConversations(t *testing.T) {
ConditionType: 1, ConditionType: 1,
}, },
{ {
ID: 4,
CharacterID: 1002, CharacterID: 1002,
Number: 1, Number: 1,
Location: 310, Location: 310,
Chara1: 1002, Chara1: 1002,
}, },
{ {
ID: 5,
CharacterID: 1002, CharacterID: 1002,
Number: 2, Number: 2,
Location: 210, Location: 210,
@@ -296,6 +304,7 @@ func TestConversations(t *testing.T) {
ConditionType: 1, ConditionType: 1,
}, },
{ {
ID: 6,
CharacterID: 1002, CharacterID: 1002,
Number: 3, Number: 3,
Location: 110, Location: 110,
@@ -303,6 +312,7 @@ func TestConversations(t *testing.T) {
ConditionType: 1, ConditionType: 1,
}, },
{ {
ID: 78,
CharacterID: 1002, CharacterID: 1002,
Number: 4, Number: 4,
Location: 520, Location: 520,
@@ -311,6 +321,7 @@ func TestConversations(t *testing.T) {
ConditionType: 3, ConditionType: 3,
}, },
{ {
ID: 79,
CharacterID: 1002, CharacterID: 1002,
Number: 5, Number: 5,
Location: 220, Location: 220,
+1
View File
@@ -1,4 +1,5 @@
SELECT SELECT
id,
gallery_chara_id, gallery_chara_id,
disp_order, disp_order,
pos_id, pos_id,