import request from '@/utils/request.js';

export const deviceApi = {
	getCards(identifier) {
		return request({
			url: '/api/c/v1/device/cards',
			method: 'GET',
			data: { identifier }
		});
	},

	factoryReset(identifier) {
		return request({
			url: '/api/c/v1/device/factory-reset',
			method: 'POST',
			data: { identifier }
		});
	},

	reboot(identifier) {
		return request({
			url: '/api/c/v1/device/reboot',
			method: 'POST',
			data: { identifier }
		});
	},

	switchCard(identifier, target_iccid) {
		return request({
			url: '/api/c/v1/device/switch-card',
			method: 'POST',
			data: { identifier, target_iccid }
		});
	},

	setWifi(identifier, ssid, password, enabled = true) {
		return request({
			url: '/api/c/v1/device/wifi',
			method: 'POST',
			data: { identifier, ssid, password, enabled }
		});
	}
};