fix 修复获取option items不正确的问题
All checks were successful
Build image / build (push) Successful in 1m25s
All checks were successful
Build image / build (push) Successful in 1m25s
This commit is contained in:
parent
5561757e17
commit
56f3155d99
@ -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"
|
||||
)
|
||||
|
||||
|
@ -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,
|
||||
})
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
push "gitea.timerzz.com/kedaya_haitao/pusher/kitex_gen/push"
|
||||
"testing"
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user