syntax = "v1" info ( title: "鉴权服务" desc: "鉴权服务" author: "landaiqing" email: "landaiqing@126.com" version: "v1.0.0" ) // 登录请求参数 type ( // 账户登录请求参数 AccountLoginRequest { Account string `json:"account"` Password string `json:"password"` AutoLogin bool `json:"auto_login"` Angle int64 `json:"angle"` Key string `json:"key"` } // 手机号登录请求参数 PhoneLoginRequest { Phone string `json:"phone"` Captcha string `json:"captcha"` AutoLogin bool `json:"auto_login"` } // 重置密码请求参数 ResetPasswordRequest { Phone string `json:"phone"` Captcha string `json:"captcha"` Password string `json:"password"` Repassword string `json:"repassword"` } WechatOffiaccountLoginRequest { Openid string `json:"openid"` ClientId string `json:"client_id"` } // 登录响应参数 LoginResponse { AccessToken string `json:"access_token"` ExpireAt int64 `json:"expire_at"` UID string `json:"uid"` Username string `json:"username,optional"` Nickname string `json:"nickname"` Avatar string `json:"avatar"` Status int64 `json:"status"` } AdminLoginRequest { Account string `json:"account"` Password string `json:"password"` Dots string `json:"dots"` Key string `json:"key"` } ) // OAuth请求参数 type ( // OAuth请求参数 OAuthRequest { state string `form:"state"` } // OAuth回调请求参数 OAuthCallbackRequest { Code string `form:"code"` } OAuthWechatRequest { clientId string `json:"client_id"` } ) // 短信发送请求参数 type ( SmsSendRequest { Phone string `json:"phone"` Angle int64 `json:"angle"` Key string `json:"key"` } ) // 刷新token响应参数 type ( RefreshTokenResponse { AccessToken string `json:"access_token"` ExpireAt int64 `json:"expire_at"` } ) // 验证码响应参数 type ( RotateCaptchaResponse { Key string `json:"key"` Image string `json:"image"` Thumb string `json:"thumb"` } SlideCaptchaResponse { Key string `json:"key"` Image string `json:"image"` Thumb string `json:"thumb"` ThumbWidth int64 `json:"thumb_width"` ThumbHeight int64 `json:"thumb_height"` ThumbX int64 `json:"thumb_x"` ThumbY int64 `json:"thumb_y"` } TextCaptchaResponse { Key string `json:"key"` Image string `json:"image"` Thumb string `json:"thumb"` } ) // 用户服务 @server ( group: user // 微服务分组 prefix: /api/user // 微服务前缀 timeout: 10s // 超时时间 maxBytes: 1048576 // 最大请求大小 signature: true // 是否开启签名验证 middleware: SecurityHeadersMiddleware,NonceMiddleware // 注册中间件 MaxConns: true // 是否开启最大连接数限制 Recover: true // 是否开启自动恢复 ) service auth { // 账户登录 @handler accountLogin post /login (AccountLoginRequest) returns (LoginResponse) // 手机号登录 @handler phoneLogin post /phone/login (PhoneLoginRequest) returns (LoginResponse) // 重置密码 @handler resetPassword post /reset/password (ResetPasswordRequest) // 微信公众号登录 @handler wechatOffiaccountLogin post /wechat/offiaccount/login (WechatOffiaccountLoginRequest) returns (LoginResponse) // 获取微信公众号二维码 @handler getWechatOffiaccountQrcode post /wechat/offiaccount/qrcode (OAuthWechatRequest) returns (string) // 管理员登录 @handler adminLogin post /admin/login (AdminLoginRequest) returns (LoginResponse) } @server ( group: token // 微服务分组 prefix: /api/auth // 微服务前缀 timeout: 10s // 超时时间 maxBytes: 1048576 // 最大请求大小 signature: true // 是否开启签名验证 middleware: SecurityHeadersMiddleware,CasbinVerifyMiddleware,NonceMiddleware // 注册中间件 MaxConns: true // 是否开启最大连接数限制 Recover: true // 是否开启自动恢复 ) service auth { @handler refreshToken post /token/refresh returns (RefreshTokenResponse) } // 客户端服务 @server ( group: client // 微服务分组 prefix: /api/client // 微服务前缀 timeout: 10s // 超时时间 maxBytes: 1048576 // 最大请求大小 signature: false // 是否开启签名验证 middleware: SecurityHeadersMiddleware,NonceMiddleware // 注册中间件 MaxConns: true // 是否开启最大连接数限制 Recover: true // 是否开启自动恢复 ) service auth { @handler generateClientId get /generate returns (string) } @server ( group: websocket // 微服务分组 prefix: /api/ws // 微服务前缀 ) service auth { @handler qrcodeWebsocket get /qrcode @handler messageWebsocket get /message @handler fileWebsocket get /file } @server ( group: oauth // 微服务分组 prefix: /api/oauth // 微服务前缀 timeout: 10s // 超时时间 maxBytes: 1048576 // 最大请求大小 signature: false // 是否开启签名验证 middleware: SecurityHeadersMiddleware // 注册中间件 MaxConns: true // 是否开启最大连接数限制 Recover: true // 是否开启自动恢复 ) service auth { @handler getGiteeOauthUrl get /gitee/url returns (string) @handler getGithubOauthUrl get /github/url (OAuthRequest) returns (string) @handler getQqOauthUrl get /qq/url (OAuthRequest) returns (string) @handler giteeCallback get /gitee/callback (OAuthCallbackRequest) returns (string) @handler githubCallback get /github/callback (OAuthCallbackRequest) returns (string) @handler qqCallback get /qq/callback (OAuthCallbackRequest) returns (string) @handler wechatOffiaccountCallback post /wechat/offiaccount/callback // important! @handler wechatOffiaccountCallbackVerify get /wechat/offiaccount/callback } @server ( group: sms // 微服务分组 prefix: /api/sms // 微服务前缀 timeout: 10s // 超时时间 maxBytes: 1048576 // 最大请求大小 signature: false // 是否开启签名验证 middleware: SecurityHeadersMiddleware,NonceMiddleware // 注册中间件 MaxConns: true // 是否开启最大连接数限制 Recover: true // 是否开启自动恢复 ) service auth { @handler sendSmsByAliyun post /ali/send (SmsSendRequest) @handler sendSmsBySmsbao post /smsbao/send (SmsSendRequest) @handler sendSmsByTest post /test/send (SmsSendRequest) returns (string) } @server ( group: captcha // 微服务分组 prefix: /api/captcha // 微服务前缀 timeout: 10s // 超时时间 maxBytes: 1048576 // 最大请求大小 signature: false // 是否开启签名验证 middleware: SecurityHeadersMiddleware,NonceMiddleware // 注册中间件 MaxConns: true // 是否开启最大连接数限制 Recover: true // 是否开启自动恢复 ) service auth { @handler generateRotateCaptcha get /rotate/generate returns (RotateCaptchaResponse) @handler generateSlideBasicCaptcha get /slide/generate returns (SlideCaptchaResponse) // 文字点选验证码 @handler generateTextCaptcha get /text/generate returns (TextCaptchaResponse) } type ( // 评论提交请求参数 CommentRequest { Content string `json:"content"` Images string `json:"images,optional"` TopicId string `json:"topic_id"` Author string `json:"author"` Key string `json:"key"` Point []int64 `json:"point"` } // 回复评论提交请求参数 ReplyCommentRequest { Content string `json:"content"` Images string `json:"images,optional"` TopicId string `json:"topic_id" ` ReplyId int64 `json:"reply_id" ` ReplyUser string `json:"reply_user" ` Author string `json:"author"` Key string `json:"key"` Point []int64 `json:"point"` } // 回复回复请求参数 ReplyReplyRequest { Content string `json:"content"` Images string `json:"images,optional"` TopicId string `json:"topic_id"` ReplyTo int64 `json:"reply_to"` ReplyId int64 `json:"reply_id"` ReplyUser string `json:"reply_user" ` Author string `json:"author"` Key string `json:"key"` Point []int64 `json:"point"` } // 评论列表请求参数 CommentListRequest { TopicId string `json:"topic_id"` Page int `json:"page,default=1,optional"` Size int `json:"size,default=5,optional"` IsHot bool `json:"is_hot,default=true,optional"` } // 回复列表请求参数 ReplyListRequest { TopicId string `json:"topic_id"` CommentId int64 `json:"comment_id"` Page int `json:"page,default=1,optional"` Size int `json:"size,default=5,optional"` } // 点赞评论的请求参数 CommentLikeRequest { TopicId string `json:"topic_id"` CommentId int64 `json:"comment_id"` } CommentDisLikeRequest { TopicId string `json:"topic_id"` CommentId int64 `json:"comment_id"` } ) // 响应参数 type ( // CommentContent 评论内容 CommentContent { NickName string `json:"nickname"` Avatar string `json:"avatar"` Level int64 `json:"level,optional" default:"0"` Id int64 `json:"id"` UserId string `json:"user_id"` TopicId string `json:"topic_id"` Content string `json:"content"` ReplyTo int64 `json:"reply_to,optional"` ReplyId int64 `json:"reply_id,optional"` ReplyUser string `json:"reply_user,optional"` ReplyNickname string `json:"reply_nickname,optional"` IsAuthor int64 `json:"is_author"` Likes int64 `json:"likes"` ReplyCount int64 `json:"reply_count"` CreatedTime string `json:"created_time"` Location string `json:"location"` Browser string `json:"browser"` OperatingSystem string `json:"operating_system"` IsLiked bool `json:"is_liked" default:"false"` Images string `json:"images,optional"` } // CommentListPageResponse 评论返回值 CommentListPageResponse { Size int `json:"size"` Total int64 `json:"total"` Current int `json:"current"` Comments []CommentContent `json:"comments"` } // CommentResponse 提交评论响应 CommentResponse { Id int64 `json:"id"` Content string `json:"content"` UserId string `json:"user_id"` TopicId string `json:"topic_id"` Author int64 `json:"author"` Location string `json:"location"` Browser string `json:"browser"` OperatingSystem string `json:"operating_system"` CreatedTime string `json:"created_time"` ReplyId int64 `json:"reply_id,optional"` ReplyUser string `json:"reply_user,optional"` ReplyTo int64 `json:"reply_to,optional"` } ) @server ( group: comment // 微服务分组 prefix: /api/auth/comment // 微服务前缀 timeout: 10s // 超时时间 maxBytes: 10485760 // 最大请求大小 signature: false // 是否开启签名验证 middleware: SecurityHeadersMiddleware,CasbinVerifyMiddleware,NonceMiddleware,AuthMiddleware // 注册中间件 MaxConns: true // 是否开启最大连接数限制 Recover: true // 是否开启自动恢复 jwt: Auth // 是否开启jwt验证 ) service auth { @handler getCommentList post /list (CommentListRequest) returns (CommentListPageResponse) @handler getReplyList post /reply/list (ReplyListRequest) returns (CommentListPageResponse) @handler submitComment post /submit (CommentRequest) returns (CommentResponse) @handler submitReplyComment post /reply/submit (ReplyCommentRequest) returns (CommentResponse) @handler submitReplyReply post /reply/reply/submit (ReplyReplyRequest) returns (CommentResponse) @handler likeComment post /like (CommentLikeRequest) @handler dislikeComment post /dislike (CommentDisLikeRequest) } // 上传图片请求参数 type ( UploadRequest { Image string `json:"image"` AccessToken string `json:"access_token"` userId string `json:"user_id"` } SharePhoneUploadRequest { OriginFileObj string `json:"origin_file_obj"` Name string `json:"name"` Type string `json:"type"` Size int64 `json:"size"` AccessToken string `json:"access_token"` userId string `json:"user_id"` } ) @server ( group: phone // 微服务分组 prefix: /api/auth/phone // 微服务前缀 timeout: 10s // 超时时间 maxBytes: 10485760 // 最大请求大小 signature: false // 是否开启签名验证 middleware: SecurityHeadersMiddleware,NonceMiddleware // 注册中间件 MaxConns: true // 是否开启最大连接数限制 Recover: true // 是否开启自动恢复 ) service auth { @handler uploadImage post /upload (UploadRequest) @handler sharePhoneUpload post /share/upload (SharePhoneUploadRequest) @handler commonUpload post /common/upload } // 文件上传配置请求参数 type ( StorageConfigRequest { Provider string `json:"provider"` AccessKey string `json:"access_key"` SecretKey string `json:"secret_key"` Endpoint string `json:"endpoint"` Bucket string `json:"bucket"` Region string `json:"region"` Capacity int64 `json:"capacity"` } FaceSampleLibrary { ID int64 `json:"id"` FaceName string `json:"face_name"` FaceImage string `json:"face_image"` } FaceSampleLibraryListRequest { Type int64 `json:"type"` } FaceSampleLibraryListResponse { faces []FaceSampleLibrary `json:"faces"` } ModifyFaceNameRequestAndResponse { ID int64 `json:"id"` FaceName string `json:"face_name"` } ModifyFaceTypeRequest { IDs []int64 `json:"ids"` FaceType int64 `json:"face_type"` } ModifyFaceTypeResponse { result string `json:"result"` } FaceDetailListRequest { FaceID int64 `json:"face_id"` Provider string `json:"provider"` Bucket string `json:"bucket"` } FaceDetailListResponse { records []AllImageDetail `json:"records"` } // 创建相册请求参数 AlbumCreateRequest { Name string `json:"name"` } // 创建相册响应参数 AlbumCreateResponse { ID int64 `json:"id"` } // 相册列表请求参数 AlbumListRequest { Type int64 `json:"type,optional"` Sort bool `json:"sort"` } // 相册列表响应参数 Album { ID int64 `json:"id"` Name string `json:"name"` CreatedAt string `json:"created_at"` Type int64 `json:"type"` CoverImage string `json:"cover_image"` } AlbumListResponse { Albums []Album `json:"albums"` } // 相册详情请求参数 AlbumDetailListRequest { ID int64 `json:"id"` Provider string `json:"provider"` Bucket string `json:"bucket"` Type int64 `json:"type"` } // 相册详情响应参数 AlbumDetailListResponse { records []AllImageDetail `json:"records"` } // 重命名相册请求参数 AlbumRenameRequest { ID int64 `json:"id"` Name string `json:"name"` } // 重命名相册响应参数 AlbumRenameResponse { ID int64 `json:"id"` Name string `json:"name"` } // 删除相册请求参数 AlbumDeleteRequest { ID int64 `json:"id"` } // 所有图片列表请求参数 AllImageListRequest { Type string `json:"type"` Sort bool `json:"sort"` Provider string `json:"provider"` Bucket string `json:"bucket"` } // 所有图片列表响应参数 ImageMeta { ID int64 `json:"id"` fileName string `json:"file_name"` URL string `json:"url"` Width float64 `json:"width"` Height float64 `json:"height"` CreatedAt string `json:"created_at"` Thumbnail string `json:"thumbnail"` } AllImageDetail { Date string `json:"date"` list []ImageMeta `json:"list"` } AllImageListResponse { records []AllImageDetail `json:"records"` } RecentListRequest { Provider string `json:"provider"` Bucket string `json:"bucket"` } // 最近上传图片列表请求参数 RecentListResponse { records []AllImageDetail `json:"records"` } LocationMeta { ID int64 `json:"id"` City string `json:"city"` Total int64 `json:"total"` CoverImage string `json:"cover_image"` } LocationListData { location string `json:"location"` // 中国 新疆维吾尔自治区 list []LocationMeta `json:"list"` // 图片列表 } LocationListRequest { Provider string `json:"provider"` Bucket string `json:"bucket"` } // 地点相册列表响应参数 LocationListResponse { records []LocationListData `json:"records"` } // 地点详情列表请求参数 LocationDetailListRequest { ID int64 `json:"id"` Provider string `json:"provider"` Bucket string `json:"bucket"` } // 地点详情列表响应参数 LocationDetailListResponse { records []AllImageDetail `json:"records"` } ThingMeta { TagName string `json:"tag_name"` CreatedAt string `json:"created_at"` TagCount int64 `json:"tag_count"` CoverImage string `json:"cover_image"` } ThingListData { Category string `json:"category"` // 分类 list []ThingMeta `json:"list"` // 图片列表 } ThingListRequest { Provider string `json:"provider"` Bucket string `json:"bucket"` } // 事物相册列表响应参数 ThingListResponse { records []ThingListData `json:"records"` } // 事物详情列表请求参数 ThingDetailListRequest { TagName string `json:"tag_name"` Provider string `json:"provider"` Bucket string `json:"bucket"` } // 事物详情列表响应参数 ThingDetailListResponse { records []AllImageDetail `json:"records"` } // 单张图片请求参数 SingleImageRequest { ID int64 `json:"id"` } DeleteImageRequest { IDS []int64 `json:"ids"` Provider string `json:"provider"` Bucket string `json:"bucket"` } StorageMeta { Name string `json:"name"` Value string `json:"value"` } StroageNode { Value string `json:"value"` Name string `json:"name"` Children []StorageMeta `json:"children"` } StorageListResponse { Records []StroageNode `json:"records"` } QueryDeleteRecordRequest { Provider string `json:"provider"` Bucket string `json:"bucket"` } DeleteRecordListResponse { Records []AllImageDetail `json:"records"` } BucketCapacityRequest { Provider string `json:"provider"` Bucket string `json:"bucket"` } BucketCapacityResponse { Capacity string `json:"capacity"` Used string `json:"used"` Percentage float64 `json:"percentage"` } ShareAlbumRequest { ID int64 `json:"id"` ExpireDate string `json:"expire_date"` AccessLimit int64 `json:"access_limit,optional"` AccessPassword string `json:"access_password,optional"` Provider string `json:"provider"` Bucket string `json:"bucket"` } DownloadAlbumRequest { ID int64 `json:"id"` Provider string `json:"provider"` Bucket string `json:"bucket"` } DownloadAlbumResponse { Records []string `json:"records"` } // 搜索图片请求参数 SearchImageRequest { Type string `json:"type"` Keyword string `json:"keyword"` Provider string `json:"provider"` Bucket string `json:"bucket"` } // 搜索图片相应参数 SearchImageResponse { Records []AllImageDetail `json:"records"` } // 搜索相册请求参数 SearchAlbumRequest { Keyword string `json:"keyword"` } // 搜索相册相应参数 SearchAlbumResponse { Albums []Album `json:"albums"` } // 图片添加到相册请求参数 AddImageToAlbumRequest { IDS []int64 `json:"ids"` AlbumID int64 `json:"album_id"` Provider string `json:"provider"` Bucket string `json:"bucket"` } StorageConfigMeta { ID int64 `json:"id"` Provider string `json:"provider"` Endpoint string `json:"endpoint"` Bucket string `json:"bucket"` Region string `json:"region"` Capacity int64 `json:"capacity"` CreatedAt string `json:"created_at"` } StorageConfigListResponse { Records []StorageConfigMeta `json:"records"` } DeleteStorageConfigRequest { ID int64 `json:"id"` Provider string `json:"provider"` Bucket string `json:"bucket"` } HeatmapMeta { Date string `json:"date"` Count int64 `json:"count"` } UserUploadInfoResponse { ImageCount int64 `json:"image_count"` TodayUploadCount int64 `json:"today_upload_count"` ShareCount int64 `json:"share_count"` TodayShareCount int64 `json:"today_share_count"` FileSizeCount int64 `json:"file_size_count"` TodayFileSizeCount int64 `json:"today_file_size_count"` Heatmap []HeatmapMeta `json:"heatmap"` } ShareRecentMeta { Date string `json:"date"` VisitCount int64 `json:"visit_count"` VisitorCount int64 `json:"visitor_count"` PublishCount int64 `json:"publish_count"` } ShareRecentInfoResponse { Records []ShareRecentMeta `json:"records"` } PrivateImageListRequest { Provider string `json:"provider"` Bucket string `json:"bucket"` Password string `json:"password"` Dots string `json:"dots"` Key string `json:"key"` } SinglePrivateImageRequest { ID int64 `json:"id"` Password string `json:"password"` Provider string `json:"provider"` Bucket string `json:"bucket"` } CoordinateMeta { ID int64 `json:"id"` Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` ImageCount int64 `json:"image_count"` Country string `json:"country"` Province string `json:"province"` City string `json:"city"` } CoordinateListResponse { Records []CoordinateMeta `json:"records"` } RecoverImageRequest { ID int64 `json:"id"` Provider string `json:"provider"` Bucket string `json:"bucket"` } ImageBedUploadResponse { ID int64 `json:"id"` } ImageBedUploadListRequest { Provider string `json:"provider"` Bucket string `json:"bucket"` } ImageBedUploadMeta { ID int64 `json:"id"` FileName string `json:"file_name"` FileSize int64 `json:"file_size"` FileType string `json:"file_type"` Path string `json:"path"` Thumbnail string `json:"thumbnail"` CreatedAt string `json:"created_at"` Width int64 `json:"width"` Height int64 `json:"height"` } ImageBedUploadListResponse { Records []ImageBedUploadMeta `json:"records"` } BackupImageRequest { OriginProvider string `json:"origin_provider"` OriginBucket string `json:"origin_bucket"` OriginRegion string `json:"origin_region"` TargetProvider string `json:"target_provider"` TargetBucket string `json:"target_bucket"` TargetRegion string `json:"target_region"` } ) // 文件上传 @server ( group: storage // 微服务分组 prefix: /api/auth/storage // 微服务前缀 timeout: 20s // 超时时间 maxBytes: 104857600 // 最大请求大小 signature: false // 是否开启签名验证 middleware: SecurityHeadersMiddleware,CasbinVerifyMiddleware,NonceMiddleware,AuthMiddleware // 注册中间件 MaxConns: true // 是否开启最大连接数限制 Recover: true // 是否开启自动恢复 jwt: Auth // 是否开启jwt验证 ) service auth { // 上传文件 @handler uploadFile post /uploads returns (string) // 设置存储配置 @handler setStorageConfig post /config/add (StorageConfigRequest) returns (string) // 获取人脸样本库列表 @handler getFaceSampleLibraryList post /face/sample/list (FaceSampleLibraryListRequest) returns (FaceSampleLibraryListResponse) // 修改人脸样本名称 @handler modifyFaceLibraryName post /face/sample/modify/name (ModifyFaceNameRequestAndResponse) returns (ModifyFaceNameRequestAndResponse) // 修改人脸样本类型 @handler modifyFaceLibraryType post /face/sample/modify/type (ModifyFaceTypeRequest) returns (ModifyFaceTypeResponse) // 获取人脸详情列表 @handler getFaceDetailList post /face/detail/list (FaceDetailListRequest) returns (FaceDetailListResponse) // 创建相册 @handler createAlbum post /album/create (AlbumCreateRequest) returns (AlbumCreateResponse) // 获取相册列表 @handler getAlbumList post /album/list (AlbumListRequest) returns (AlbumListResponse) // 获取相册详情 @handler getAlbumDetail post /album/detail/list (AlbumDetailListRequest) returns (AlbumDetailListResponse) // 重命名相册 @handler renameAlbum post /album/rename (AlbumRenameRequest) returns (AlbumRenameResponse) // 删除相册 @handler deleteAlbum post /album/delete (AlbumDeleteRequest) returns (string) // 获取所有图片列表 @handler queryAllImageList post /image/all/list (AllImageListRequest) returns (AllImageListResponse) // 获取最近上传图片列表 @handler queryRecentImageList post /image/recent/list (RecentListRequest) returns (RecentListResponse) // 获取地点相册列表 @handler queryLocationImageList post /image/location/list (LocationListRequest) returns (LocationListResponse) // 获取地点详情列表 @handler queryLocationDetailList post /image/location/detail/list (LocationDetailListRequest) returns (LocationDetailListResponse) // 获取事物相册列表 @handler queryThingImageList post /image/thing/list (ThingListRequest) returns (ThingListResponse) // 获取事物详情列表 @handler queryThingDetailList post /image/thing/detail/list (ThingDetailListRequest) returns (ThingDetailListResponse) // 获取单张图片连接 @handler getImageUrl post /image/url/single (SingleImageRequest) returns (string) // 获取用户存储配置列表 @handler getUserStorageList post /user/config/list returns (StorageListResponse) // 删除图片 @handler deleteImage post /image/delete (DeleteImageRequest) returns (string) // 获取删除记录 @handler getDeleteRecord post /delete/record (QueryDeleteRecordRequest) returns (DeleteRecordListResponse) // 获取存储桶的容量信息 @handler getBucketCapacity post /bucket/capacity (BucketCapacityRequest) returns (BucketCapacityResponse) // 分享相册 @handler shareAlbum post /album/share (ShareAlbumRequest) returns (string) // 下载相册 @handler downloadAlbum post /album/download (DownloadAlbumRequest) returns (DownloadAlbumResponse) // 图片搜索 @handler searchImage post /image/search (SearchImageRequest) returns (SearchImageResponse) // 搜索相册 @handler searchAlbum post /album/search (SearchAlbumRequest) returns (SearchAlbumResponse) // 添加图片到相册 @handler addImageToAlbum post /album/add/image (AddImageToAlbumRequest) returns (string) //列举用户所有存储商 @handler listUserStorage post /user/storage/list returns (StorageConfigListResponse) // 删除存储配置 @handler deleteStorageConfig post /config/delete (DeleteStorageConfigRequest) returns (string) // 获取用户上传统计信息 @handler getUserUploadInfo post /user/upload/info returns (UserUploadInfoResponse) // 获取分享最近的数据统计 @handler getShareRecentInfo post /share/recent/info returns (ShareRecentInfoResponse) // 获取隐私加密图片 @handler getPrivateImageList post /image/private/list (PrivateImageListRequest) returns (AllImageListResponse) // 获取解密单个隐私加密图片 @handler getPrivateImageUrl post /image/private/url/single (SinglePrivateImageRequest) returns (string) // 获取图像经纬度列表 @handler getCoordinateList post /coordinate/list returns (CoordinateListResponse) // 恢复删除图片 @handler recoverImage post /image/recover (RecoverImageRequest) returns (string) // 图床上传图片 @handler imageBedUpload post /image/bed/upload returns (ImageBedUploadResponse) // 获取图床上传的图片列表 @handler getImageBedUploadList post /image/bed/upload/list (ImageBedUploadListRequest) returns (ImageBedUploadListResponse) // 备份图像数据 @handler backupImage post /image/backup (BackupImageRequest) returns (string) } type ( ShareImageMeta { FileName string `json:"file_name"` OriginImage string `json:"origin_image"` FileType string `json:"file_type"` Thumbnail string `json:"thumbnail"` ThumbW float64 `json:"thumb_w"` ThumbH float64 `json:"thumb_h"` ThumbSize int64 `json:"thumb_size"` } ShareImageRequest { Title string `json:"title,optional"` ExpireDate string `json:"expire_date"` AccessLimit int64 `json:"access_limit,optional"` AccessPassword string `json:"access_password,optional"` Images []ShareImageMeta `json:"images"` } QueryShareImageRequest { InviteCode string `json:"invite_code"` AccessPassword string `json:"access_password,optional"` } QueryShareImageResponse { Records []AllImageDetail `json:"records"` } ShareRecordListRequest { DateRange []string `json:"date_range"` } // 分享记录列表响应参数 ShareRecord { ID int64 `json:"id"` CoverImage string `json:"cover_image"` CreatedAt string `json:"created_at"` InviteCode string `json:"invite_code"` VisitLimit int64 `json:"visit_limit"` AccessPassword string `json:"access_password"` ValidityPeriod int64 `json:"validity_period"` AlbumID int64 `json:"album_id"` } ShareRecordListResponse { records []ShareRecord `json:"records"` } QueryShareInfoRequest { InviteCode string `json:"invite_code"` AccessPassword string `json:"access_password,optional"` } ShareInfoResponse { ID int64 `json:"id"` CoverImage string `json:"cover_image"` CreatedAt string `json:"created_at"` VisitLimit int64 `json:"visit_limit"` ExpireTime string `json:"expire_time"` ImageCount int64 `json:"image_count"` VisitCount int64 `json:"visit_count"` ViewerCount int64 `json:"viewer_count"` SharerAvatar string `json:"sharer_avatar"` SharerName string `json:"sharer_name"` AlbumName string `json:"album_name"` InviteCode string `json:"invite_code"` SharerUID string `json:"sharer_uid"` } // 分享数据概览响应参数 ShareOverviewResponse { VisitCount int64 `json:"visit_count"` VisitCountToday int64 `json:"visit_count_today"` ViewerCount int64 `json:"viewer_count"` ViewerCountToday int64 `json:"viewer_count_today"` PublishCount int64 `json:"publish_count"` PublishCountToday int64 `json:"publish_count_today"` } // 删除分享记录请求参数 DeleteShareRecordRequest { ID int64 `json:"id"` InviteCode string `json:"invite_code"` AlbumID int64 `json:"album_id"` } ) // 分享服务 @server ( group: share // 微服务分组 prefix: /api/auth/share // 微服务前缀 timeout: 10s // 超时时间 maxBytes: 104857600 // 最大请求大小 signature: false // 是否开启签名验证 middleware: SecurityHeadersMiddleware,CasbinVerifyMiddleware,NonceMiddleware,AuthMiddleware // 注册中间件 MaxConns: true // 是否开启最大连接数限制 Recover: true // 是否开启自动恢复 jwt: Auth // 是否开启jwt验证 ) service auth { @handler uploadShareImage post /upload (ShareImageRequest) returns (string) //查看分享图片 @handler queryShareImage post /image/list (QueryShareImageRequest) returns (QueryShareImageResponse) // 列出分享记录 @handler listShareRecord post /record/list (ShareRecordListRequest) returns (ShareRecordListResponse) // 查看分享信息 @handler queryShareInfo post /info (QueryShareInfoRequest) returns (ShareInfoResponse) // 查询浏览数据概览 @handler queryShareOverview post /overview returns (ShareOverviewResponse) // 删除分享记录 @handler deleteShareRecord post /record/delete (DeleteShareRecordRequest) returns (string) } type ( UserSecuritySettingResponse { bindPhone bool `json:"bind_phone,default=false"` bindEmail bool `json:"bind_email,default=falsel"` bindWechat bool `json:"bind_wechat,default=false"` bindQQ bool `json:"bind_qq,default=false"` bindGitHub bool `json:"bind_github,default=false"` bindGitee bool `json:"bind_gitee,default=false"` setPassword bool `json:"set_password,default=false"` } ModifyPersonalInfoRequest { Nickname string `json:"nickname,optional"` Avatar string `json:"avatar,optional"` Email string `json:"email,optional"` Gender int64 `json:"gender,optional"` Introduce string `json:"introduce,optional"` Blog string `json:"blog,optional"` Location string `json:"location,optional"` Company string `json:"company,optional"` } ) // 用户服务 @server ( group: auth // 微服务分组 prefix: /api/auth/user // 微服务前缀 timeout: 10s // 超时时间 maxBytes: 104857600 // 最大请求大小 signature: false // 是否开启签名验证 middleware: SecurityHeadersMiddleware,CasbinVerifyMiddleware,NonceMiddleware,AuthMiddleware // 注册中间件 MaxConns: true // 是否开启最大连接数限制 Recover: true // 是否开启自动恢复 jwt: Auth // 是否开启jwt验证 ) service auth { // 判断用户安全设置 @handler checkUserSecuritySetting post /check/security/setting returns (UserSecuritySettingResponse) // 退出登录 @handler logout post /logout returns (string) // 获取个人信息 @handler getPersonalInfo post /personal/info returns (UserMeta) // 修改个人信息 @handler modifyPersonalInfo post /personal/modify (ModifyPersonalInfoRequest) returns (string) } type ( UserMeta { ID int64 `json:"id"` UID string `json:"uid"` Username string `json:"username"` Nickname string `json:"nickname"` Avatar string `json:"avatar"` Email string `json:"email"` Phone string `json:"phone"` Gender string `json:"gender"` Introduce string `json:"introduce"` Blog string `json:"blog"` Location string `json:"location"` Company string `json:"company"` Status int64 `json:"status"` CreatedAt string `json:"created_at"` UpadatedAt string `json:"updated_at"` DeletedAt string `json:"deleted_at"` } UserInfoListResponse { Records []UserMeta `json:"records"` } RoleMeta { ID int64 `json:"id"` RoleName string `json:"role_name"` RoleKey string `json:"role_key"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` DeletedAt string `json:"deleted_at"` } RoleListResponse { Records []RoleMeta `json:"records"` } PermissionRuleMeta { ID int64 `json:"id"` Ptype string `json:"ptype"` V0 string `json:"v0"` V1 string `json:"v1"` V2 string `json:"v2"` V3 string `json:"v3"` V4 string `json:"v4"` V5 string `json:"v5"` } PermissionRuleListResponse { Records []PermissionRuleMeta `json:"records"` } UserLoginLogMeta { ID int64 `json:"id"` UserID int64 `json:"user_id"` IP string `json:"ip"` Location string `json:"location"` Agent string `json:"agent"` CreatedAt string `json:"created_at"` Browser string `json:"browser"` OperatingSystem string `json:"operating_system"` BrowserVersion string `json:"browser_version"` Mobile string `json:"mobile"` Bot int64 `json:"bot"` Mozilla string `json:"mozilla"` Platform string `json:"platform"` EngineName string `json:"engine_name"` EngineVersion string `json:"engine_version"` UpdatedAt string `json:"updated_at"` DeletedAt string `json:"deleted_at"` } UserLoginLogListResponse { Records []UserLoginLogMeta `json:"records"` } UserThirdPartyLoginMeta { ID int64 `json:"id"` UserID int64 `json:"user_id"` OpenID string `json:"open_id"` Source string `json:"source"` Status int64 `json:"status"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` DeletedAt string `json:"deleted_at"` } UserThirdPartyLoginListResponse { Records []UserThirdPartyLoginMeta `json:"records"` } AllStorageListResponse { Records []StorageConfigMeta `json:"records"` } CommentReplyMeta { ID int64 `json:"id"` UserID int64 `json:"user_id"` TopicID int64 `json:"topic_id"` TopicType string `json:"topic_type"` Content string `json:"content"` CommentType string `json:"comment_type"` ReplyTo int64 `json:"reply_to"` ReplyID int64 `json:"reply_id"` ReplyUser string `json:"reply_user"` Author string `json:"author"` Likes int64 `json:"likes"` ReplyCount int64 `json:"reply_count"` ImagePath string `json:"image_path"` Browser string `json:"browser"` OperatingSystem string `json:"operating_system"` BrowserVersion string `json:"browser_version"` CommentIP string `json:"comment_ip"` Loaction string `json:"loaction"` Agent string `json:"agent"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` DeletedAt string `json:"deleted_at"` } AllCommentListResponse { Records []CommentReplyMeta `json:"records"` } ) // 系统服务 @server ( group: system // 微服务分组 prefix: /api/auth/system // 微服务前缀 timeout: 10s // 超时时间 maxBytes: 10485760 // 最大请求大小 signature: true // 是否开启签名验证 middleware: SecurityHeadersMiddleware,CasbinVerifyMiddleware,NonceMiddleware,AuthMiddleware // 注册中间件 MaxConns: true // 是否开启最大连接数限制 Recover: true // 是否开启自动恢复 jwt: Auth // 是否开启jwt验证 ) service auth { // 获取用户列表 @handler getUserList post /user/list returns (UserInfoListResponse) // 获取所有角色列表 @handler getAllRoleList post /role/list returns (RoleListResponse) // 获取去权限规则表 @handler getPermissionRuleList post /permission/rule/list returns (PermissionRuleListResponse) // 获取用户登录日志列表 @handler getUserLoginLogList post /user/login/log/list returns (UserLoginLogListResponse) // 获取用户第三方登录列表 @handler getUserThirdPartyLoginList post /user/third/party/login/list returns (UserThirdPartyLoginListResponse) // 获取用户存储配置列表 @handler getAllStorageList post /user/storage/config/list returns (AllStorageListResponse) // 获取所有评论列表 @handler getAllCommentList post /comment/list returns (AllCommentListResponse) }