12345678910111213141516171819202122 |
- package query
- import (
- "context"
- "adm-vehicle-style/errors"
- v1 "adm-vehicle-style/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){
- "001": BrandList,
- "002": SeriesList,
- "003": StyleList,
- }
- if v, ok := interfaces[req.Code]; ok {
- return v(ctx, req.Params)
- }
- return reply, errors.InterfaceNoExistError
- }
|