123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- package model
- //请求token
- type QueryToken struct{
- CertKey string `json:"certKey"`
- }
- //响应
- type ResponseToken struct{
- AccessToken string `json:"accessToken"`
- RefreshToken string `json:"refreshToken"`
- ExpiresAt int64 `json:"expiresAt"`
- }
- //数据库连接
- type DbConnInfo struct{
- Type string `validate:"required" json:"type"`
- Connection string `validate:"required" json:"connection"`
- DbName string `validate:"required" json:"dbName"`
- Mode string `validate:"required" json:"mode"` //连接模式:test:表示测试数据库是否连通,测试完成后自动断开,add表示添加数据库到管理队列。(add之前请先确保数据库已经添加到redis的database hash里面)
- Id int `validate:"-" json:"id"`
- }
- //动态创建数据库表
- /*
- 动态创建数据表
- dbid 数据库id(前面接口的那个id)
- connection 链接字符串
- dbName 数据库名称
- type 数据库类型
- tableName 表名
- columns 列字段数组,定义如下
- columnName 列名
- dataType 数据类型,固定传varchar
- dataLength 数据长度
- isPk 是否主键,1,0
- isRequired 是否必填, 1,0
- isIncrement 是否子增长
- */
- type ColnInfo struct {
- ColName string `json:"colName"`
- DataType string `json:"dataType"`
- DataLength int `json:"dataLength"`
- IsPk int `json:"isPk"` //是否是主键
- IsRequired int `json:"isRequired"`
- IsIncrement int `json:"isIncrement"`
- }
- type DatabaseCreateRequest struct {
- Id int `json:"id"`
- Connection string `json:"connection"`
- DbName string `json:"dbName"`
- DbType string `json:"dbType"`
- TbName string `json:"tbName"`
- Columns []ColnInfo `json:"columns"`
- }
- //动态插入数据
- type ColnData struct {
- ColName string `json:"colName"`
- ColVal string `json:"colVal"`
- }
- type ColnItem struct {
- List []string `json:"list"`
- }
- type ColnDataInsert struct{
- Id int `json:"id"`
- TbName string `json:"tbName"`
- Rows []ColnItem `json:"rows"`
- ColNameArray []string `json:"colNameArray"`
- }
- //动态添加或删除索引
- type TbIndex struct{
- Id int `json:"id"`
- TbName string `json:"tbName"`
- IndexArray []string `json:"indexArray"`
- }
- //查询数据库
- type SortCond struct{
- ColName string `json:"colName"`
- IsDesc int `json:"isDesc"` //1-降序 0-升序
- }
- type QueryCond struct{
- ColName string `json:"colName"`
- ColVal string `json:"colVal"`
- Cond int `json:"cond"`//0-等于 1-大于 2-小于
- }
- type QueryColn struct{
- }
- type DbQuery struct {
- Id int `validate:"required" json:"id"`
- PageNo int `validate:"required" json:"pageNo"`
- PageSize int `validate:"required" json:"pageSize"`
- TbName string `validate:"required" json:"tbName"`
- Query []QueryCond `json:"query"`
- Sort SortCond `json:"sort"`
- QueryColn []string `json:"cols"`
- }
- //输出表数据
- type TbDelete struct{
- Id int `json:"id"`
- TbName string `json:"tbName"`
- }
|