小编maa*_*cls的帖子

我应该使用GridFS或二进制数据来存储和检索MongoDB中的图像吗?

我想知道哪个更好/更快:

  1. 拥有一个单独的文档集合,其中只包含保存为二进制数据的图像,可能还包含一些元数据.
  2. 或使用GridFS存储图像.

mongodb gridfs

13
推荐指数
1
解决办法
9329
查看次数

zsh主题为完整路径+显示git更改

我正在寻找主题来显示完整路径+ git(分支名称+未提交的更改+添加的文件).没找到任何.这样的事情:

/full/path/to/repo (master *+)
Run Code Online (Sandbox Code Playgroud)

我会喜欢推荐一个/如何编辑现有的建议(我目前正在使用哥斯拉).

git zsh zshrc oh-my-zsh

13
推荐指数
4
解决办法
2万
查看次数

使用Retrofit2在POST请求中发送JSON

我正在使用Retrofit来集成我的Web服务,我不明白如何使用POST请求将JSON对象发送到服务器.我目前卡住了,这是我的代码:

活动:-

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);


    Retrofit retrofit = new Retrofit.Builder().baseUrl(url).
            addConverterFactory(GsonConverterFactory.create()).build();

    PostInterface service = retrofit.create(PostInterface.class);

    JSONObject jsonObject = new JSONObject();
    try {
        jsonObject.put("email", "device3@gmail.com");
        jsonObject.put("password", "1234");
    } catch (JSONException e) {
        e.printStackTrace();
    }
    final String result = jsonObject.toString();

}
Run Code Online (Sandbox Code Playgroud)

PostInterface: -

public interface PostInterface {

    @POST("User/DoctorLogin")
    Call<String> getStringScalar(@Body String body);
}
Run Code Online (Sandbox Code Playgroud)

请求JSON: -

{
"email":"device3@gmail.com",
"password":"1234"
}
Run Code Online (Sandbox Code Playgroud)

响应JSON: -

{
  "error": false,
  "message": "User Login Successfully",
  "doctorid": 42,
  "active": true
}
Run Code Online (Sandbox Code Playgroud)

android json retrofit2

9
推荐指数
2
解决办法
3万
查看次数

标签 统计

android ×1

git ×1

gridfs ×1

json ×1

mongodb ×1

oh-my-zsh ×1

retrofit2 ×1

zsh ×1

zshrc ×1