package param_v1_0

import (
	"gd_management_gateway/params/param_base"
	"gd_management_gateway/rpc_apis/gd_admin"
)

// 管理员注册
type AddAdminBody struct {
	AdminName   string `json:"admin_name" description:"管理员姓名"`
	AdminPasswd string `json:"admin_passwd" description:"管理员密码"`
	AdminPhone  string `json:"admin_phone"`
	AdminEmail  string `json:"admin_email"`
	GroupId     int    `json:"group_id" description:"分组id"`
	NodeId      string `json:"node_id"`
}

type AdminRegisterReq struct {
	param_base.BasicParam
	Body AddAdminBody `json:"body" require:"true" in:"body"`
}

type AdminRegisterResp struct {
	param_base.SimpleResp
	Data gd_admin.AdminRegisterReply `json:"data"`
}

// 删除管理员
type AdminDeleteReq struct {
	param_base.BasicParam
	AdminId int64 `json:"admin_id" description:"管理员唯一id" require:"true" in:"query"`
}

type AdminDeleteResp struct {
	param_base.SimpleResp
	Data gd_admin.AdminDeleteReply `json:"data"`
}

type AdminModifyBody struct {
	AdminId     int64  `json:"admin_id"`
	AdminPasswd string `json:"admin_passwd" description:"管理员密码" require:"false"`
	AdminPhone  string `json:"admin_phone" description:"管理员联系方式" require:"false"`
	AdminEmail  string `json:"admin_email" description:"管理员邮箱" require:"false"`
	GroupId     int    `json:"group_id" description:"分组id" require:"false"`
	NodeId      string `json:"node_id" description:"节点列表，用,分割" require:"false"`
}

// 修改管理员信息
type AdminModifyReq struct {
	param_base.BasicParam
	Body AdminModifyBody `json:"body" require:"true" in:"body"`
}

type AdminModifyResp struct {
	param_base.SimpleResp
	Data gd_admin.AdminModifyReply `json:"data"`
}

// 查看管理员列表
type AdminGetAllReq struct {
	param_base.BasicParam
	PageSize   int64  `json:"page_size" description:"页大小"  require:"false" in:"query"`
	PageNumber int64  `json:"page_number" description:"页号"  require:"false" in:"query"`
	Search     string `json:"search" description:"搜索"  require:"false" in:"query"`
}

type AdminGetAllResp struct {
	param_base.SimpleResp
	Data gd_admin.AdminGetAllReply `json:"data"`
}

type AdminLoginBody struct {
	AdminName   string `json:"admin_name" description:"管理员用户名" require:"true" in:"query"`
	AdminPasswd string `json:"admin_passwd" description:"管理员密码" require:"true" in:"query"`
}

// 管理员登录
type AdminLoginReq struct {
	Body AdminLoginBody `json:"body" in:"body"`
}

type AdminLoginResp struct {
	param_base.SimpleResp
	Data gd_admin.AdminLoginReply `json:"data"`
}

// 获取权限列表
type GetAccessReq struct {
	param_base.BasicParam
}

type GetAccessResp struct {
	param_base.SimpleResp
	Data gd_admin.GetAccessReply `json:"data"`
}

// 获取权限分组列表
type GetRbacGroupListReq struct {
	param_base.BasicParam
}

type GetRbacGroupListResp struct {
	param_base.SimpleResp
	Data gd_admin.GetRbacGroupListReply `json:"data"`
}

type UpdateRbacGroup struct {
	Id     int    `json:"id" description:"分组id"`
	Name   string `json:"name" description:"分组名"`
	NodeId string `json:"node_id" description:"节点id，用，拼接"`
}

// 更新权限分组信息
type UpdateRbacGroupReq struct {
	param_base.BasicParam
	Body UpdateRbacGroup `json:"body" description:"" in:"body"`
}

type UpdateRbacGroupResp struct {
	param_base.SimpleResp
}

// 删除权限分组信息
type DeleteRbacGroupReq struct {
	param_base.BasicParam
	Id int `json:"id" description:"权限id信息" require:"true" in:"query"`
}

type DeleteRbacGroupResp struct {
	param_base.SimpleResp
}

// 添加权限分组
type AddRbacGroupReq struct {
	param_base.BasicParam
	Body UpdateRbacGroup `json:"body" description:"" in:"body"`
}

type AddRbacGroupResp struct {
	param_base.SimpleResp
}

// 获取所有的节点列表
type GetNodeListReq struct {
	param_base.BasicParam
}

type GetNodeListResp struct {
	param_base.SimpleResp
	List gd_admin.GetNodeListReply `json:"list"`
}

// 修改管理员状态
type UpdateStatusBody struct {
	AdminId int64 `json:"admin_id" description:"查看的管理员id" require:"true"`
}

type UpdateStatusReq struct {
	param_base.BasicParam
	Body UpdateStatusBody `json:"body" in:"body" require:"true"`
}

type UpdateStatusResp struct {
	param_base.SimpleResp
	Data gd_admin.UpdateStatusReply `json:"data"`
}

// 获取用户详情
type GetInfoReq struct {
	param_base.BasicParam
	AdminId int64 `json:"admin_id" description:"查看的管理员id" require:"true" in:"query"`
}

type GetInfoResp struct {
	param_base.SimpleResp
	Data gd_admin.GetInfoReply `json:"data"`
}

type AdminTokenVerifyReq struct {
	param_base.BasicParam
}

type AdminTokenVerifyResp struct {
	param_base.SimpleResp
	Data gd_admin.AdminLoginReply `json:"data"`
}
