import {
	request
} from './request'

export const app = {
	init(inviteCode, channel) {
		return request('/api/app/init', {
			inviteCode,
			channel
		})
	},
	home() {
		return request('/api/app/home', {}, true)
	},
	slideshow(type) {
		return request('/api/app/slideshow', {
			type
		})
	},
	indexList(type) {
		return request('/api/app/indexList', {
			type
		}, true)
	},
	topic(page) {
		return request('/api/app/topic', {
			page
		})
	},
	topicDetails(id) {
		return request('/api/app/topicDetails', {
			id
		})
	},
	actorDetails(id) {
		return request('/api/app/actorDetails', {
			id
		})
	},
	vodClass() {
		return request('/api/app/vodClass', {}, true)
	},
	// type, type_pid, area, year, vodclass, lang, sort, page
	vodList(type, type_pid, sort, vodclass, page) {
		return request('/api/app/vodList', {
			type,
			type_pid,
			// area,
			// year,
			class: vodclass,
			// lang,
			sort,
			page
		})
	},
	hotList(type, sort, page) {
		return request('/api/app/hotList', {
			type,
			sort,
			page
		})
	},
	hotSearch() {
		return request('/api/app/hotSearch')
	},
	hotTopic() {
		return request('/api/app/hotTopic')
	},
	searchList(wd, page) {
		return request('/api/app/searchList', {
			wd,
			page
		})
	},
	vodDetails(id) {
		return request('/api/app/vodDetails', {
			id
		})
	},
	downVod(id) {
		return request('/api/app/downVod', {
			id
		})
	},
	buyVod(id) {
		return request('/api/app/buyVod', {
			id
		})
	},
	updateHits(id, mid) {
		return request('/api/app/updateHits', {
			id,
			mid
		})
	},
	updateDig(id, mid, ac) {
		return request('/api/app/updateDig', {
			id,
			mid,
			ac
		})
	},

	lookVod(id, url) {
		return request('/api/app/lookVod', {
			id,
			url
		})
	},

	favVod(id, status) {
		return request('/api/app/favVod', {
			id,
			status
		})
	},
	vodHistory(ids, limit) {
		return request('/api/app/vodRecord', {
			ids,
			limit
		})
	},
	vodBuyLog(ids, limit) {
		return request('/api/app/vodBuyLog', {
			ids,
			limit
		})
	},
	favHistory(page) {
		return request('/api/app/favHistory', {
			page
		})
	},
	delFav(ids) {
		return request('/api/app/delFav', {
			ids
		})
	},
	noticeList(type, page) {
		return request('/api/app/noticeList', {
			type,
			page
		})
	},
	shareMoney() {
		return request('/api/app/shareMoney')
	},
	advUnlockVod(id, url) {
		return request('/api/app/advUnlockVod', {
			id,
			url
		})
	},
	fullAdv(id) {
		return request('/api/app/fullAdv')
	},
	actorList() {
		return request('/api/app/actorList')
	},
	short() {
		return request('/api/app/short')
	},
	addDanmu(id, color, time, mode, text, timestamp) {
		return request('/api/app/addDanmu', {
			id,
			color,
			time,
			mode,
			text,
			timestamp
		})
	},
	danmu(id) {
		return request('/api/app/danmu', {
			id
		})
	},
	appupdata(version, versionCode, type, appName) {
		return request('/api/app/updata', {
			version,
			versionCode,
			type,
			appName
		})
	},


}

export const user = {
	reg(phone, email, password, code, invite, ac) {
		return request('/api/user/register', {
			phone,
			email,
			password,
			code,
			invite,
			ac
		})
	},
	login(phone, email, password, ac) {
		return request('/api/user/login', {
			phone,
			email,
			password,
			ac
		})
	},
	codeMsg() {
		return request('/api/user/codeMsg')
	},
	info() {
		return request('/api/user/info')
	},
	shareInfo() {
		return request('/api/user/shareInfo')
	},
	change(field, value) {
		return request('/api/user/change', {
			field,
			value
		})
	},
	findPassword(phone, email, code, ac) {
		return request('/api/user/findPassword', {
			phone,
			email,
			code,
			ac
		})
	},

	password(old_pwd, pwd, reset_token) {
		return request('/api/user/password', {
			old_pwd,
			pwd,
			reset_token
		})
	},
	sendMsg(phone, email, type, ac) {
		return request('/api/user/sendMsg', {
			phone,
			email,
			type,
			ac
		})
	},
	shareUser(page) {
		return request('/api/user/shareUser', {
			page
		})
	},
	recharge() {
		return request('/api/user/recharge')
	},
	Bullion() {
		return request('/api/user/rechargeBullion')
	},
	exchange(type) {
		return request('/api/user/exchange', {
			type
		})
	},
	exchangePoints(type, num) {
		return request('/api/user/exchangePoints', {
			type,
			num
		})
	},
	exchangeVip(id) {
		return request('/api/user/exchangeVip', {
			id
		})
	},
	wallet() {
		return request('/api/user/wallet')
	},
	cash(money, name, account) {
		return request('/api/user/cash', {
			money,
			name,
			account
		})
	},
	cashList(page) {
		return request('/api/user/cashList', {
			page
		})
	},
	clogList(page) {
		return request('/api/user/clogList', {
			page
		})
	},
	task(id) {
		return request('/api/user/task', {
			id
		})
	},
	taskList() {
		return request('/api/user/taskList')
	},
	sign() {
		return request('/api/user/sign')
	},
	gbook(type, content, img, id) {
		return request('/api/user/gbook', {
			type,
			content,
			img,
			id
		})
	},
	gbookList(page) {
		return request('/api/user/gbookList', {
			page
		})
	},
	payOrder(id, payid, type) {
		return request('/api/pay/order', {
			id,
			payid,
			type
		})
	},
	orderList(page) {
		return request('/api/user/payOrder', {
			page
		})
	},

}

export const comment = {
	list(id, mid, page, tid) {
		return request('/api/app/commentList', {
			id,
			mid,
			page,
			tid
		})
	},
	add(id, mid, content, tid, pid, uid, timestamp) {
		return request('/api/app/addComment', {
			id,
			mid,
			content,
			tid,
			pid,
			uid,
			timestamp
		})
	}
}