本文整理汇总了Java中net.oschina.app.bean.URLs类的典型用法代码示例。如果您正苦于以下问题:Java URLs类的具体用法?Java URLs怎么用?Java URLs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
URLs类属于net.oschina.app.bean包,在下文中一共展示了URLs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: login
import net.oschina.app.bean.URLs; //导入依赖的package包/类
/**
* 登录, 自动处理cookie
* @param url
* @param username
* @param pwd
* @return
* @throws AppException
*/
public static User login(AppContext appContext, String username, String pwd) throws AppException {
Map<String,Object> params = new HashMap<String,Object>();
params.put("username", username);
params.put("pwd", pwd);
params.put("keep_login", 1);
String loginurl = URLs.LOGIN_VALIDATE_HTTP;
if(appContext.isHttpsLogin()){
loginurl = URLs.LOGIN_VALIDATE_HTTPS;
}
try{
return User.parse(_post(appContext, loginurl, params, null));
}catch(Exception e){
if(e instanceof AppException)
throw (AppException)e;
throw AppException.network(e);
}
}
示例2: updatePortrait
import net.oschina.app.bean.URLs; //导入依赖的package包/类
/**
* 更新用户头像
* @param appContext
* @param uid 当前用户uid
* @param portrait 新上传的头像
* @return
* @throws AppException
*/
public static Result updatePortrait(AppContext appContext, int uid, File portrait) throws AppException {
Map<String,Object> params = new HashMap<String,Object>();
params.put("uid", uid);
Map<String, File> files = new HashMap<String, File>();
files.put("portrait", portrait);
try{
return http_post(appContext, URLs.PORTRAIT_UPDATE, params, files);
}catch(Exception e){
if(e instanceof AppException)
throw (AppException)e;
throw AppException.network(e);
}
}
示例3: information
import net.oschina.app.bean.URLs; //导入依赖的package包/类
/**
* 获取用户信息个人专页(包含该用户的动态信息以及个人信息)
* @param uid 自己的uid
* @param hisuid 被查看用户的uid
* @param hisname 被查看用户的用户名
* @param pageIndex 页面索引
* @param pageSize 每页读取的动态个数
* @return
* @throws AppException
*/
public static UserInformation information(AppContext appContext, int uid, int hisuid, String hisname, int pageIndex, int pageSize) throws AppException {
Map<String,Object> params = new HashMap<String,Object>();
params.put("uid", uid);
params.put("hisuid", hisuid);
params.put("hisname", hisname);
params.put("pageIndex", pageIndex);
params.put("pageSize", pageSize);
try{
return UserInformation.parse(_post(appContext, URLs.USER_INFORMATION, params, null));
}catch(Exception e){
if(e instanceof AppException)
throw (AppException)e;
throw AppException.network(e);
}
}
示例4: getFriendList
import net.oschina.app.bean.URLs; //导入依赖的package包/类
/**
* 用户粉丝、关注人列表
* @param uid
* @param relation 0:显示自己的粉丝 1:显示自己的关注者
* @param pageIndex
* @param pageSize
* @return
* @throws AppException
*/
public static FriendList getFriendList(AppContext appContext, final int uid, final int relation, final int pageIndex, final int pageSize) throws AppException {
String newUrl = _MakeURL(URLs.FRIENDS_LIST, new HashMap<String, Object>(){{
put("uid", uid);
put("relation", relation);
put("pageIndex", pageIndex);
put("pageSize", pageSize);
}});
try{
return FriendList.parse(http_get(appContext, newUrl));
}catch(Exception e){
if(e instanceof AppException)
throw (AppException)e;
throw AppException.network(e);
}
}
示例5: getNewsList
import net.oschina.app.bean.URLs; //导入依赖的package包/类
/**
* 获取资讯列表
* @param url
* @param catalog
* @param pageIndex
* @param pageSize
* @return
* @throws AppException
*/
public static NewsList getNewsList(AppContext appContext, final int catalog, final int pageIndex, final int pageSize) throws AppException {
String newUrl = _MakeURL(URLs.NEWS_LIST, new HashMap<String, Object>(){{
put("catalog", catalog);
put("pageIndex", pageIndex);
put("pageSize", pageSize);
}});
try{
return NewsList.parse(http_get(appContext, newUrl));
}catch(Exception e){
if(e instanceof AppException)
throw (AppException)e;
throw AppException.network(e);
}
}
示例6: getUserBlogList
import net.oschina.app.bean.URLs; //导入依赖的package包/类
/**
* 获取某用户的博客列表
* @param authoruid
* @param uid
* @param pageIndex
* @param pageSize
* @return
* @throws AppException
*/
public static BlogList getUserBlogList(AppContext appContext, final int authoruid, final String authorname, final int uid, final int pageIndex, final int pageSize) throws AppException {
String newUrl = _MakeURL(URLs.USERBLOG_LIST, new HashMap<String, Object>(){{
put("authoruid", authoruid);
put("authorname", URLEncoder.encode(authorname));
put("uid", uid);
put("pageIndex", pageIndex);
put("pageSize", pageSize);
}});
try{
return BlogList.parse(http_get(appContext, newUrl));
}catch(Exception e){
if(e instanceof AppException)
throw (AppException)e;
throw AppException.network(e);
}
}
示例7: getBlogList
import net.oschina.app.bean.URLs; //导入依赖的package包/类
/**
* 获取博客列表
* @param type 推荐:recommend 最新:latest
* @param pageIndex
* @param pageSize
* @return
* @throws AppException
*/
public static BlogList getBlogList(AppContext appContext, final String type, final int pageIndex, final int pageSize) throws AppException {
String newUrl = _MakeURL(URLs.BLOG_LIST, new HashMap<String, Object>(){{
put("type", type);
put("pageIndex", pageIndex);
put("pageSize", pageSize);
}});
try{
return BlogList.parse(http_get(appContext, newUrl));
}catch(Exception e){
if(e instanceof AppException)
throw (AppException)e;
throw AppException.network(e);
}
}
示例8: getPostList
import net.oschina.app.bean.URLs; //导入依赖的package包/类
/**
* 获取帖子列表
* @param url
* @param catalog
* @param pageIndex
* @return
* @throws AppException
*/
public static PostList getPostList(AppContext appContext, final int catalog, final int pageIndex, final int pageSize) throws AppException {
String newUrl = _MakeURL(URLs.POST_LIST, new HashMap<String, Object>(){{
put("catalog", catalog);
put("pageIndex", pageIndex);
put("pageSize", pageSize);
}});
try{
return PostList.parse(http_get(appContext, newUrl));
}catch(Exception e){
if(e instanceof AppException)
throw (AppException)e;
throw AppException.network(e);
}
}
示例9: pubPost
import net.oschina.app.bean.URLs; //导入依赖的package包/类
/**
* 发帖子
* @param post (uid、title、catalog、content、isNoticeMe)
* @return
* @throws AppException
*/
public static Result pubPost(AppContext appContext, Post post) throws AppException {
Map<String,Object> params = new HashMap<String,Object>();
params.put("uid", post.getAuthorId());
params.put("title", post.getTitle());
params.put("catalog", post.getCatalog());
params.put("content", post.getBody());
params.put("isNoticeMe", post.getIsNoticeMe());
try{
return http_post(appContext, URLs.POST_PUB, params, null);
}catch(Exception e){
if(e instanceof AppException)
throw (AppException)e;
throw AppException.network(e);
}
}
示例10: getTweetList
import net.oschina.app.bean.URLs; //导入依赖的package包/类
/**
* 获取动弹列表
* @param uid
* @param pageIndex
* @param pageSize
* @return
* @throws AppException
*/
public static TweetList getTweetList(AppContext appContext, final int uid, final int pageIndex, final int pageSize) throws AppException {
String newUrl = _MakeURL(URLs.TWEET_LIST, new HashMap<String, Object>(){{
put("uid", uid);
put("pageIndex", pageIndex);
put("pageSize", pageSize);
}});
try{
return TweetList.parse(http_get(appContext, newUrl));
}catch(Exception e){
if(e instanceof AppException)
throw (AppException)e;
throw AppException.network(e);
}
}
示例11: pubTweet
import net.oschina.app.bean.URLs; //导入依赖的package包/类
/**
* 发动弹
* @param Tweet-uid & msg & image
* @return
* @throws AppException
*/
public static Result pubTweet(AppContext appContext, Tweet tweet) throws AppException {
Map<String,Object> params = new HashMap<String,Object>();
params.put("uid", tweet.getAuthorId());
params.put("msg", tweet.getBody());
Map<String, File> files = new HashMap<String, File>();
if(tweet.getImageFile() != null)
files.put("img", tweet.getImageFile());
if (tweet.getAmrFile() != null)
files.put("amr", tweet.getAmrFile());
try{
return http_post(appContext, URLs.TWEET_PUB, params, files);
}catch(Exception e){
if(e instanceof AppException)
throw (AppException)e;
throw AppException.network(e);
}
}
示例12: getActiveList
import net.oschina.app.bean.URLs; //导入依赖的package包/类
/**
* 获取动态列表
* @param uid
* @param catalog 1最新动态 [email protected]我 3评论 4我自己
* @param pageIndex
* @param pageSize
* @return
* @throws AppException
*/
public static ActiveList getActiveList(AppContext appContext, final int uid,final int catalog, final int pageIndex, final int pageSize) throws AppException {
String newUrl = _MakeURL(URLs.ACTIVE_LIST, new HashMap<String, Object>(){{
put("uid", uid);
put("catalog", catalog);
put("pageIndex", pageIndex);
put("pageSize", pageSize);
}});
try{
return ActiveList.parse(http_get(appContext, newUrl));
}catch(Exception e){
if(e instanceof AppException)
throw (AppException)e;
throw AppException.network(e);
}
}
示例13: getMessageList
import net.oschina.app.bean.URLs; //导入依赖的package包/类
/**
* 获取留言列表
* @param uid
* @param pageIndex
* @return
* @throws AppException
*/
public static MessageList getMessageList(AppContext appContext, final int uid, final int pageIndex, final int pageSize) throws AppException {
String newUrl = _MakeURL(URLs.MESSAGE_LIST, new HashMap<String, Object>(){{
put("uid", uid);
put("pageIndex", pageIndex);
put("pageSize", pageSize);
}});
try{
return MessageList.parse(http_get(appContext, newUrl));
}catch(Exception e){
if(e instanceof AppException)
throw (AppException)e;
throw AppException.network(e);
}
}
示例14: getBlogCommentList
import net.oschina.app.bean.URLs; //导入依赖的package包/类
/**
* 获取博客评论列表
* @param id 博客id
* @param pageIndex
* @param pageSize
* @return
* @throws AppException
*/
public static BlogCommentList getBlogCommentList(AppContext appContext, final int id, final int pageIndex, final int pageSize) throws AppException {
String newUrl = _MakeURL(URLs.BLOGCOMMENT_LIST, new HashMap<String, Object>(){{
put("id", id);
put("pageIndex", pageIndex);
put("pageSize", pageSize);
}});
try{
return BlogCommentList.parse(http_get(appContext, newUrl));
}catch(Exception e){
if(e instanceof AppException)
throw (AppException)e;
throw AppException.network(e);
}
}
示例15: replyBlogComment
import net.oschina.app.bean.URLs; //导入依赖的package包/类
/**
* 发表博客评论
* @param blog 博客id
* @param uid 登陆用户的uid
* @param content 评论内容
* @param reply_id 评论id
* @param objuid 被评论的评论发表者的uid
* @return
* @throws AppException
*/
public static Result replyBlogComment(AppContext appContext, int blog, int uid, String content, int reply_id, int objuid) throws AppException {
Map<String,Object> params = new HashMap<String,Object>();
params.put("blog", blog);
params.put("uid", uid);
params.put("content", content);
params.put("reply_id", reply_id);
params.put("objuid", objuid);
try{
return http_post(appContext, URLs.BLOGCOMMENT_PUB, params, null);
}catch(Exception e){
if(e instanceof AppException)
throw (AppException)e;
throw AppException.network(e);
}
}