fix 修复获取option items不正确的问题
All checks were successful
Build image / build (push) Successful in 1m25s

This commit is contained in:
timerzz 2024-05-21 13:44:46 +08:00
parent 5561757e17
commit 56f3155d99
3 changed files with 3 additions and 5 deletions

View File

@ -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"
)

View File

@ -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,
})
}

View File

@ -2,7 +2,6 @@ package service
import (
"context"
push "gitea.timerzz.com/kedaya_haitao/pusher/kitex_gen/push"
"testing"
)