🐛 Fix query issue

This commit is contained in:
LittleSheep 2024-08-25 17:16:22 +08:00
parent 876cfa9956
commit a6b0170b1d
2 changed files with 29 additions and 30 deletions

57
.idea/workspace.xml generated
View File

@ -4,9 +4,8 @@
<option name="autoReloadType" value="ALL" /> <option name="autoReloadType" value="ALL" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":sparkles: Return affiliated to and automated by in userinfo grpc call"> <list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":sparkles: Pagination bots api">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pkg/internal/server/api/bot_token_api.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/server/api/bot_token_api.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pkg/internal/server/api/bots_api.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/server/api/bots_api.go" afterDir="false" /> <change beforePath="$PROJECT_DIR$/pkg/internal/server/api/bots_api.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/server/api/bots_api.go" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
@ -42,34 +41,34 @@
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent"><![CDATA[{ <component name="PropertiesComponent">{
"keyToString": { &quot;keyToString&quot;: {
"DefaultGoTemplateProperty": "Go File", &quot;DefaultGoTemplateProperty&quot;: &quot;Go File&quot;,
"Go Build.Backend.executor": "Run", &quot;Go Build.Backend.executor&quot;: &quot;Run&quot;,
"Go 构建.Backend.executor": "Run", &quot;Go 构建.Backend.executor&quot;: &quot;Run&quot;,
"RunOnceActivity.ShowReadmeOnStart": "true", &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
"RunOnceActivity.go.formatter.settings.were.checked": "true", &quot;RunOnceActivity.go.formatter.settings.were.checked&quot;: &quot;true&quot;,
"RunOnceActivity.go.migrated.go.modules.settings": "true", &quot;RunOnceActivity.go.migrated.go.modules.settings&quot;: &quot;true&quot;,
"RunOnceActivity.go.modules.automatic.dependencies.download": "true", &quot;RunOnceActivity.go.modules.automatic.dependencies.download&quot;: &quot;true&quot;,
"RunOnceActivity.go.modules.go.list.on.any.changes.was.set": "true", &quot;RunOnceActivity.go.modules.go.list.on.any.changes.was.set&quot;: &quot;true&quot;,
"git-widget-placeholder": "master", &quot;git-widget-placeholder&quot;: &quot;master&quot;,
"go.import.settings.migrated": "true", &quot;go.import.settings.migrated&quot;: &quot;true&quot;,
"go.sdk.automatically.set": "true", &quot;go.sdk.automatically.set&quot;: &quot;true&quot;,
"last_opened_file_path": "/Users/littlesheep", &quot;last_opened_file_path&quot;: &quot;/Users/littlesheep&quot;,
"node.js.detected.package.eslint": "true", &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
"node.js.selected.package.eslint": "(autodetect)", &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
"nodejs_package_manager_path": "npm", &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
"run.code.analysis.last.selected.profile": "pProject Default", &quot;run.code.analysis.last.selected.profile&quot;: &quot;pProject Default&quot;,
"settings.editor.selected.configurable": "preferences.lookFeel", &quot;settings.editor.selected.configurable&quot;: &quot;preferences.lookFeel&quot;,
"ts.external.directory.path": "/Users/littlesheep/Documents/Projects/Hydrogen/Passport/web/node_modules/typescript/lib", &quot;ts.external.directory.path&quot;: &quot;/Users/littlesheep/Documents/Projects/Hydrogen/Passport/web/node_modules/typescript/lib&quot;,
"vue.rearranger.settings.migration": "true" &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
}, },
"keyToStringList": { &quot;keyToStringList&quot;: {
"DatabaseDriversLRU": [ &quot;DatabaseDriversLRU&quot;: [
"postgresql" &quot;postgresql&quot;
] ]
} }
}]]></component> }</component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/web/src/components/admin" /> <recent name="$PROJECT_DIR$/web/src/components/admin" />
@ -154,7 +153,6 @@
</option> </option>
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<MESSAGE value=":sparkles: View auth factors" />
<MESSAGE value=":sparkles: View auth factors in admin panel" /> <MESSAGE value=":sparkles: View auth factors in admin panel" />
<MESSAGE value=":rotating_light: Fix ts lint issue" /> <MESSAGE value=":rotating_light: Fix ts lint issue" />
<MESSAGE value=":poop: Remove mis-imported cgo" /> <MESSAGE value=":poop: Remove mis-imported cgo" />
@ -179,7 +177,8 @@
<MESSAGE value=":sparkles: Bot token aka. API token" /> <MESSAGE value=":sparkles: Bot token aka. API token" />
<MESSAGE value=":sparkles: Bots aka. automated accounts" /> <MESSAGE value=":sparkles: Bots aka. automated accounts" />
<MESSAGE value=":sparkles: Return affiliated to and automated by in userinfo grpc call" /> <MESSAGE value=":sparkles: Return affiliated to and automated by in userinfo grpc call" />
<option name="LAST_COMMIT_MESSAGE" value=":sparkles: Return affiliated to and automated by in userinfo grpc call" /> <MESSAGE value=":sparkles: Pagination bots api" />
<option name="LAST_COMMIT_MESSAGE" value=":sparkles: Pagination bots api" />
</component> </component>
<component name="VgoProject"> <component name="VgoProject">
<settings-migrated>true</settings-migrated> <settings-migrated>true</settings-migrated>

View File

@ -18,7 +18,7 @@ func listBots(c *fiber.Ctx) error {
} }
user := c.Locals("user").(models.Account) user := c.Locals("user").(models.Account)
tx := database.C.Where("automated_id = ?", user.AutomatedID) tx := database.C.Where("automated_id = ?", user.ID)
countTx := tx countTx := tx
var count int64 var count int64