mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-30 04:41:25 +08:00
【更新】更新
This commit is contained in:
@@ -8,7 +8,6 @@ package api
|
||||
import (
|
||||
"pandax/apps/system/entity"
|
||||
"pandax/apps/system/services"
|
||||
"pandax/base/ctx"
|
||||
"pandax/base/ginx"
|
||||
"pandax/base/utils"
|
||||
)
|
||||
@@ -24,7 +23,7 @@ type SysTenantsApi struct {
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /system/tenant/list [get]
|
||||
// @Security
|
||||
func (p *SysTenantsApi) GetSysTenantsList(rc *ctx.ReqCtx) {
|
||||
func (p *SysTenantsApi) GetSysTenantsList(rc *ginx.ReqCtx) {
|
||||
data := entity.SysTenants{}
|
||||
pageNum := ginx.QueryInt(rc.GinCtx, "pageNum", 1)
|
||||
pageSize := ginx.QueryInt(rc.GinCtx, "pageSize", 10)
|
||||
@@ -44,7 +43,7 @@ func (p *SysTenantsApi) GetSysTenantsList(rc *ctx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /system/tenant/lists [get]
|
||||
// @Security
|
||||
func (p *SysTenantsApi) GetSysTenantsAll(rc *ctx.ReqCtx) {
|
||||
func (p *SysTenantsApi) GetSysTenantsAll(rc *ginx.ReqCtx) {
|
||||
list := make([]entity.SysTenants, 0)
|
||||
if rc.LoginAccount.RoleKey == "admin" {
|
||||
data := entity.SysTenants{}
|
||||
@@ -62,7 +61,7 @@ func (p *SysTenantsApi) GetSysTenantsAll(rc *ctx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /system/tenant/{tenantId} [get]
|
||||
// @Security
|
||||
func (p *SysTenantsApi) GetSysTenants(rc *ctx.ReqCtx) {
|
||||
func (p *SysTenantsApi) GetSysTenants(rc *ginx.ReqCtx) {
|
||||
tenantId := ginx.PathParamInt(rc.GinCtx, "tenantId")
|
||||
p.SysTenantsApp.FindOne(int64(tenantId))
|
||||
}
|
||||
@@ -77,7 +76,7 @@ func (p *SysTenantsApi) GetSysTenants(rc *ctx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /system/tenant [post]
|
||||
// @Security X-TOKEN
|
||||
func (p *SysTenantsApi) InsertSysTenants(rc *ctx.ReqCtx) {
|
||||
func (p *SysTenantsApi) InsertSysTenants(rc *ginx.ReqCtx) {
|
||||
var data entity.SysTenants
|
||||
ginx.BindJsonAndValid(rc.GinCtx, &data)
|
||||
|
||||
@@ -94,7 +93,7 @@ func (p *SysTenantsApi) InsertSysTenants(rc *ctx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /system/tenant [put]
|
||||
// @Security X-TOKEN
|
||||
func (p *SysTenantsApi) UpdateSysTenants(rc *ctx.ReqCtx) {
|
||||
func (p *SysTenantsApi) UpdateSysTenants(rc *ginx.ReqCtx) {
|
||||
var data entity.SysTenants
|
||||
ginx.BindJsonAndValid(rc.GinCtx, &data)
|
||||
|
||||
@@ -108,7 +107,7 @@ func (p *SysTenantsApi) UpdateSysTenants(rc *ctx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
|
||||
// @Router /system/tenant/{tenantId} [delete]
|
||||
func (p *SysTenantsApi) DeleteSysTenants(rc *ctx.ReqCtx) {
|
||||
func (p *SysTenantsApi) DeleteSysTenants(rc *ginx.ReqCtx) {
|
||||
tenantId := rc.GinCtx.Param("tenantId")
|
||||
tenantIds := utils.IdsStrToIdsIntGroup(tenantId)
|
||||
p.SysTenantsApp.Delete(tenantIds)
|
||||
|
||||
Reference in New Issue
Block a user