From 77c768fa12f8f5930bdad1b4afdbdda519c2cc03 Mon Sep 17 00:00:00 2001 From: Michael Li Date: Tue, 28 Mar 2023 18:14:59 +0800 Subject: [PATCH] optimize web interface defile in mirc --- .vscode/launch.json | 2 +- mirc/admin/v1/user.go | 4 ++-- mirc/bot/v1/user.go | 4 ++-- mirc/localoss/v1/user.go | 2 +- mirc/space/v1/user.go | 4 ++-- mirc/web/v1/admin.go | 4 ++-- mirc/web/v1/alipay.go | 2 +- mirc/web/v1/core.go | 4 ++-- mirc/web/v1/followship.go | 4 ++-- mirc/web/v1/friendship.go | 4 ++-- mirc/web/v1/loose.go | 4 ++-- mirc/web/v1/priv.go | 4 ++-- mirc/web/v1/pub.go | 2 +- 13 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index c18360f6..fb60435b 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -6,7 +6,7 @@ "type": "go", "request": "launch", "mode": "exec", - "program": "${fileDirname}/__debug_bin", + "program": "${workspaceFolder}/.vscode/__debug_bin", "preLaunchTask": "go: build (debug)", "cwd": "${workspaceFolder}" } diff --git a/mirc/admin/v1/user.go b/mirc/admin/v1/user.go index 6f0dcb79..0924ca84 100644 --- a/mirc/admin/v1/user.go +++ b/mirc/admin/v1/user.go @@ -35,8 +35,8 @@ type LoginResp struct { } type User struct { - Chain Chain `mir:"-"` - Group Group `mir:"m/v1"` + Chain `mir:"-"` + Group `mir:"m/v1"` Login func(Post, LoginReq) LoginResp `mir:"/user/login/"` Logout func(Post) `mir:"/user/logout/"` } diff --git a/mirc/bot/v1/user.go b/mirc/bot/v1/user.go index a4839673..e9f614b6 100644 --- a/mirc/bot/v1/user.go +++ b/mirc/bot/v1/user.go @@ -35,8 +35,8 @@ type LoginResp struct { } type User struct { - Chain Chain `mir:"-"` - Group Group `mir:"r/v1"` + Chain `mir:"-"` + Group `mir:"r/v1"` Login func(Post, LoginReq) LoginResp `mir:"/user/login/"` Logout func(Post) `mir:"/user/logout/"` } diff --git a/mirc/localoss/v1/user.go b/mirc/localoss/v1/user.go index 555ff6d7..481d70a5 100644 --- a/mirc/localoss/v1/user.go +++ b/mirc/localoss/v1/user.go @@ -35,7 +35,7 @@ type LoginResp struct { } type User struct { - Group Group `mir:"s/v1"` + Group `mir:"s/v1"` Index func(Get) `mir:"/index/"` Login func(Post, LoginReq) LoginResp `mir:"/user/login/"` Logout func(Post) `mir:"/user/logout/"` diff --git a/mirc/space/v1/user.go b/mirc/space/v1/user.go index 8dd49fa5..f3193c7f 100644 --- a/mirc/space/v1/user.go +++ b/mirc/space/v1/user.go @@ -35,8 +35,8 @@ type LoginResp struct { } type User struct { - Chain Chain `mir:"-"` - Group Group `mir:"x/v1"` + Chain `mir:"-"` + Group `mir:"x/v1"` Login func(Post, LoginReq) LoginResp `mir:"/user/login/"` Logout func(Post) `mir:"/user/logout/"` } diff --git a/mirc/web/v1/admin.go b/mirc/web/v1/admin.go index 4a1d8655..c8126ba3 100644 --- a/mirc/web/v1/admin.go +++ b/mirc/web/v1/admin.go @@ -12,8 +12,8 @@ func init() { // Admin 运维相关服务 type Admin struct { - Chain Chain `mir:"-"` - Group Group `mir:"v1"` + Chain `mir:"-"` + Group `mir:"v1"` // ChangeUserStatus 管理·禁言/解封用户 ChangeUserStatus func(Post, web.ChangeUserStatusReq) `mir:"/admin/user/status"` diff --git a/mirc/web/v1/alipay.go b/mirc/web/v1/alipay.go index 63b763a3..b012c568 100644 --- a/mirc/web/v1/alipay.go +++ b/mirc/web/v1/alipay.go @@ -12,7 +12,7 @@ func init() { // AlipayPub 支付宝相关不用授权的服务 type AlipayPub struct { - Group Group `mir:"v1"` + Group `mir:"v1"` // AlipayNotify 支付宝回调 AlipayNotify func(Post, web.AlipayNotifyReq) `mir:"/alipay/notify"` diff --git a/mirc/web/v1/core.go b/mirc/web/v1/core.go index af835074..70d9c1a5 100644 --- a/mirc/web/v1/core.go +++ b/mirc/web/v1/core.go @@ -12,8 +12,8 @@ func init() { // Core 核心服务,需要授权访问 type Core struct { - Chain Chain `mir:"-"` - Group Group `mir:"v1"` + Chain `mir:"-"` + Group `mir:"v1"` // SyncSearchIndex 同步索引 SyncSearchIndex func(Get, web.SyncSearchIndexReq) `mir:"/sync/index"` diff --git a/mirc/web/v1/followship.go b/mirc/web/v1/followship.go index 99c0dba6..456fd5eb 100644 --- a/mirc/web/v1/followship.go +++ b/mirc/web/v1/followship.go @@ -12,8 +12,8 @@ func init() { // Followship 关注者模式 服务 type Followship struct { - Chain Chain `mir:"-"` - Group Group `mir:"v1"` + Chain `mir:"-"` + Group `mir:"v1"` // AddFollowing 添加关注 AddFollowing func(Post, web.AddFollowingReq) `mir:"/following/add"` diff --git a/mirc/web/v1/friendship.go b/mirc/web/v1/friendship.go index 1013a894..b753eee3 100644 --- a/mirc/web/v1/friendship.go +++ b/mirc/web/v1/friendship.go @@ -12,8 +12,8 @@ func init() { // Friendship 好友模式 服务 type Friendship struct { - Chain Chain `mir:"-"` - Group Group `mir:"v1"` + Chain `mir:"-"` + Group `mir:"v1"` // RequestingFriend 请求添加朋友 RequestingFriend func(Post, web.RequestingFriendReq) `mir:"/friend/requesting"` diff --git a/mirc/web/v1/loose.go b/mirc/web/v1/loose.go index 887e3c9b..977ca649 100644 --- a/mirc/web/v1/loose.go +++ b/mirc/web/v1/loose.go @@ -12,8 +12,8 @@ func init() { // Loose 宽松授权的服务 type Loose struct { - Chain Chain `mir:"-"` - Group Group `mir:"v1"` + Chain `mir:"-"` + Group `mir:"v1"` // Timeline 获取广场流 Timeline func(Get, web.TimelineReq) web.TimelineResp `mir:"/posts"` diff --git a/mirc/web/v1/priv.go b/mirc/web/v1/priv.go index 132e56b0..5e473539 100644 --- a/mirc/web/v1/priv.go +++ b/mirc/web/v1/priv.go @@ -12,8 +12,8 @@ func init() { // Priv 私有授权的服务 type Priv struct { - Chain Chain `mir:"-"` - Group Group `mir:"v1"` + Chain `mir:"-"` + Group `mir:"v1"` // UploadAttachment 上传资源 UploadAttachment func(Post, web.UploadAttachmentReq) web.UploadAttachmentResp `mir:"/attachment"` diff --git a/mirc/web/v1/pub.go b/mirc/web/v1/pub.go index 2364f223..aadc5e48 100644 --- a/mirc/web/v1/pub.go +++ b/mirc/web/v1/pub.go @@ -12,7 +12,7 @@ func init() { // Pub 不用授权的公开服务 type Pub struct { - Group Group `mir:"v1"` + Group `mir:"v1"` // Version 获取后台版本信息 Version func(Get) web.VersionResp `mir:"/"`