You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

28 lines
553 B

package api
import (
"github.com/OhYee/blotter/api/pkg/avatar"
"github.com/OhYee/blotter/register"
)
// AvatarRequest request of avatar api
type AvatarRequest struct {
Email string `json:"email"`
}
// AvatarResponse response of avatar api
type AvatarResponse struct {
Avatar string `json:"avatar"`
}
// Avatar get avatar of emial
func Avatar(context register.HandleContext) (err error) {
args := new(AvatarRequest)
res := new(AvatarResponse)
context.RequestArgs(args)
res.Avatar = avatar.Get(args.Email)
context.ReturnJSON(res)
return
}