Files

117 lines
3.9 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package system
import (
"github.com/gogf/gf/v2/frame/g"
commonApi "github.com/tiger1103/gfast/v3/api/v1/common"
"github.com/tiger1103/gfast/v3/internal/app/system/consts"
"github.com/tiger1103/gfast/v3/internal/app/system/model"
"github.com/tiger1103/gfast/v3/internal/app/system/model/entity"
)
// TenantListReq 租户搜索请求参数
type TenantListReq struct {
g.Meta `path:"/tenant/list" tags:"租户管理" method:"get" summary:"租户列表"`
TenantType consts.TenantType `p:"tenantType"`
CityCode string `p:"cityCode"`
TenantName string `p:"tenantName"`
commonApi.PageReq
commonApi.Author
}
type TenantListRes struct {
g.Meta `mime:"application/json"`
List []*model.TenantUserRes `json:"list"`
ImgAddressPrefix string `json:"imgAddressPrefix"`
commonApi.ListRes
}
// TenantAddReq 添加租户参数
type TenantAddReq struct {
g.Meta `path:"/tenant/add" tags:"租户管理" method:"post" summary:"租户添加"`
UserNickname string `p:"userNickname"`
Mobile string `p:"mobile"`
UserName string `p:"userName"`
UserPassword string `p:"userPassword"`
TenantName string `p:"tenantName"`
TenantType consts.TenantType `p:"tenantType"`
CityCode string `p:"cityCode"`
BusinessLicense string `p:"businessLicense"`
UserSalt string `p:"-"`
commonApi.Author
}
type TenantAddRes struct {
}
// TenantEditReq 修改租户参数
type TenantEditReq struct {
g.Meta `path:"/tenant/edit" tags:"租户管理" method:"put" summary:"租户修改"`
Id int64 `p:"id" v:"required#租户id不能为空"`
TenantName string `p:"tenantName"`
TenantType consts.TenantType `p:"tenantType"`
CityCode string `p:"cityCode"`
BusinessLicense string `p:"businessLicense"`
Surplus float64 `p:"surplus"`
commonApi.Author
}
type TenantEditRes struct {
}
// TenantBalanceReq 查询租户余额(内部接口,model-gateway 调用,不走 gftoken/Auth
type TenantBalanceReq struct {
g.Meta `path:"/tenant/balance" tags:"租户余额(内部)" method:"get" summary:"查询租户余额"`
TenantId uint64 `p:"tenantId" v:"required#租户id不能为空"`
}
type TenantBalanceRes struct {
g.Meta `mime:"application/json"`
Tenant *entity.Tenant `json:"tenant"`
}
// TenantDeductReq 扣减租户余额(内部接口,model-gateway 调用;surplus 传负值即扣减)
type TenantDeductReq struct {
g.Meta `path:"/tenant/deduct" tags:"租户余额(内部)" method:"post" summary:"扣减租户余额"`
Id int64 `p:"id" v:"required#租户id不能为空"`
Surplus float64 `p:"surplus"`
}
type TenantDeductRes struct {
}
// GetTenantDetailsByIdsReq 获取多个租户详情请求参数
type GetTenantDetailsByIdsReq struct {
g.Meta `path:"/tenant/getTenantDetailsByIds" tags:"租户管理" method:"get" summary:"获取多个租户详情"`
TenantIds []uint64 `p:"tenantIds"`
commonApi.Author
}
type GetTenantDetailsByIdsRes struct {
g.Meta `mime:"application/json"`
List []*model.TenantRes `json:"list"`
}
// GetTenantDetailsReq 获取租户详情请求参数
type GetTenantDetailsReq struct {
g.Meta `path:"/tenant/getTenantDetails" tags:"租户管理" method:"get" summary:"获取租户详情"`
TenantId uint64 `p:"tenantId"`
commonApi.Author
}
type GetTenantDetailsRes struct {
g.Meta `mime:"application/json"`
Tenant *entity.Tenant `json:"tenant"`
}
// GetTenantListReq 获取租户列表请求参数
type GetTenantListReq struct {
g.Meta `path:"/tenant/getTenantList" tags:"租户管理" method:"get" summary:"获取租户列表"`
TenantId uint64 `p:"tenantId"`
commonApi.Author
}
type GetTenantListRes struct {
g.Meta `mime:"application/json"`
List []entity.Tenant `json:"list"`
}