mirror of
https://gitee.com/hotlcc/wechat4j.git
synced 2025-06-10 12:34:07 +08:00
[update] 方法命名修改
This commit is contained in:
parent
c8f21dbdc9
commit
81ab8dd81c
@ -1296,7 +1296,7 @@ public class Wechat {
|
||||
* @return 返回数据
|
||||
*/
|
||||
public JSONObject sendImage(String userName, File image) {
|
||||
ContentType contentType = FileUtil.getContentBody(image);
|
||||
ContentType contentType = FileUtil.getContentType(image);
|
||||
byte[] mediaData = FileUtil.getBytes(image);
|
||||
return sendImage(userName, mediaData, image.getName(), contentType);
|
||||
}
|
||||
@ -1336,7 +1336,7 @@ public class Wechat {
|
||||
* @return 返回数据
|
||||
*/
|
||||
public JSONObject sendImageToNickName(String nickName, File image) {
|
||||
ContentType contentType = FileUtil.getContentBody(image);
|
||||
ContentType contentType = FileUtil.getContentType(image);
|
||||
byte[] mediaData = FileUtil.getBytes(image);
|
||||
return sendImageToNickName(nickName, mediaData, image.getName(), contentType);
|
||||
}
|
||||
@ -1376,7 +1376,7 @@ public class Wechat {
|
||||
* @return 返回数据
|
||||
*/
|
||||
public JSONObject sendImageToRemarkName(String remarkName, File image) {
|
||||
ContentType contentType = FileUtil.getContentBody(image);
|
||||
ContentType contentType = FileUtil.getContentType(image);
|
||||
byte[] mediaData = FileUtil.getBytes(image);
|
||||
return sendImageToRemarkName(remarkName, mediaData, image.getName(), contentType);
|
||||
}
|
||||
@ -1427,7 +1427,7 @@ public class Wechat {
|
||||
* @return 返回数据
|
||||
*/
|
||||
public JSONObject sendImage(String userName, String nickName, String remarkName, File image) {
|
||||
ContentType contentType = FileUtil.getContentBody(image);
|
||||
ContentType contentType = FileUtil.getContentType(image);
|
||||
byte[] mediaData = FileUtil.getBytes(image);
|
||||
return sendImage(userName, nickName, remarkName, mediaData, image.getName(), contentType);
|
||||
}
|
||||
@ -1489,7 +1489,7 @@ public class Wechat {
|
||||
* @return 返回数据
|
||||
*/
|
||||
public JSONObject sendVideo(String userName, File video) {
|
||||
ContentType contentType = FileUtil.getContentBody(video);
|
||||
ContentType contentType = FileUtil.getContentType(video);
|
||||
byte[] mediaData = FileUtil.getBytes(video);
|
||||
return sendVideo(userName, mediaData, video.getName(), contentType);
|
||||
}
|
||||
@ -1529,7 +1529,7 @@ public class Wechat {
|
||||
* @return 返回数据
|
||||
*/
|
||||
public JSONObject sendVideoToNickName(String nickName, File video) {
|
||||
ContentType contentType = FileUtil.getContentBody(video);
|
||||
ContentType contentType = FileUtil.getContentType(video);
|
||||
byte[] mediaData = FileUtil.getBytes(video);
|
||||
return sendVideoToNickName(nickName, mediaData, video.getName(), contentType);
|
||||
}
|
||||
@ -1569,7 +1569,7 @@ public class Wechat {
|
||||
* @return 返回数据
|
||||
*/
|
||||
public JSONObject sendVideoToRemarkName(String remarkName, File video) {
|
||||
ContentType contentType = FileUtil.getContentBody(video);
|
||||
ContentType contentType = FileUtil.getContentType(video);
|
||||
byte[] mediaData = FileUtil.getBytes(video);
|
||||
return sendVideoToRemarkName(remarkName, mediaData, video.getName(), contentType);
|
||||
}
|
||||
@ -1619,7 +1619,7 @@ public class Wechat {
|
||||
* @return 返回数据
|
||||
*/
|
||||
public JSONObject sendVideo(String userName, String nickName, String remarkName, File video) {
|
||||
ContentType contentType = FileUtil.getContentBody(video);
|
||||
ContentType contentType = FileUtil.getContentType(video);
|
||||
byte[] mediaData = FileUtil.getBytes(video);
|
||||
return sendVideo(userName, nickName, remarkName, mediaData, video.getName(), contentType);
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ public final class FileUtil {
|
||||
* @param file 文件
|
||||
* @return ContentType
|
||||
*/
|
||||
public static ContentType getContentBody(File file) {
|
||||
public static ContentType getContentType(File file) {
|
||||
String mimeType = new MimetypesFileTypeMap().getContentType(file);
|
||||
ContentType contentType = ContentType.parse(mimeType);
|
||||
return contentType;
|
||||
|
Loading…
x
Reference in New Issue
Block a user