mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-23 15:51:24 +00:00
Pr/avatar (#319)
* feat: add avatar api close #310 * chore: add description line * fix: typo * chore: reformat the json string to make it more readable and fix few bad indents * fix: minimum go version * feat: upload to Micro's CDN * chore: delete redundant blank line * chore: update README.md
This commit is contained in:
30
avatar/proto/avatar.proto
Normal file
30
avatar/proto/avatar.proto
Normal file
@@ -0,0 +1,30 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package avatar;
|
||||
|
||||
option go_package = "./proto;avatar";
|
||||
|
||||
service Avatar {
|
||||
rpc Generate(GenerateRequest) returns (GenerateResponse) {}
|
||||
}
|
||||
|
||||
message GenerateRequest {
|
||||
// avatar's gender, `male` or `female`, default is `male`
|
||||
string gender = 1;
|
||||
// avatar's username, unique username will generates the unique avatar;
|
||||
// if username == "", will generate a random avatar in every request
|
||||
// if upload == true, username will be used as CDN filename rather than a random uuid string
|
||||
string username = 2;
|
||||
// encode format of avatar image, `png` or `jpeg`, default is `jpeg`
|
||||
string format = 3;
|
||||
// if upload to m3o CDN, default is `false`
|
||||
// if update = true, then it'll return the CDN url
|
||||
bool upload = 4;
|
||||
}
|
||||
|
||||
message GenerateResponse {
|
||||
// Micro's CDN url of the avatar image
|
||||
string url = 1;
|
||||
// base64encode string of the avatar image
|
||||
string base64 = 2;
|
||||
}
|
||||
Reference in New Issue
Block a user