// Copyright 2019 getensh.com. All rights reserved.
// Use of this source code is governed by getensh.com.

package gd_management

type SupplementData struct {
	Title string `json:"title"`
	Key   string `json:"key"`
	Value string `json:"value"`
	Type  string `json:"type"`
}
type TGdDataEditorSearch struct {
	SearchCode string `json:"search_code"`
	SearchName string `json:"search_name"`
}

type Search struct {
	SearchKey   string `json:"search_key"`
	SearchName  string `json:"search_name"`
	SearchValue string `json:"search_value"`
	Type        string `json:"type"`
}

type SearchElement struct {
	SearchCode string   `json:"search_code"`
	SearchName string   `json:"search_name"`
	Keys       []Search `json:"keys"`
}

// 获取补充数据标题
type ManagementGetSuplementTitleReq struct {
	DbCode string `json:"db_code"`
}

type ManagementGetSuplementTitleReply struct {
	DataTitle  []SupplementData `json:"data_title"`
	SearchData []SearchElement  `json:"search_data"`
}

// 获取将要补充的数据
type ManagementGetDataSupplementReq struct {
	SearchCode string   `json:"search_code"`
	Keys       []Search `json:"keys"`
}

type ManagementGetDataSupplementReply struct {
	List []SupplementData `json:"list"`
	Id   int64            `json:"id"`
}

// 提交补充的数据
type ManagementUpdateDataSupplementReq struct {
	SearchCode string           `json:"search_code"`
	List       []SupplementData `json:"list"`
	Id         int64            `json:"id"`
}

type ManagementUpdateDataSupplementReply struct {
	Id int64 `json:"id"`
}

type TGdDataEditorDb struct {
	DbName string `json:"db_name"`
	DbCode string `json:"db_code"`
}

// 获取所有库
type ManagementGetSupplementDbReq struct {
}

type ManagementGetSupplementDbReply struct {
	List []TGdDataEditorDb `json:"list"`
}
