sync: 同步 v1.0.4 开源代码并脱敏
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// Package consts
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package consts
|
||||
|
||||
@@ -34,8 +34,10 @@ var (
|
||||
CodeLoginExpired = gcode.New(10012, "登录已过期", nil)
|
||||
// 部门下有子部门,不能删除
|
||||
CodeDeptHasSub = gcode.New(10013, "部门下有子部门,不能删除", nil)
|
||||
// 没有权限
|
||||
// 没有权限(业务判定:资源未登记、资源停用、账号不可用或未授权)
|
||||
CodeNoPermission = gcode.New(10014, "没有权限", nil)
|
||||
// 无效Token
|
||||
CodeInvalidToken = gcode.New(10015, "无效Token", nil)
|
||||
// 权限校验失败(系统侧故障:权限数据查询异常,区别于 10014 无权限,避免误判为授权问题)
|
||||
CodePermissionCheckFailed = gcode.New(10016, "权限校验失败", nil)
|
||||
)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package consts
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package consts
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package consts
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package consts
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package consts
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package consts
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package consts
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package consts
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package consts
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package consts
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package consts
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package consts
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package consts
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package consts
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package consts
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package consts
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Package bcache
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package bcache
|
||||
|
||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
||||
// Package cache
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package cache
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
||||
// Package file
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package file
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package contexts
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package contexts
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package mcache
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// 内存缓存管理
|
||||
package mcache
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package xgorm
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package xgorm
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package xgorm
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package xgorm
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package gormmodel
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package gormmodel
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package handler
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package handler
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package handler
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package handler
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package handler
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package handler
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package handler
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package handler
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package hook
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package hook
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@ package middleware
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"errors"
|
||||
"net/http"
|
||||
"slices"
|
||||
"strconv"
|
||||
@@ -138,7 +140,13 @@ func (s *sMiddleware) ApiAuth(r *ghttp.Request) {
|
||||
response.JsonExit(r, gcode.CodeNotAuthorized.Code(), consts.CodeLoginExpired.Message())
|
||||
return
|
||||
}
|
||||
if !s.hasOpenApiPermission(ctx, r.Method, path) {
|
||||
allowed, err := s.hasOpenApiPermission(ctx, r.Method, path)
|
||||
if err != nil {
|
||||
g.Log().Errorf(ctx, "sMiddleware.ApiAuth permission check failed, method: %s, path: %s, err: %v", r.Method, path, err)
|
||||
response.JsonExit(r, consts.CodePermissionCheckFailed.Code(), consts.CodePermissionCheckFailed.Message())
|
||||
return
|
||||
}
|
||||
if !allowed {
|
||||
response.JsonExit(r, consts.CodeNoPermission.Code(), consts.CodeNoPermission.Message())
|
||||
return
|
||||
}
|
||||
@@ -162,33 +170,36 @@ func openApiMethodValues(method string) []string {
|
||||
return values
|
||||
}
|
||||
|
||||
func (s *sMiddleware) hasOpenApiPermission(ctx context.Context, method, path string) bool {
|
||||
// hasOpenApiPermission 判定当前 API 账号对指定路由是否已授权。
|
||||
// 返回值 error 仅代表权限数据查询本身的系统故障,与「无权限」(false, nil) 严格区分:
|
||||
// 调用方对 error 返回系统异常码,对 false 返回无权限码,避免把数据库故障误报成授权问题。
|
||||
// 未登记资源、资源停用、账号不可用、未绑定权限组均按无权限处理。
|
||||
func (s *sMiddleware) hasOpenApiPermission(ctx context.Context, method, path string) (bool, error) {
|
||||
agentUser := contexts.GetAgentUser(ctx)
|
||||
if agentUser == nil {
|
||||
return false
|
||||
}
|
||||
if path == "/openapi/v3/query/token" {
|
||||
return true
|
||||
return false, nil
|
||||
}
|
||||
|
||||
path = strings.TrimSpace(path)
|
||||
if path != "/" {
|
||||
path = strings.TrimRight(path, "/")
|
||||
}
|
||||
// 每条受保护路由(含 /common 兼容前缀的别名路由)都必须显式登记资源并完成授权,
|
||||
// 资源查询失败不得降级为放行。
|
||||
var apiResource entity.TApiResource
|
||||
if err := dao.TApiResource.Ctx(ctx).
|
||||
err := dao.TApiResource.Ctx(ctx).
|
||||
WhereIn(dao.TApiResource.Columns().Method, openApiMethodValues(method)).
|
||||
Where(dao.TApiResource.Columns().Path, path).
|
||||
Scan(&apiResource); err != nil {
|
||||
g.Log().Warningf(ctx, "sMiddleware.hasOpenApiPermission resource not configured, method: %s, path: %s, err: %v", method, path, err)
|
||||
return true
|
||||
Scan(&apiResource)
|
||||
if err != nil && !errors.Is(err, sql.ErrNoRows) {
|
||||
return false, gerror.Wrapf(err, "query t_api_resource failed, method: %s, path: %s", method, path)
|
||||
}
|
||||
if apiResource.Id == 0 {
|
||||
if err != nil || apiResource.Id == 0 {
|
||||
g.Log().Warningf(ctx, "sMiddleware.hasOpenApiPermission resource not configured, method: %s, path: %s", method, path)
|
||||
return true
|
||||
return false, nil
|
||||
}
|
||||
if apiResource.Status == 1 {
|
||||
return false
|
||||
return false, nil
|
||||
}
|
||||
|
||||
var tApi entity.TApi
|
||||
@@ -199,19 +210,22 @@ func (s *sMiddleware) hasOpenApiPermission(ctx context.Context, method, path str
|
||||
apiMod = apiMod.Where(dao.TApi.Columns().AppKey, agentUser.AppKey)
|
||||
} else {
|
||||
g.Log().Warningf(ctx, "sMiddleware.hasOpenApiPermission api identity is empty, resourceApiId: %d, path: %s", apiResource.Id, path)
|
||||
return false
|
||||
return false, nil
|
||||
}
|
||||
if err := apiMod.Scan(&tApi); err != nil {
|
||||
g.Log().Errorf(ctx, "sMiddleware.hasOpenApiPermission scan t_api error: %v", err)
|
||||
return false
|
||||
if errors.Is(err, sql.ErrNoRows) {
|
||||
g.Log().Warningf(ctx, "sMiddleware.hasOpenApiPermission t_api not found, resourceApiId: %d, path: %s", apiResource.Id, path)
|
||||
return false, nil
|
||||
}
|
||||
return false, gerror.Wrapf(err, "query t_api failed, resourceApiId: %d, path: %s", apiResource.Id, path)
|
||||
}
|
||||
if tApi.Id == 0 || tApi.Status == 1 {
|
||||
g.Log().Warningf(ctx, "sMiddleware.hasOpenApiPermission t_api unavailable, tApiId: %d, status: %d, resourceApiId: %d, path: %s", tApi.Id, tApi.Status, apiResource.Id, path)
|
||||
return false
|
||||
return false, nil
|
||||
}
|
||||
if tApi.GroupId <= 0 {
|
||||
g.Log().Warningf(ctx, "sMiddleware.hasOpenApiPermission groupId is empty, tApiId: %d, appKey: %s, resourceApiId: %d, path: %s", tApi.Id, tApi.AppKey, apiResource.Id, path)
|
||||
return false
|
||||
return false, nil
|
||||
}
|
||||
|
||||
count, err := dao.TApiGroupResource.Ctx(ctx).
|
||||
@@ -219,10 +233,9 @@ func (s *sMiddleware) hasOpenApiPermission(ctx context.Context, method, path str
|
||||
Where(dao.TApiGroupResource.Columns().ApiId, apiResource.Id).
|
||||
Count()
|
||||
if err != nil {
|
||||
g.Log().Errorf(ctx, "sMiddleware.hasOpenApiPermission scan relation error: %v", err)
|
||||
return false
|
||||
return false, gerror.Wrapf(err, "query t_api_group_resource failed, groupId: %d, resourceApiId: %d, path: %s", tApi.GroupId, apiResource.Id, path)
|
||||
}
|
||||
return count > 0
|
||||
return count > 0, nil
|
||||
}
|
||||
|
||||
func (m *sMiddleware) OldResponseHandler(r *ghttp.Request) {
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
_ "github.com/gogf/gf/contrib/drivers/sqlite/v2"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
"git.5iot.com/iotlcm-public/iotlcm-openapi/internal/library/contexts"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-openapi/internal/model"
|
||||
)
|
||||
|
||||
func TestOpenAPIPermission(t *testing.T) {
|
||||
ctx := contexts.Set(context.Background(), &model.Context{
|
||||
AgentUser: &model.BaseClaimsApi{ApiId: 1, AppKey: "test-key"},
|
||||
})
|
||||
if err := gdb.SetConfig(gdb.Config{"default": gdb.ConfigGroup{{Type: "sqlite", Link: "sqlite::@file(:memory:)", MaxOpenConnCount: 1}}}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Cleanup(func() { _ = g.DB().Close(ctx) })
|
||||
if err := g.DB().GetCore().ClearTableFieldsAll(ctx); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
exec := func(sql string) {
|
||||
t.Helper()
|
||||
if _, err := g.DB().Exec(ctx, sql); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
exec(`CREATE TABLE t_api_resource (id INTEGER PRIMARY KEY, method TEXT, path TEXT, status INTEGER)`)
|
||||
exec(`CREATE TABLE t_api (id INTEGER PRIMARY KEY, app_key TEXT, group_id INTEGER, status INTEGER)`)
|
||||
exec(`CREATE TABLE t_api_group_resource (group_id INTEGER, api_id INTEGER)`)
|
||||
exec(`INSERT INTO t_api VALUES (1, 'test-key', 7, 0)`)
|
||||
exec(`INSERT INTO t_api_resource VALUES
|
||||
(1, '1', '/openapi/v3/change/sim-subscribe', 0),
|
||||
(2, 'POST', '/openapi/v3/query/sim-info', 0),
|
||||
(3, '1', '/openapi/v3/query/sim-status', 1),
|
||||
(4, '1', '/openapi/v3/query/sim-imei-batch', 0)`)
|
||||
exec(`INSERT INTO t_api_group_resource VALUES (7, 1), (7, 2), (7, 3)`)
|
||||
|
||||
middleware := New()
|
||||
check := func(t *testing.T, method, path string) (bool, error) {
|
||||
t.Helper()
|
||||
return middleware.hasOpenApiPermission(ctx, method, path)
|
||||
}
|
||||
|
||||
for _, tc := range []struct {
|
||||
name, method, path string
|
||||
want bool
|
||||
}{
|
||||
{"authorized numeric method", "POST", "/openapi/v3/change/sim-subscribe", true},
|
||||
{"authorized text method", "POST", "/openapi/v3/query/sim-info", true},
|
||||
{"normalized path", "post", "/openapi/v3/query/sim-info/", true},
|
||||
{"unregistered resource", "POST", "/openapi/v3/query/batch-status", false},
|
||||
{"legacy alias path never inherits grants", "POST", "/openapi/v3/common/sim-subscribe", false},
|
||||
{"wrong method", "GET", "/openapi/v3/change/sim-subscribe", false},
|
||||
{"disabled resource", "POST", "/openapi/v3/query/sim-status", false},
|
||||
{"missing group binding", "POST", "/openapi/v3/query/sim-imei-batch", false},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
got, err := check(t, tc.method, tc.path)
|
||||
if err != nil {
|
||||
t.Fatalf("business denial must not report a system failure: %v", err)
|
||||
}
|
||||
if got != tc.want {
|
||||
t.Fatalf("permission = %v, want %v", got, tc.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// Token endpoints are exempted by router.exceptLogin only; the middleware must not
|
||||
// carry its own whitelist, otherwise the two lists drift apart.
|
||||
if got, err := check(t, "POST", "/openapi/v3/query/token"); err != nil || got {
|
||||
t.Fatalf("token path must not be whitelisted inside middleware, got=%v err=%v", got, err)
|
||||
}
|
||||
|
||||
// The /common alias prefix has been removed from the router (router/common.go deleted).
|
||||
// Keep the path-level guard anyway: if an alias is ever re-introduced, it must still be
|
||||
// registered and granted on its own full path instead of inheriting /change permissions.
|
||||
exec(`INSERT INTO t_api_resource VALUES (5, '1', '/openapi/v3/common/sim-subscribe', 0)`)
|
||||
if got, err := check(t, "POST", "/openapi/v3/common/sim-subscribe"); err != nil || got {
|
||||
t.Fatalf("registered compatibility route without grant must be denied, got=%v err=%v", got, err)
|
||||
}
|
||||
exec(`INSERT INTO t_api_group_resource VALUES (7, 5)`)
|
||||
if got, err := check(t, "POST", "/openapi/v3/common/sim-subscribe"); err != nil || !got {
|
||||
t.Fatalf("explicitly granted compatibility route must be allowed, got=%v err=%v", got, err)
|
||||
}
|
||||
|
||||
// Unusable accounts are a business denial, not a system failure.
|
||||
for _, sql := range []string{
|
||||
`UPDATE t_api SET status = 1`,
|
||||
`UPDATE t_api SET status = 0, group_id = 0`,
|
||||
`DELETE FROM t_api`,
|
||||
} {
|
||||
exec(sql)
|
||||
got, err := check(t, "POST", "/openapi/v3/query/sim-info")
|
||||
if err != nil {
|
||||
t.Fatalf("account rejection must not be reported as a system failure after %s: %v", sql, err)
|
||||
}
|
||||
if got {
|
||||
t.Fatalf("invalid account allowed after %s", sql)
|
||||
}
|
||||
}
|
||||
|
||||
// A broken permission lookup is a system failure: it must deny AND surface the error,
|
||||
// so callers can answer 10016 instead of misreporting it as 10014 no-permission.
|
||||
exec(`DROP TABLE t_api_resource`)
|
||||
got, err := check(t, "POST", "/openapi/v3/query/sim-info")
|
||||
if err == nil {
|
||||
t.Fatal("resource lookup failure must return an error")
|
||||
}
|
||||
if got {
|
||||
t.Fatal("resource lookup failure must deny access")
|
||||
}
|
||||
}
|
||||
@@ -22,11 +22,10 @@ import (
|
||||
// setupImeiBatchDB 建一张最小可用的卡表并灌入覆盖各分支的样本数据。
|
||||
//
|
||||
// 样本设计(对齐 §7 测试场景):
|
||||
//
|
||||
// CARD-A 有 imei → 正常命中
|
||||
// CARD-B imei 为空 → 卡存在但上游未上报值
|
||||
// CARD-C 有 imei → 正常命中(入库带的值)
|
||||
// CARD-D 属于另一个部门 → 数据权限过滤后视为 notFound
|
||||
// CARD-A 有 imei → 正常命中
|
||||
// CARD-B imei 为空 → 卡存在但上游未上报值
|
||||
// CARD-C 有 imei → 正常命中(入库带的值)
|
||||
// CARD-D 属于另一个部门 → 数据权限过滤后视为 notFound
|
||||
func setupImeiBatchDB(t *testing.T, ctx context.Context) {
|
||||
t.Helper()
|
||||
if err := gdb.SetConfig(gdb.Config{"default": gdb.ConfigGroup{{Type: "sqlite", Link: "sqlite::@file(:memory:)", MaxOpenConnCount: 1}}}); err != nil {
|
||||
|
||||
@@ -286,7 +286,7 @@ func (s *sQueryToken) GenerateToken(ctx context.Context, customer *model.CustomC
|
||||
ets := g.Cfg().MustGet(ctx, "jwt.expiresTime", "3650d").String()
|
||||
bts := g.Cfg().MustGet(ctx, "jwt.bufferTime", "1d").String()
|
||||
iss := g.Cfg().MustGet(ctx, "jwt.issuer", "JieIOTAPI").String()
|
||||
sk := g.Cfg().MustGet(ctx, "jwt.signingKey", "${JWT_SIGNING_KEY}").String()
|
||||
sk := g.Cfg().MustGet(ctx, "jwt.signingKey", "49c54195e73304e74a8429b178965865").String()
|
||||
et, _ := utils.ParseDuration(ets)
|
||||
bt, _ := utils.ParseDuration(bts)
|
||||
g.Log().Infof(ctx, "GenerateToken: customer:%+v, et:%s, bt:%s, iss:%s", customer, et, bt, iss)
|
||||
@@ -336,7 +336,7 @@ func (s *sQueryToken) GenerateToken(ctx context.Context, customer *model.CustomC
|
||||
|
||||
// GenerateShortToken 生成短令牌
|
||||
func (s *sQueryToken) GenerateShortToken(ctx context.Context, tokenUuid string) (token string, err error) {
|
||||
sk := g.Cfg().MustGet(ctx, "jwt.signingKey", "${JWT_SIGNING_KEY}").String()
|
||||
sk := g.Cfg().MustGet(ctx, "jwt.signingKey", "49c54195e73304e74a8429b178965865").String()
|
||||
shortToken := jwt.NewWithClaims(jwt.SigningMethodHS256, &model.ApiTokenClaims{
|
||||
UUID: tokenUuid,
|
||||
})
|
||||
@@ -346,7 +346,7 @@ func (s *sQueryToken) GenerateShortToken(ctx context.Context, tokenUuid string)
|
||||
|
||||
// 解析Token
|
||||
func (s *sQueryToken) ParseToken(ctx context.Context, token string) (claims *model.CustomClaimsApi, err error) {
|
||||
sk := g.Cfg().MustGet(ctx, "jwt.signingKey", "${JWT_SIGNING_KEY}").String()
|
||||
sk := g.Cfg().MustGet(ctx, "jwt.signingKey", "49c54195e73304e74a8429b178965865").String()
|
||||
t, err := jwt.ParseWithClaims(token, &model.ApiTokenClaims{}, func(token *jwt.Token) (interface{}, error) {
|
||||
return []byte(sk), nil
|
||||
})
|
||||
@@ -386,7 +386,7 @@ func (s *sQueryToken) ParseToken(ctx context.Context, token string) (claims *mod
|
||||
|
||||
// 删除Token
|
||||
func (s *sQueryToken) DeleteToken(ctx context.Context, token string) (err error) {
|
||||
sk := g.Cfg().MustGet(ctx, "jwt.signingKey", "${JWT_SIGNING_KEY}").String()
|
||||
sk := g.Cfg().MustGet(ctx, "jwt.signingKey", "49c54195e73304e74a8429b178965865").String()
|
||||
t, err := jwt.ParseWithClaims(token, &model.ApiTokenClaims{}, func(token *jwt.Token) (interface{}, error) {
|
||||
return []byte(sk), nil
|
||||
})
|
||||
|
||||
@@ -4,11 +4,11 @@ import (
|
||||
"context"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-openapi/internal/dao"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-openapi/internal/model"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-openapi/internal/model/entity"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-openapi/internal/service"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
)
|
||||
|
||||
const queryTrafficCutoffConfigMaxCards = 1000
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package genin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package model
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package model
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package genin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package genin
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package model
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package model
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ type QuerySimBatchCard struct {
|
||||
|
||||
// QuerySimStatusBatchParam 批量卡状态查询入参
|
||||
type QuerySimStatusBatchParam struct {
|
||||
AppId string `json:"appId" v:"required#appId不能为空" dc:"平台API应用ID"`
|
||||
AppId string `json:"appId" v:"required#appId不能为空" dc:"平台API应用ID"`
|
||||
Cards []QuerySimBatchCard `json:"cards" v:"required#查询卡不能为空" dc:"查询卡列表"`
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ type QuerySimStatusBatchParam struct {
|
||||
type QuerySimStatusBatchItem struct {
|
||||
Matched bool `json:"matched"`
|
||||
Iccid string `json:"iccid,omitempty"`
|
||||
LifeCycle int `json:"lifeCycle"` // 卡状态编码(平台内部枚举)
|
||||
LifeCycle int `json:"lifeCycle"` // 卡状态编码(平台内部枚举)
|
||||
LifeCycleName string `json:"lifeCycleName,omitempty"`
|
||||
ErrorCode string `json:"errorCode,omitempty"`
|
||||
ErrorMessage string `json:"errorMessage,omitempty"`
|
||||
@@ -125,7 +125,7 @@ type QuerySimStatusBatchOutput struct {
|
||||
|
||||
// QuerySimUsageBatchParam 批量流量查询入参
|
||||
type QuerySimUsageBatchParam struct {
|
||||
AppId string `json:"appId" v:"required#appId不能为空" dc:"平台API应用ID"`
|
||||
AppId string `json:"appId" v:"required#appId不能为空" dc:"平台API应用ID"`
|
||||
Cards []QuerySimBatchCard `json:"cards" v:"required#查询卡不能为空" dc:"查询卡列表"`
|
||||
}
|
||||
|
||||
@@ -133,8 +133,8 @@ type QuerySimUsageBatchParam struct {
|
||||
type QuerySimUsageBatchItem struct {
|
||||
Matched bool `json:"matched"`
|
||||
Iccid string `json:"iccid,omitempty"`
|
||||
UseUnit string `json:"useUnit"` // 流量单位,固定为 MB
|
||||
UseAmount float64 `json:"useAmount"` // 当前周期已用流量,单位 MB
|
||||
UseUnit string `json:"useUnit"` // 流量单位,固定为 MB
|
||||
UseAmount float64 `json:"useAmount"` // 当前周期已用流量,单位 MB
|
||||
ErrorCode string `json:"errorCode,omitempty"`
|
||||
ErrorMessage string `json:"errorMessage,omitempty"`
|
||||
}
|
||||
@@ -151,7 +151,7 @@ type QuerySimUsageBatchOutput struct {
|
||||
|
||||
// QuerySimImeiBatchParam 批量 IMEI 查询入参(与 sim-status-batch / sim-usage-batch 同构)
|
||||
type QuerySimImeiBatchParam struct {
|
||||
AppId string `json:"appId" v:"required#appId不能为空" dc:"平台API应用ID"`
|
||||
AppId string `json:"appId" v:"required#appId不能为空" dc:"平台API应用ID"`
|
||||
Cards []QuerySimBatchCard `json:"cards" v:"required#查询卡不能为空" dc:"查询卡列表"`
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package request
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package request
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package response
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package response
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package model
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package model
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package model
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package model
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package model
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package model
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package model
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package model
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package model
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package model
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package model
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package model
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package model
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package model
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package model
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package model
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package model
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package model
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package genin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package model
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package model
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package model
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package model
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package model
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package model
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package model
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package model
|
||||
|
||||
|
||||
+42
-42
@@ -1,7 +1,7 @@
|
||||
// package model
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package model
|
||||
|
||||
@@ -48,41 +48,41 @@ type SysRoleViewParam struct {
|
||||
}
|
||||
|
||||
type SysRoleViewModel struct {
|
||||
RoleId int64 `json:"roleId" orm:"role_id" description:"角色ID"`
|
||||
TenantId string `json:"tenantId" orm:"tenant_id" description:"租户编号"`
|
||||
DeptId int64 `json:"deptId" orm:"dept_id" description:"部门组织id"`
|
||||
RoleName string `json:"roleName" orm:"role_name" description:"角色名称"`
|
||||
RoleKey string `json:"roleKey" orm:"role_key" description:"角色权限字符串"`
|
||||
RoleSort int `json:"roleSort" orm:"role_sort" description:"显示顺序"`
|
||||
DataScope string `json:"dataScope" orm:"data_scope" description:"数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限 5:仅本人数据权限 6:本部门及以下或本人数据权限 7:本部门及下一级数据权限)"`
|
||||
MenuCheckStrictly int `json:"menuCheckStrictly" orm:"menu_check_strictly" description:"菜单树选择项是否关联显示"`
|
||||
DeptCheckStrictly int `json:"deptCheckStrictly" orm:"dept_check_strictly" description:"部门树选择项是否关联显示"`
|
||||
Status string `json:"status" orm:"status" description:"角色状态(0正常 1停用)"`
|
||||
CreatedDept int64 `json:"createdDept" orm:"created_dept" description:"创建部门"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"`
|
||||
Remark string `json:"remark" orm:"remark" description:"备注"`
|
||||
MenuIds []int64 `json:"menuIds" orm:"menu_ids" description:"角色菜单ID列表"`
|
||||
RoleId int64 `json:"roleId" orm:"role_id" description:"角色ID"`
|
||||
TenantId string `json:"tenantId" orm:"tenant_id" description:"租户编号"`
|
||||
DeptId int64 `json:"deptId" orm:"dept_id" description:"部门组织id"`
|
||||
RoleName string `json:"roleName" orm:"role_name" description:"角色名称"`
|
||||
RoleKey string `json:"roleKey" orm:"role_key" description:"角色权限字符串"`
|
||||
RoleSort int `json:"roleSort" orm:"role_sort" description:"显示顺序"`
|
||||
DataScope string `json:"dataScope" orm:"data_scope" description:"数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限 5:仅本人数据权限 6:本部门及以下或本人数据权限 7:本部门及下一级数据权限)"`
|
||||
MenuCheckStrictly int `json:"menuCheckStrictly" orm:"menu_check_strictly" description:"菜单树选择项是否关联显示"`
|
||||
DeptCheckStrictly int `json:"deptCheckStrictly" orm:"dept_check_strictly" description:"部门树选择项是否关联显示"`
|
||||
Status string `json:"status" orm:"status" description:"角色状态(0正常 1停用)"`
|
||||
CreatedDept int64 `json:"createdDept" orm:"created_dept" description:"创建部门"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"`
|
||||
Remark string `json:"remark" orm:"remark" description:"备注"`
|
||||
MenuIds []int64 `json:"menuIds" orm:"menu_ids" description:"角色菜单ID列表"`
|
||||
RoleMenuDataScopes map[int64]string `json:"roleMenuDataScopes" description:"角色菜单数据范围"`
|
||||
DeptIds []int64 `json:"deptIds" orm:"dept_ids" description:"角色部门ID列表"`
|
||||
DeptIds []int64 `json:"deptIds" orm:"dept_ids" description:"角色部门ID列表"`
|
||||
}
|
||||
|
||||
type SysRoleAddParam struct {
|
||||
RoleName string `json:"roleName" orm:"role_name" description:"角色名称"`
|
||||
TenantId string `json:"tenantId" orm:"tenant_id" description:"租户编号"`
|
||||
RoleKey string `json:"roleKey" orm:"role_key" description:"角色权限字符串"`
|
||||
RoleSort int `json:"roleSort" orm:"role_sort" description:"显示顺序"`
|
||||
DataScope string `json:"dataScope" orm:"data_scope" description:"数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限 5:仅本人数据权限 6:本部门及以下或本人数据权限 7:本部门及下一级数据权限)"`
|
||||
MenuCheckStrictly int `json:"menuCheckStrictly" orm:"menu_check_strictly" description:"菜单树选择项是否关联显示"`
|
||||
Status string `json:"status" orm:"status" description:"角色状态(0正常 1停用)"`
|
||||
CreatedDept int64 `json:"createdDept" orm:"created_dept" description:"创建部门"`
|
||||
CreatedBy int64 `json:"createdBy" orm:"created_by" description:"创建者"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"`
|
||||
UpdatedBy int64 `json:"updatedBy" orm:"updated_by" description:"更新者"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"`
|
||||
Remark string `json:"remark" orm:"remark" description:"备注"`
|
||||
MenuIds []int64 `json:"menuIds" orm:"menu_ids" description:"菜单ID"`
|
||||
RoleName string `json:"roleName" orm:"role_name" description:"角色名称"`
|
||||
TenantId string `json:"tenantId" orm:"tenant_id" description:"租户编号"`
|
||||
RoleKey string `json:"roleKey" orm:"role_key" description:"角色权限字符串"`
|
||||
RoleSort int `json:"roleSort" orm:"role_sort" description:"显示顺序"`
|
||||
DataScope string `json:"dataScope" orm:"data_scope" description:"数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限 5:仅本人数据权限 6:本部门及以下或本人数据权限 7:本部门及下一级数据权限)"`
|
||||
MenuCheckStrictly int `json:"menuCheckStrictly" orm:"menu_check_strictly" description:"菜单树选择项是否关联显示"`
|
||||
Status string `json:"status" orm:"status" description:"角色状态(0正常 1停用)"`
|
||||
CreatedDept int64 `json:"createdDept" orm:"created_dept" description:"创建部门"`
|
||||
CreatedBy int64 `json:"createdBy" orm:"created_by" description:"创建者"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"`
|
||||
UpdatedBy int64 `json:"updatedBy" orm:"updated_by" description:"更新者"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"`
|
||||
Remark string `json:"remark" orm:"remark" description:"备注"`
|
||||
MenuIds []int64 `json:"menuIds" orm:"menu_ids" description:"菜单ID"`
|
||||
RoleMenuDataScopes map[int64]string `json:"roleMenuDataScopes" description:"角色菜单数据范围"`
|
||||
DeptId *int64 `json:"deptId" orm:"dept_id" description:"部门组织id"`
|
||||
DeptId *int64 `json:"deptId" orm:"dept_id" description:"部门组织id"`
|
||||
}
|
||||
|
||||
type SysRoleAddModel struct {
|
||||
@@ -90,18 +90,18 @@ type SysRoleAddModel struct {
|
||||
}
|
||||
|
||||
type SysRoleEditParam struct {
|
||||
RoleId int64 `json:"roleId" orm:"role_id" description:"角色ID"`
|
||||
RoleName *string `json:"roleName" orm:"role_name" description:"角色名称"`
|
||||
RoleKey *string `json:"roleKey" orm:"role_key" description:"角色权限字符串"`
|
||||
RoleSort *int `json:"roleSort" orm:"role_sort" description:"显示顺序"`
|
||||
MenuCheckStrictly *int `json:"menuCheckStrictly" orm:"menu_check_strictly" description:"菜单树选择项是否关联显示"`
|
||||
Status *string `json:"status" orm:"status" description:"角色状态(0正常 1停用)"`
|
||||
UpdatedBy *int64 `json:"updatedBy" orm:"updated_by" description:"更新者"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"`
|
||||
Remark *string `json:"remark" orm:"remark" description:"备注"`
|
||||
MenuIds []int64 `json:"menuIds" orm:"menu_ids" description:"菜单ID"`
|
||||
RoleId int64 `json:"roleId" orm:"role_id" description:"角色ID"`
|
||||
RoleName *string `json:"roleName" orm:"role_name" description:"角色名称"`
|
||||
RoleKey *string `json:"roleKey" orm:"role_key" description:"角色权限字符串"`
|
||||
RoleSort *int `json:"roleSort" orm:"role_sort" description:"显示顺序"`
|
||||
MenuCheckStrictly *int `json:"menuCheckStrictly" orm:"menu_check_strictly" description:"菜单树选择项是否关联显示"`
|
||||
Status *string `json:"status" orm:"status" description:"角色状态(0正常 1停用)"`
|
||||
UpdatedBy *int64 `json:"updatedBy" orm:"updated_by" description:"更新者"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"`
|
||||
Remark *string `json:"remark" orm:"remark" description:"备注"`
|
||||
MenuIds []int64 `json:"menuIds" orm:"menu_ids" description:"菜单ID"`
|
||||
RoleMenuDataScopes map[int64]string `json:"roleMenuDataScopes" description:"角色菜单数据范围"`
|
||||
DeptId *int64 `json:"deptId" orm:"dept_id" description:"部门组织id"`
|
||||
DeptId *int64 `json:"deptId" orm:"dept_id" description:"部门组织id"`
|
||||
}
|
||||
|
||||
type SysRoleEditModel struct {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package model
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package model
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package model
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package model
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package model
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package model
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package model
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package model
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package model
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package model
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package genin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package model
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package iotin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package genin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package genin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package genin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package genin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package genin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package iotin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package iot
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package genin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package genin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package genin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package genin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package genin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package genin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package genin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
@@ -43,7 +43,7 @@ type TSimCardInfoUpdateFields struct {
|
||||
DataServiceStatus int `json:"dataServiceStatus" dc:"数据服务状态:1启用、0禁用"`
|
||||
PackageTotalFlowMb float64 `json:"packageTotalFlowMb" dc:"套餐总流量MB"`
|
||||
UsedFlowMb float64 `json:"usedFlowMb" dc:"已用流量MB"`
|
||||
TrafficCutoffStatus int `json:"trafficCutoffStatus" dc:"达量断网配置状态:0未配置,1已开启,2已关闭"`
|
||||
TrafficCutoffStatus int `json:"trafficCutoffStatus" dc:"达量断网配置状态:0未配置,1已开启,2已关闭"`
|
||||
TrafficCutoffThreshold float64 `json:"trafficCutoffThreshold" dc:"达量断网阈值"`
|
||||
SmsServiceStatus int `json:"smsServiceStatus" dc:"短信服务状态:1启用、0禁用"`
|
||||
PackageTotalSms int `json:"packageTotalSms" dc:"套餐短信总条数"`
|
||||
@@ -98,7 +98,7 @@ type TSimCardInfoInsertFields struct {
|
||||
DataServiceStatus int `json:"dataServiceStatus" dc:"数据服务状态:1启用、0禁用"`
|
||||
PackageTotalFlowMb float64 `json:"packageTotalFlowMb" dc:"套餐总流量MB"`
|
||||
UsedFlowMb float64 `json:"usedFlowMb" dc:"已用流量MB"`
|
||||
TrafficCutoffStatus int `json:"trafficCutoffStatus" dc:"达量断网配置状态:0未配置,1已开启,2已关闭"`
|
||||
TrafficCutoffStatus int `json:"trafficCutoffStatus" dc:"达量断网配置状态:0未配置,1已开启,2已关闭"`
|
||||
TrafficCutoffThreshold float64 `json:"trafficCutoffThreshold" dc:"达量断网阈值"`
|
||||
SmsServiceStatus int `json:"smsServiceStatus" dc:"短信服务状态:1启用、0禁用"`
|
||||
PackageTotalSms int `json:"packageTotalSms" dc:"套餐短信总条数"`
|
||||
@@ -156,7 +156,7 @@ type TSimCardInfoEditParam struct {
|
||||
DataServiceStatus *int `json:"dataServiceStatus" dc:"数据服务状态:1启用、0禁用"`
|
||||
PackageTotalFlowMb *float64 `json:"packageTotalFlowMb" dc:"套餐总流量MB"`
|
||||
UsedFlowMb *float64 `json:"usedFlowMb" dc:"已用流量MB"`
|
||||
TrafficCutoffStatus *int `json:"trafficCutoffStatus" dc:"达量断网配置状态:0未配置,1已开启,2已关闭"`
|
||||
TrafficCutoffStatus *int `json:"trafficCutoffStatus" dc:"达量断网配置状态:0未配置,1已开启,2已关闭"`
|
||||
TrafficCutoffThreshold *float64 `json:"trafficCutoffThreshold" dc:"达量断网阈值"`
|
||||
SmsServiceStatus *int `json:"smsServiceStatus" dc:"短信服务状态:1启用、0禁用"`
|
||||
PackageTotalSms *int `json:"packageTotalSms" dc:"套餐短信总条数"`
|
||||
@@ -291,7 +291,7 @@ type TSimCardInfoListModel struct {
|
||||
DataServiceStatus int `json:"dataServiceStatus" dc:"数据服务状态:1启用、0禁用"`
|
||||
PackageTotalFlowMb float64 `json:"packageTotalFlowMb" dc:"套餐总流量MB"`
|
||||
UsedFlowMb float64 `json:"usedFlowMb" dc:"已用流量MB"`
|
||||
TrafficCutoffStatus int `json:"trafficCutoffStatus" dc:"达量断网配置状态:0未配置,1已开启,2已关闭"`
|
||||
TrafficCutoffStatus int `json:"trafficCutoffStatus" dc:"达量断网配置状态:0未配置,1已开启,2已关闭"`
|
||||
TrafficCutoffThreshold float64 `json:"trafficCutoffThreshold" dc:"达量断网阈值"`
|
||||
SmsServiceStatus int `json:"smsServiceStatus" dc:"短信服务状态:1启用、0禁用"`
|
||||
PackageTotalSms int `json:"packageTotalSms" dc:"套餐短信总条数"`
|
||||
@@ -354,7 +354,7 @@ type TSimCardInfoExportModel struct {
|
||||
DataServiceStatus int `json:"dataServiceStatus" dc:"数据服务状态:1启用、0禁用"`
|
||||
PackageTotalFlowMb float64 `json:"packageTotalFlowMb" dc:"套餐总流量MB"`
|
||||
UsedFlowMb float64 `json:"usedFlowMb" dc:"已用流量MB"`
|
||||
TrafficCutoffStatus int `json:"trafficCutoffStatus" dc:"达量断网配置状态:0未配置,1已开启,2已关闭"`
|
||||
TrafficCutoffStatus int `json:"trafficCutoffStatus" dc:"达量断网配置状态:0未配置,1已开启,2已关闭"`
|
||||
TrafficCutoffThreshold float64 `json:"trafficCutoffThreshold" dc:"达量断网阈值"`
|
||||
SmsServiceStatus int `json:"smsServiceStatus" dc:"短信服务状态:1启用、0禁用"`
|
||||
PackageTotalSms int `json:"packageTotalSms" dc:"套餐短信总条数"`
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package genin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package genin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package genin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package genin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package genin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package genin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package genin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package genin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package genin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package genin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package genin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package genin
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2026 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
// @AutoGenerate Version
|
||||
package model
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// package packed
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package packed
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// package response
|
||||
// @Link https://github.com/xiujiecn/xiu-admin
|
||||
// @Copyright Copyright (c) 2025 LiXiujie
|
||||
// @Author Lxj <li@xiujie.cn>
|
||||
// @Author Lxj <xxx@example.com>
|
||||
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
package response
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.5iot.com/iotlcm-public/iotlcm-openapi/internal/controller/common"
|
||||
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
)
|
||||
|
||||
func Common(ctx context.Context, group *ghttp.RouterGroup) {
|
||||
group.Group("/common", func(group *ghttp.RouterGroup) {
|
||||
group.Bind(common.NewV1())
|
||||
})
|
||||
}
|
||||
@@ -15,7 +15,6 @@ func InitRouter(ctx context.Context, s *ghttp.Server) {
|
||||
service.Middleware().ApiAuth,
|
||||
service.Middleware().ResponseHandler,
|
||||
)
|
||||
Common(ctx, group)
|
||||
Change(ctx, group)
|
||||
Query(ctx, group)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user