|
- syntax = "proto3";
-
- package adminserver.api.v1;
-
- option go_package = "server/admin-server/api/v1;v1";
-
-
-
- import "google/api/annotations.proto";
- import "validate/validate.proto";
-
- service Model {
- // 查询预置模型列表
- rpc ListPreModel (ListPreModelRequest) returns (ListPreModelReply) {
- option (google.api.http) = {
- get: "/v1/modelmanage/premodel"
- };
- };
- // 查询用户模型列表
- rpc ListUserModel (ListUserModelRequest) returns (ListUserModelReply) {
- option (google.api.http) = {
- get: "/v1/modelmanage/usermodel"
- };
- };
- // 查询模型版本列表
- rpc ListModelVersion (ListModelVersionRequest) returns (ListModelVersionReply) {
- option (google.api.http) = {
- get: "/v1/modelmanage/model/{modelId}"
- };
- };
- // 新增预置模型版本
- rpc AddPreModelVersion (AddPreModelVersionRequest) returns (AddPreModelVersionReply) {
- option (google.api.http) = {
- post: "/v1/modelmanage/premodel/{modelId}"
- body: "*"
- };
- };
- // 新增预置模型
- rpc AddPreModel (AddPreModelRequest) returns (AddPreModelReply) {
- option (google.api.http) = {
- post: "/v1/modelmanage/premodel"
- body: "*"
- };
- };
- // 上传预置模型版本
- rpc UploadPreModelVersion (UploadPreModelVersionRequest) returns (UploadPreModelVersionReply) {
- option (google.api.http) = {
- post: "/v1/modelmanage/premodel/{modelId}/version/{version}/upload"
- body: "*"
- };
- };
- // 上传预置模型版本确认
- rpc ConfirmUploadPreModelVersion (ConfirmUploadPreModelVersionRequest) returns (ConfirmUploadPreModelVersionReply) {
- option (google.api.http) = {
- put: "/v1/modelmanage/premodel/{modelId}/version/{version}/uploadconfirm"
- body: "*"
- };
- };
- // 删除预置模型版本
- rpc DeletePreModelVersion (DeletePreModelVersionRequest) returns (DeletePreModelVersionReply) {
- option (google.api.http) = {
- delete: "/v1/modelmanage/premodel/{modelId}/version/{version}"
- };
- };
- // 删除预置模型
- rpc DeletePreModel (DeletePreModelRequest) returns (DeletePreModelReply) {
- option (google.api.http) = {
- delete: "/v1/modelmanage/premodel/{modelId}"
- };
- };
- // 下载模型版本
- rpc DownloadModelVersion (DownloadModelVersionRequest) returns (DownloadModelVersionReply) {
- option (google.api.http) = {
- get: "/v1/modelmanage/model/{modelId}/version/{version}/download"
- };
- };
- // 模型版本预览
- rpc ListModelVersionFile (ListModelVersionFileRequest) returns (ListModelVersionFileReply) {
- option (google.api.http) = {
- get: "/v1/modelmanage/model/{modelId}/version/{version}/file"
- };
- };
- }
-
- message ModelDetail {
- // 模型id
- string modelId = 1;
- // 空间名称
- string spaceName = 2;
- // 空间id
- string spaceId = 3;
- // 用户名称
- string userName = 4;
- // 算法名称
- string algorithmName = 5;
- // 算法版本
- string algorithmVersion = 6;
- // 模型名称
- string modelName = 7;
- // 模型描述
- string modelDescript = 8;
- // 模型最新版本
- string latestVersion = 9;
- // 模型创建时间(时间戳)
- int64 createdAt = 10;
- // 用户邮箱
- string userEmail = 11;
- // 用户id
- string userId = 12;
- }
-
- message VersionDetail {
- // 模型id
- string modelId = 1;
- // 模型版本
- string version = 2;
- // 模型版本描述
- string descript = 3;
- // 模型版本文件状态,0:初始态,1:文件上传中,2:文件已上传,3:文件上传失败
- int32 fileStatus = 4;
- // 模型版本创建时间(时间戳)
- int64 createdAt = 5;
- }
-
- message ListPreModelRequest {
- // 页码,从1开始
- int64 pageIndex = 1[(validate.rules).int64 = {gte:1}];
- // 页大小,最小1条,最大100条
- int64 pageSize = 2[(validate.rules).int64 = {gte:1,lte:100}];
- // 模糊搜索字段,最大512个字符,非必填
- string searchKey = 3[(validate.rules).string = {max_len:512}];
- int64 createdAtGte = 4;
- int64 createdAtLt = 5;
- }
- message ListPreModelReply {
- // 符合条件的总条数
- int64 totalSize = 1;
- // 模型详情列表
- repeated ModelDetail models = 2;
- }
-
- message ListUserModelRequest {
- // 页码,从1开始
- int64 pageIndex = 1[(validate.rules).int64 = {gte:1}];
- // 页大小,最小1条,最大100条
- int64 pageSize = 2[(validate.rules).int64 = {gte:1,lte:100}];
- // 模糊搜索字段,最大512个字符,非必填
- string searchKey = 3[(validate.rules).string = {max_len:512}];
- string userId = 4[(validate.rules).string = {max_len: 36}];
- string spaceId = 5[(validate.rules).string = {max_len: 36}];
- int64 createdAtGte = 6;
- int64 createdAtLt = 7;
- }
- message ListUserModelReply {
- // 符合条件的总条数
- int64 totalSize = 1;
- // 模型详情列表
- repeated ModelDetail models = 2;
- }
-
- message ListModelVersionRequest {
- // 模型id
- string modelId = 1[(validate.rules).string = {min_len:1,max_len:32,pattern:"^[A-Za-z0-9]+$"}];
- // 页码,从1开始
- int64 pageIndex = 2[(validate.rules).int64 = {gte:1}];
- // 页大小,最小1条,最大100条
- int64 pageSize = 3[(validate.rules).int64 = {gte:1,lte:100}];
- }
- message ListModelVersionReply {
- // 符合条件的总条数
- int64 totalSize = 1;
- // 模型版本详情列表
- repeated VersionDetail modelVersions = 2;
- }
-
- message AddPreModelVersionRequest {
- // 模型id
- string modelId = 1[(validate.rules).string = {min_len:1,max_len:32,pattern:"^[A-Za-z0-9]+$"}];
- // 模型版本描述,最大128个字符,非必填
- string descript = 2[(validate.rules).string = {max_len:128}];
- }
- message AddPreModelVersionReply {
- // 模型id
- string modelId = 1;
- // 模型版本
- string version = 2;
- // 模型版本创建时间(时间戳)
- int64 createdAt = 3;
- }
-
- message AddPreModelRequest {
- // 模型描述,最大128个字符
- string modelDescript = 1[(validate.rules).string = {max_len:128}];
- // 算法id
- string algorithmId = 2[(validate.rules).string = {min_len:1,max_len:32,pattern:"^[A-Za-z0-9]+$"}];
- // 算法版本
- string algorithmVersion = 3[(validate.rules).string = {min_len:2,pattern:"^V[0-9]+$"}];
- }
- message AddPreModelReply {
- // 模型id
- string modelId = 1;
- // 模型版本
- string version = 2;
- // 模型创建时间(时间戳)
- int64 createdAt = 3;
- }
-
- message UploadPreModelVersionRequest {
- // 模型id
- string modelId = 1[(validate.rules).string = {min_len:1,max_len:32,pattern:"^[A-Za-z0-9]+$"}];
- // 模型版本
- string version = 2[(validate.rules).string = {min_len:2,pattern:"^V[0-9]+$"}];
- // 模型文件,必须是以“.zip”结尾的压缩包
- string fileName = 3[(validate.rules).string = {min_len:3,pattern:".*\\.zip+$"}];
- // 域名,必须http或https开头,满足url的格式
- string domain = 4[(validate.rules).string = {min_len: 1,pattern:"(https?)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]"}];
- }
- message UploadPreModelVersionReply {
- // 模型版本上传链接
- string uploadUrl = 1;
- }
-
- message ConfirmUploadPreModelVersionRequest {
- // 模型id
- string modelId = 1[(validate.rules).string = {min_len:1,max_len:32,pattern:"^[A-Za-z0-9]+$"}];
- // 模型版本
- string version = 2[(validate.rules).string = {min_len:2,pattern:"^V[0-9]+$"}];
- // 模型文件,必须是以“.zip”结尾的压缩包
- string fileName = 3[(validate.rules).string = {min_len:3,pattern:".*\\.zip+$"}];
- }
- message ConfirmUploadPreModelVersionReply {
- // 上传确认时间(时间戳)
- int64 updatedAt = 1;
- }
-
- message DeletePreModelVersionRequest {
- // 模型id
- string modelId = 1[(validate.rules).string = {min_len:1,max_len:32,pattern:"^[A-Za-z0-9]+$"}];
- // 模型版本
- string version = 2[(validate.rules).string = {min_len:2,pattern:"^V[0-9]+$"}];
- }
- message DeletePreModelVersionReply {
- // 模型版本删除时间(时间戳)
- int64 deletedAt = 1;
- }
-
- message DeletePreModelRequest {
- // 模型id
- string modelId = 1[(validate.rules).string = {min_len:1,max_len:32,pattern:"^[A-Za-z0-9]+$"}];
- }
- message DeletePreModelReply {
- // 模型删除时间(时间戳)
- int64 deletedAt = 1;
- }
-
- message DownloadModelVersionRequest {
- // 模型id
- string modelId = 1[(validate.rules).string = {min_len:1,max_len:32,pattern:"^[A-Za-z0-9]+$"}];
- // 模型版本
- string version = 2[(validate.rules).string = {min_len:2,pattern:"^V[0-9]+$"}];
- // 域名,必须http或https开头,满足url的格式
- string domain = 3[(validate.rules).string = {min_len: 1,pattern:"(https?)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]"}];
- }
- message DownloadModelVersionReply {
- // 模型版本下载链接
- string downloadUrl = 1;
- }
-
- message ListModelVersionFileRequest {
- // 模型id
- string modelId = 1[(validate.rules).string = {min_len:1,max_len:32,pattern:"^[A-Za-z0-9]+$"}];
- // 模型版本
- string version = 2[(validate.rules).string = {min_len:2,pattern:"^V[0-9]+$"}];
- // 查询前缀,非必填
- string prefix = 3;
- }
- message ModelInfo {
- // 文件名称
- string name = 1;
- // 文件修改时间(时间戳)
- int64 lastModified = 2;
- // 文件大小,单位字节
- int64 size = 3;
- // 文件类型
- string contentType = 4;
- }
- message ListModelVersionFileReply {
- // 文件信息列表
- repeated ModelInfo modelInfoList = 1;
- }
|