Refactor brand service and related components
- Removed ListQuestionVersions method and associated types from BrandService and Queries. - Updated PromptRuleGenerationService to change task naming and handling. - Enhanced ScheduleTaskService to support filtering by created date range and keyword. - Introduced InstantTaskService for managing instant tasks with appropriate filtering and response structures. - Added InstantTaskHandler for handling API requests related to instant tasks. - Created InstantTaskTab component for the admin web interface to display and manage instant tasks. - Updated database migrations to rename source types for articles and generation tasks. - Adjusted models and repository queries to reflect the removal of question version handling.
This commit is contained in:
@@ -2,6 +2,7 @@ package transport
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
@@ -41,6 +42,25 @@ func (h *ScheduleTaskHandler) List(c *gin.Context) {
|
||||
if v := c.Query("status"); v != "" {
|
||||
params.Status = &v
|
||||
}
|
||||
if v := c.Query("keyword"); v != "" {
|
||||
params.Keyword = &v
|
||||
}
|
||||
if v := c.Query("created_from"); v != "" {
|
||||
parsed, err := time.Parse(time.RFC3339, v)
|
||||
if err != nil {
|
||||
response.Error(c, response.ErrBadRequest(40014, "invalid_created_from", "created_from must be RFC3339"))
|
||||
return
|
||||
}
|
||||
params.CreatedFrom = &parsed
|
||||
}
|
||||
if v := c.Query("created_to"); v != "" {
|
||||
parsed, err := time.Parse(time.RFC3339, v)
|
||||
if err != nil {
|
||||
response.Error(c, response.ErrBadRequest(40015, "invalid_created_to", "created_to must be RFC3339"))
|
||||
return
|
||||
}
|
||||
params.CreatedTo = &parsed
|
||||
}
|
||||
|
||||
data, err := h.svc.List(c.Request.Context(), params)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user