本文整理匯總了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);
}
}