12345678910111213141516171819202122232425262728293031323334353637383940 |
- package query
- import (
- "context"
- "strings"
- "adm-data/errors"
- v1 "adm-data/pb/v1"
- )
- func Query(ctx context.Context, req *v1.QueryRequest) (reply *v1.QueryResponse, err error) {
- interfaces := map[string]func(ctx context.Context, params string) (reply *v1.QueryResponse, err error){
- "P01": BrandList,
- "P02": SeriesList,
- "P03": StyleList,
- "P04": SearchStyle,
- "P05": p05,
- "P06": p06,
- "P07": SearchStyleMapping,
- "P08": p08,
- "P09": p09,
- "P10": p10,
- "A01": PlateVIN,
- "A02": VINBasicInfo,
- "A03": ModelSearch,
- "V01": PlateOwner,
- "IS01": InsuranceDate,
- "V02": V02,
- "U01": U01,
- "A04": a04,
- "A05": a05,
- "P11": p11,
- }
- if v, ok := interfaces[strings.ToUpper(req.Code)]; ok {
- return v(ctx, req.Params)
- }
- return reply, errors.InterfaceNoExistError
- }
|