75 lines
3.2 KiB
Dart
75 lines
3.2 KiB
Dart
/// 接口路径常量(《03-接口文档》第 2~10 章)
|
|
/// 统一响应已由 ApiClient 解包,各 Service 只关心 data。
|
|
class Endpoints {
|
|
Endpoints._();
|
|
|
|
// ---------- 认证 ----------
|
|
static const smsSend = '/auth/sms/send';
|
|
static const emailSend = '/auth/email/send';
|
|
static const register = '/auth/register';
|
|
static const login = '/auth/login';
|
|
static const tokenRefresh = '/auth/token/refresh';
|
|
static const logout = '/auth/logout';
|
|
static const passwordReset = '/auth/password/reset';
|
|
|
|
// ---------- 用户 ----------
|
|
static const me = '/users/me';
|
|
static const meAvatar = '/users/me/avatar';
|
|
static const meWallet = '/users/me/wallet';
|
|
static const mePointsRecords = '/users/me/points/records';
|
|
static const meDeactivate = '/users/me/deactivate';
|
|
static String userDetail(int userId) => '/users/$userId';
|
|
static String userVideos(int userId) => '/users/$userId/videos';
|
|
static const meVideos = '/users/me/videos';
|
|
static const meFavorites = '/users/me/favorites';
|
|
static const meHistory = '/users/me/history';
|
|
|
|
// ---------- 视频 ----------
|
|
static const feed = '/videos/feed';
|
|
static const categories = '/videos/categories';
|
|
static const uploadToken = '/videos/upload/token';
|
|
static const uploadFile = '/videos/upload/file';
|
|
static const publish = '/videos';
|
|
static const search = '/videos/search';
|
|
static const hotSearch = '/search/hot';
|
|
static String videoDetail(int videoId) => '/videos/$videoId';
|
|
static String videoWatch(int videoId) => '/videos/$videoId/watch';
|
|
static String videoWatchComplete(int videoId) => '/videos/$videoId/watch/complete';
|
|
static String videoLike(int videoId) => '/videos/$videoId/like';
|
|
static String videoFavorite(int videoId) => '/videos/$videoId/favorite';
|
|
static String videoComments(int videoId) => '/videos/$videoId/comments';
|
|
static String videoEdit(int videoId) => '/videos/$videoId';
|
|
static String videoDelete(int videoId) => '/videos/$videoId';
|
|
static String tagVideos(String tagName) => '/tags/$tagName/videos';
|
|
|
|
// ---------- 互动 ----------
|
|
static String commentDelete(int commentId) => '/comments/$commentId';
|
|
|
|
// ---------- 会员 ----------
|
|
static const membershipPlans = '/membership/plans';
|
|
static const membershipMe = '/membership/me';
|
|
static const membershipRedeem = '/membership/redeem';
|
|
|
|
// ---------- 支付 ----------
|
|
static const payPackages = '/payments/packages';
|
|
static const recharge = '/payments/recharge';
|
|
static String orderDetail(String orderNo) => '/payments/orders/$orderNo';
|
|
static String orderCancel(String orderNo) => '/payments/orders/$orderNo/cancel';
|
|
|
|
// ---------- 激励 / 推广归因 ----------
|
|
static const referralMe = '/referral/me';
|
|
static const referralBind = '/referral/bind';
|
|
static const inviteMatch = '/invite/match';
|
|
static const assetsMe = '/assets/me';
|
|
static const assetsRecords = '/assets/records';
|
|
static const assetsWithdraw = '/assets/withdraw';
|
|
static const withdrawRecords = '/assets/withdraw/records';
|
|
|
|
// ---------- 通用 ----------
|
|
static const appVersion = '/app/version';
|
|
static const notifications = '/notifications';
|
|
static const notificationsUnread = '/notifications/unread_count';
|
|
static const notificationsRead = '/notifications/read';
|
|
static const report = '/reports';
|
|
}
|