| 
									
										
										
										
											2024-11-21 12:18:28 +08:00
										 |  |  | package query | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import ( | 
					
						
							|  |  |  | 	"net/http" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-27 12:17:18 +08:00
										 |  |  | 	"tyc-server/app/main/api/internal/logic/query" | 
					
						
							|  |  |  | 	"tyc-server/app/main/api/internal/svc" | 
					
						
							|  |  |  | 	"tyc-server/app/main/api/internal/types" | 
					
						
							| 
									
										
										
										
											2025-04-09 15:58:06 +08:00
										 |  |  | 	"tyc-server/common/result" | 
					
						
							|  |  |  | 	"tyc-server/pkg/lzkit/validator" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-21 12:18:28 +08:00
										 |  |  | 	"github.com/zeromicro/go-zero/rest/httpx" | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func QueryDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { | 
					
						
							|  |  |  | 	return func(w http.ResponseWriter, r *http.Request) { | 
					
						
							|  |  |  | 		var req types.QueryDetailReq | 
					
						
							|  |  |  | 		if err := httpx.Parse(r, &req); err != nil { | 
					
						
							|  |  |  | 			result.ParamErrorResult(r, w, err) | 
					
						
							|  |  |  | 			return | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		if err := validator.Validate(req); err != nil { | 
					
						
							|  |  |  | 			result.ParamValidateErrorResult(r, w, err) | 
					
						
							|  |  |  | 			return | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		l := query.NewQueryDetailLogic(r.Context(), svcCtx) | 
					
						
							|  |  |  | 		resp, err := l.QueryDetail(&req) | 
					
						
							|  |  |  | 		result.HttpResult(r, w, resp, err) | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } |