handler

package
v0.0.0-...-0e219ad Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommitFileInfoHandler

func CommitFileInfoHandler(c *gin.Context)

@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

func DoFileTransaction(c *gin.Context)

@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

func DoSignInHandler(c *gin.Context)

@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

func DoSignupHandler(c *gin.Context)

@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

func LikeFileHandler(c *gin.Context)

@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

func ListOwnFileInfoHandler(c *gin.Context)

@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

func ListPublicFileInfoHandler(c *gin.Context)

@Title ListPublicFileInfoHandler @Tags file @Description 列出属于自己的模型文件 @Accept json @Produce json @Success 200 {object} util.RespMsg @router /api/v1/file/list_public [Get]

func PublicFileHandler

func PublicFileHandler(c *gin.Context)

@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

func SecretFileDownloadHandler(c *gin.Context)

@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 Setup

func Setup()

func UploadFileHandler

func UploadFileHandler(c *gin.Context)

@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

func UserAvatarUpdateHandler(c *gin.Context)

@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

func UserDeleteHandler(c *gin.Context)

@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

func UserExistsHandler(c *gin.Context)

@Title UserExistsHandler @Tags user @Description 查询用户是否存在 @Param username query string true "用户名" @Success 200 {object} util.RespMsg @router /api/v1/user/exists [Get]

func UserGetFile

func UserGetFile(c *gin.Context)

@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

func UserInfoHandler(c *gin.Context)

@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

func UserQueryHandler(c *gin.Context)

@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

func UserUpdateHandler(c *gin.Context)

@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 LikeFileReq struct {
	UID     int `json:"uid"`
	FileID  int `json:"file_id"`
	LikeNum int `json:"like_num"`
}

type PublicFileReq

type PublicFileReq struct {
	UID    int `json:"uid"`
	FileID int `json:"file_id"`
}

File : 文件提交请求结构体

type UploadFileRsp

type UploadFileRsp struct {
	FileSHA1 string `json:"file_sha1,omitempty"`
	FileAddr string `json:"file_addr"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL