Skip to content

Commit

Permalink
feat: add get discord message logs api
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhuyhoang committed Oct 8, 2024
1 parent ec17de8 commit dc910f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/handler/discord/discord.go
Original file line number Diff line number Diff line change
Expand Up @@ -787,11 +787,11 @@ func (h *handler) SweepOgifEvent(c *gin.Context) {
// @Param discord_channel_id path string true "Channel Discord ID"
// @Param startDate query string true "Start Date"
// @Param endDate query string true "End Date"
// @Success 200 {object} ListResearchTopicResponse
// @Success 200 {object} ListDiscordTextMessageLog
// @Failure 400 {object} ErrorResponse
// @Failure 404 {object} ErrorResponse
// @Failure 500 {object} ErrorResponse
// @Router /discords/{discord_channel_id}/message-logs [get]
// @Router /discords/channels/{discord_channel_id}/message-logs [get]
func (h *handler) ListChannelMessageLogs(c *gin.Context) {
var input = request.GetChannelMessagesInput{
DiscordChannelID: c.Param("discord_channel_id"),
Expand Down
4 changes: 4 additions & 0 deletions pkg/view/discord_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ type DiscordTextMessageLog struct {
Timestamp time.Time `json:"timestamp"`
}

type ListDiscordTextMessageLog struct {
Data []DiscordTextMessageLog `json:"data"`
} // @name ListDiscordTextMessageLog

func ToDiscordTextMessageLog(message model.DiscordTextMessageLog) DiscordTextMessageLog {
return DiscordTextMessageLog{
ID: message.ID,
Expand Down

0 comments on commit dc910f2

Please sign in to comment.