Documentation
¶
Index ¶
- func CommitFileInfoHandler(c *gin.Context)
- func DoFileTransaction(c *gin.Context)
- func DoSignInHandler(c *gin.Context)
- func DoSignupHandler(c *gin.Context)
- func LikeFileHandler(c *gin.Context)
- func ListOwnFileInfoHandler(c *gin.Context)
- func ListPublicFileInfoHandler(c *gin.Context)
- func PublicFileHandler(c *gin.Context)
- func SecretFileDownloadHandler(c *gin.Context)
- func Setup()
- func UploadFileHandler(c *gin.Context)
- func UserAvatarUpdateHandler(c *gin.Context)
- func UserDeleteHandler(c *gin.Context)
- func UserExistsHandler(c *gin.Context)
- func UserGetFile(c *gin.Context)
- func UserInfoHandler(c *gin.Context)
- func UserQueryHandler(c *gin.Context)
- func UserUpdateHandler(c *gin.Context)
- type CommitFileReq
- type LikeFileReq
- type PublicFileReq
- type UploadFileRsp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommitFileInfoHandler ¶
@Title CommitFileInfoHandler @Tags file @Description 提交上传模型文件 @Accept json @Produce json @Param post body token query string true "token" @Param post body uid query int true "用户ID" @Param post body file_name query string true "文件名" @Param post body file_sha1 query string true "文件哈希" @Param post body file_addr query string true "文件下载访问地址" @Param post body img_addr query string true "缩略图下载访问地址" @Param post body fisco_key query string true "区块链密钥" @Success 200 {object} util.RespMsg @router /api/v1/file/commit [Post]
func DoFileTransaction ¶
@Title DoFileTransaction @Tags user @Description 转移接口 @Param token query string true "token" @Param uid query int true "用户名" @Param toUsername query string true "转移的用户名" @Param transferFileId query int true "转移的file id" @Param privateKey query string true "私钥" @Success 200 {object} util.RespMsg @router /api/v1/user/transaction [Post]
func DoSignInHandler ¶
@Title DoSignInHandler @Tags user @Description 登录接口 @Param username query string true "用户名" @Param password query string true "密码" @Success 200 {object} util.RespMsg @router /api/v1/user/signin [Post]
func DoSignupHandler ¶
@Title DoSignupHandler @Tags user @Description 处理用户注册请求 @Param username query string true "用户名" @Param password query string true "密码" @Param inviteCode query string true "邀请码" @Param phone query string true "手机号" @Param avatarUrl query string true "头像地址" @Success 200 {object} util.RespMsg @router /api/v1/user/signup [Post]
func LikeFileHandler ¶
@Title LikeFileHandler @Tags file @Description 模型文件点赞 @Accept json @Produce json @Param post body token query string true "token" @Param post body uid query int true "用户ID" @Param post body file_id query int true "文件ID" @Param post body like_num query int true "点赞数" @Success 200 {object} util.RespMsg @router /api/v1/file/like [Post]
func ListOwnFileInfoHandler ¶
@Title ListOwnFileInfoHandler @Tags file @Description 列出属于自己的模型文件 @Accept json @Produce json @Param uid query int true "用户ID" @Success 200 {object} util.RespMsg @router /api/v1/file/list_own [Get]
func ListPublicFileInfoHandler ¶
@Title ListPublicFileInfoHandler @Tags file @Description 列出属于自己的模型文件 @Accept json @Produce json @Success 200 {object} util.RespMsg @router /api/v1/file/list_public [Get]
func PublicFileHandler ¶
@Title PublicFileHandler @Tags file @Description 分享模型文件(设成公开) @Accept json @Produce json @Param post body token query string true "token" @Param post body uid query int true "用户ID" @Param post body file_id query string true "文件ID" @Success 200 {object} util.RespMsg @router /api/v1/file/public [Post]
func SecretFileDownloadHandler ¶
@Title UserExistsHandler @Tags user @Description 下载公私钥 @Param token query string true "token" @Param username query string true "用户名" @Param secrete_type query int true "类型 1: 公钥, 2: 私钥" @Success 200 {object} util.RespMsg @router /api/v1/user/secret_download [Get]
func UploadFileHandler ¶
@Title UploadFileHandler @Tags file @Description 上传文件接口(上传到obs/ipfs) @Accept json @Produce json @Param model post body model query string true "模型文件" @Param model post body image query string true "缩略图文件" @Success 200 {object} util.RespMsg @router /api/v1/file/upload [Post]
func UserAvatarUpdateHandler ¶
@Title UserAvatarUpdateHandler @Tags user @Description 修改用户头像 @Param token query string true "token" @Param username query string true "用户名" @Param avatarUrl query string true "头像地址" @Success 200 {object} util.RespMsg @router /api/v1/user/avatar [POST]
func UserDeleteHandler ¶
@Title UserUpdateHandler @Tags user @Description 删除用户(需要管理员权限) @Param token query string true "token" @Param username query string true "用户名" @Param deleteUsername query string true "需要删除的用户" @Success 200 {object} util.RespMsg @router /api/v1/user/delete [Post]
func UserExistsHandler ¶
@Title UserExistsHandler @Tags user @Description 查询用户是否存在 @Param username query string true "用户名" @Success 200 {object} util.RespMsg @router /api/v1/user/exists [Get]
func UserGetFile ¶
@Title UserFile @Tags user @Description 获取用户藏品 @Param token query string true "token" @Param uid query int true "uid" @Param fileId query int true "文件id" @Success 200 {object} util.RespMsg @router /api/v1/user/file [GET]
func UserInfoHandler ¶
@Title UserInfoHandler @Tags user @Description 查询用户信息 @Param token query string true "token" @Param username query string true "用户名" @Success 200 {object} util.RespMsg @router /api/v1/user/info [Get]
func UserQueryHandler ¶
@Title UserQueryHandler @Tags user @Description 批量查询的用户信息(需要管理员账号) @Param token query string true "token" @Param username query string true "用户名" @Param offset query string true "偏移量" @Param limit query string true "数量" @Success 200 {object} util.RespMsg @router /api/v1/user/query [Get]
func UserUpdateHandler ¶
@Title UserUpdateHandler @Tags user @Description 修改用户密码 @Param token query string true "token" @Param username query string true "用户名" @Param password query string true "初始密码" @Param newPassword query string true "新密码" @Success 200 {object} util.RespMsg @router /api/v1/user/update [Post]
Types ¶
type CommitFileReq ¶
type CommitFileReq struct { UID int `json:"uid"` FileSHA1 string `json:"file_sha1"` FileName string `json:"file_name"` FileAddr string `json:"file_addr"` ImgAddr string `json:"img_addr"` FiscoKey string `json:"fisco_key"` }
File : 文件提交请求结构体
type LikeFileReq ¶
type PublicFileReq ¶
File : 文件提交请求结构体