|
@@ -9,11 +9,8 @@ type InfoStruct interface {
|
|
|
BankInfo
|
|
BankInfo
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// 银行控件
|
|
|
|
|
-type BankInfo struct {
|
|
|
|
|
- ID string `json:"id"`
|
|
|
|
|
- Name string `json:"name"`
|
|
|
|
|
- Code string `json:"code"`
|
|
|
|
|
|
|
+type InfosStruct interface {
|
|
|
|
|
+ ProjectInfo | DeptInfo | IDName | SubjectIDName
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func ExtractInfo[T InfoStruct](infoStr string) (*T, error) {
|
|
func ExtractInfo[T InfoStruct](infoStr string) (*T, error) {
|
|
@@ -29,23 +26,6 @@ func ExtractInfo[T InfoStruct](infoStr string) (*T, error) {
|
|
|
return info, nil
|
|
return info, nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-type InfosStruct interface {
|
|
|
|
|
- ProjectInfo | DeptInfo
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 项目控件
|
|
|
|
|
-type ProjectInfo struct {
|
|
|
|
|
- ID string `json:"id"`
|
|
|
|
|
- Name string `json:"name"`
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 部门控件
|
|
|
|
|
-type DeptInfo struct {
|
|
|
|
|
- Type string `json:"type"`
|
|
|
|
|
- ID string `json:"subjectId"`
|
|
|
|
|
- Name string `json:"name"`
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
func ExtractInfoFormInfos[T InfosStruct](infosStr string) (*T, error) {
|
|
func ExtractInfoFormInfos[T InfosStruct](infosStr string) (*T, error) {
|
|
|
infos, err := ExtractInfos[T](infosStr)
|
|
infos, err := ExtractInfos[T](infosStr)
|
|
|
if err != nil {
|
|
if err != nil {
|