From a36a464b18fae3e6c404329f139d4f2eeff39a0a Mon Sep 17 00:00:00 2001 From: what Date: Wed, 27 Dec 2023 22:54:40 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E4=BA=91=E5=87=BD=E6=95=B0=20UserSaaS?= =?UTF-8?q?=20=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- condition_expr.go | 4 +++- go.mod | 3 ++- go.sum | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/condition_expr.go b/condition_expr.go index bf191a3..686ebdf 100644 --- a/condition_expr.go +++ b/condition_expr.go @@ -172,7 +172,9 @@ func (this ConditionExpr) GetTokenValue(m contracts.ModelParam) any { case "UserRolesUuid": return m.GetGlobalParamsUser().Roles() case "UserPlatform": - return m.GetGlobalParamsUser().Platform() + return m.GetGlobalParamsUser().Runtime().Platform() + case "UserSaaS": + return m.GetGlobalParamsUser().Runtime().SaaS() } default: return nil diff --git a/go.mod b/go.mod index 67ced00..6eb7a2c 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.fsdpf.net/go/condition go 1.19 require ( - git.fsdpf.net/go/contracts v0.0.0-20230719062509-d506eeb0b432 + git.fsdpf.net/go/contracts v0.0.0-20231227143841-17ee1779bc43 git.fsdpf.net/go/db v0.0.0-20230621051209-5740d112407f github.com/samber/lo v1.38.1 github.com/spf13/cast v1.5.1 @@ -14,6 +14,7 @@ require ( github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.0-20210816181553-5444fa50b93d // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/go-chi/chi v1.5.4 // indirect + github.com/go-chi/chi/v5 v5.0.10 // indirect github.com/go-sql-driver/mysql v1.7.0 // indirect github.com/goccy/go-json v0.9.7 // indirect github.com/golang/protobuf v1.5.2 // indirect diff --git a/go.sum b/go.sum index 49dedec..f095930 100644 --- a/go.sum +++ b/go.sum @@ -38,6 +38,8 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= git.fsdpf.net/go/contracts v0.0.0-20230719062509-d506eeb0b432 h1:H7PItbuhXzJjnQiAzWHitT/SW/ucgYDaQBJCRbh543k= git.fsdpf.net/go/contracts v0.0.0-20230719062509-d506eeb0b432/go.mod h1:gaSvU1UPH6M8Q2ZRW316VAIbDQQWG+5TV1jNrl1QvCA= +git.fsdpf.net/go/contracts v0.0.0-20231227143841-17ee1779bc43 h1:JbFTBiAhkue/NDdSUvoLAoCSKlObJhQiwO+q5CqliCE= +git.fsdpf.net/go/contracts v0.0.0-20231227143841-17ee1779bc43/go.mod h1:F7FKRPH8zPGvaH58WmZSKeRKV0SwCz9PxreqisJQ5rE= git.fsdpf.net/go/db v0.0.0-20230621051209-5740d112407f h1:H+/H6j+hyFMgSy+tUNmymRy7/PWQRjjp8qY/DrhwrsY= git.fsdpf.net/go/db v0.0.0-20230621051209-5740d112407f/go.mod h1:397Sdx1cJS0OlHtTX1bVl//9k3Xn0Klnc6jC4MAkb6w= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -69,6 +71,8 @@ github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4 github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/go-chi/chi v1.5.4 h1:QHdzF2szwjqVV4wmByUnTcsbIg7UGaQ0tPF2t5GcAIs= github.com/go-chi/chi v1.5.4/go.mod h1:uaf8YgoFazUOkPBG7fxPftUylNumIev9awIWOENIuEg= +github.com/go-chi/chi/v5 v5.0.10 h1:rLz5avzKpjqxrYwXNfmjkrYYXOyLJd37pz53UFHC6vk= +github.com/go-chi/chi/v5 v5.0.10/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=