diff --git a/biz/service/add_test.go b/biz/service/add_test.go index 2bc0c8f..18cc06b 100644 --- a/biz/service/add_test.go +++ b/biz/service/add_test.go @@ -3,7 +3,6 @@ package service import ( "context" config "gitea.timerzz.com/kedaya_haitao/pusher/kitex_gen/config" - push "gitea.timerzz.com/kedaya_haitao/pusher/kitex_gen/push" "testing" ) diff --git a/biz/service/get_pusher_options.go b/biz/service/get_pusher_options.go index 5e6f715..650d65c 100644 --- a/biz/service/get_pusher_options.go +++ b/biz/service/get_pusher_options.go @@ -26,13 +26,13 @@ func (s *GetPusherOptionsService) Run() (resp *push.GetPusherOptionsResponse, er } func toFormItems(in any) []*config.FormItem { - valueOfIn := reflect.ValueOf(in) + valueOfIn := reflect.TypeOf(in) numOfFields := valueOfIn.NumField() items := make([]*config.FormItem, 0, numOfFields) for i := 0; i < numOfFields; i++ { items = append(items, &config.FormItem{ - Param: valueOfIn.Field(i).String(), - Type: valueOfIn.Field(i).Type().String(), + Param: valueOfIn.Field(i).Tag.Get("json"), + Type: valueOfIn.Field(i).Type.Kind().String(), Require: true, }) } diff --git a/biz/service/get_pusher_options_test.go b/biz/service/get_pusher_options_test.go index e83d411..669d634 100644 --- a/biz/service/get_pusher_options_test.go +++ b/biz/service/get_pusher_options_test.go @@ -2,7 +2,6 @@ package service import ( "context" - push "gitea.timerzz.com/kedaya_haitao/pusher/kitex_gen/push" "testing" )