|
@@ -2,12 +2,11 @@ package service
|
|
|
|
|
|
import (
|
|
|
"context"
|
|
|
- "fmt"
|
|
|
+ "resource-server/common"
|
|
|
)
|
|
|
|
|
|
import (
|
|
|
"google.golang.org/grpc/codes"
|
|
|
- "google.golang.org/grpc/metadata"
|
|
|
"google.golang.org/grpc/status"
|
|
|
)
|
|
|
|
|
@@ -20,10 +19,7 @@ type ConfigServer struct {
|
|
|
}
|
|
|
|
|
|
func (s *ConfigServer) ConfigOptionList(ctx context.Context, in *pb.ConfigOptionListRequest) (*pb.ConfigOptionListReply, error) {
|
|
|
- md, ok := metadata.FromIncomingContext(ctx)
|
|
|
- if ok {
|
|
|
- fmt.Printf("Received metadata: %v\n", md)
|
|
|
- }
|
|
|
+ product, _, _ := common.GetHeader(ctx)
|
|
|
res := pb.ConfigOptionListReply{}
|
|
|
switch in.GetFlag() {
|
|
|
case "TimeFormat":
|
|
@@ -60,12 +56,11 @@ func (s *ConfigServer) ConfigOptionList(ctx context.Context, in *pb.ConfigOption
|
|
|
res.ConfigOption = append(res.ConfigOption, &pb.ConfigOption{Flag: "FontFamily", Text: "Arial Unicode MS", Value: "Arial Unicode MS", Order: 1, IsEnabled: true})
|
|
|
res.ConfigOption = append(res.ConfigOption, &pb.ConfigOption{Flag: "FontFamily", Text: "Arial", Value: "Arial", Order: 2, IsEnabled: true})
|
|
|
case "MWL_Modality":
|
|
|
- if md.Get("product")[0] == "vetdroc" {
|
|
|
+ if product == common.PRODUCT_VET {
|
|
|
res.ConfigOption = append(res.ConfigOption, &pb.ConfigOption{Flag: "MWL_Modality", Text: "RF", Value: "RF", Order: 1, IsEnabled: true})
|
|
|
res.ConfigOption = append(res.ConfigOption, &pb.ConfigOption{Flag: "MWL_Modality", Text: "DX", Value: "DX", Order: 2, IsEnabled: true})
|
|
|
res.ConfigOption = append(res.ConfigOption, &pb.ConfigOption{Flag: "MWL_Modality", Text: "XA", Value: "XA", Order: 3, IsEnabled: true})
|
|
|
- }
|
|
|
- if md.Get("product")[0] == "droc" {
|
|
|
+ } else if product == common.PRODUCT_DROC {
|
|
|
res.ConfigOption = append(res.ConfigOption, &pb.ConfigOption{Flag: "MWL_Modality", Text: "DX", Value: "DX", Order: 1, IsEnabled: true})
|
|
|
res.ConfigOption = append(res.ConfigOption, &pb.ConfigOption{Flag: "MWL_Modality", Text: "CR", Value: "CR", Order: 2, IsEnabled: true})
|
|
|
}
|