(request mcp.CallToolRequest)
| 143 | } |
| 144 | |
| 145 | func NewMCPSearchCond(request mcp.CallToolRequest) *MCPSearchCond { |
| 146 | cond := &MCPSearchCond{} |
| 147 | if keyword, ok := getRequestValue(request, MCPSearchCondKeyword); ok { |
| 148 | cond.Keyword = keyword |
| 149 | } |
| 150 | if username, ok := getRequestValue(request, MCPSearchCondUsername); ok { |
| 151 | cond.Username = username |
| 152 | } |
| 153 | if score, ok := getRequestNumber(request, MCPSearchCondScore); ok { |
| 154 | cond.Score = score |
| 155 | } |
| 156 | if tag, ok := getRequestValue(request, MCPSearchCondTag); ok { |
| 157 | cond.Tags = strings.Split(tag, ",") |
| 158 | } |
| 159 | if questionID, ok := getRequestValue(request, MCPSearchCondQuestionID); ok { |
| 160 | cond.QuestionID = questionID |
| 161 | } |
| 162 | return cond |
| 163 | } |
| 164 | |
| 165 | func NewMCPSearchAnswerCond(request mcp.CallToolRequest) *MCPSearchCond { |
| 166 | cond := &MCPSearchCond{} |
no test coverage detected