// 逻辑接口-基站参数
// 秒寻科技
// zt 2024-03-19

package bparamlogic

import (
	"ipsomc/module/bparam/bparamapi"
	"ipsomc/module/bparam/bparammodel"
)

type BparamLgc struct {
	bparamApi bparamapi.BparamApi
	//psAdaptAPi psadapt.PsAdapt
}

// GUI本地网管上传基站参数到服务器
func (obj *BparamLgc) UploadBparamLgc(dataModel *bparammodel.BtsBaseParam, dataMap map[string]interface{}) error {
	//基于ProjectID获得公司ID
	companyId, err := obj.bparamApi.GuiGetCompanyIdByProjectId(dataModel)
	if err != nil {
		return err
	}
	dataModel.CompanyID = companyId

	//查询记录ID
	if err := obj.bparamApi.GetRecordIdByProjectIdAndBtsId(dataModel); err != nil {
		return err
	}

	//修改记录
	if err := obj.bparamApi.UpdateBtsBaseParam(dataModel, dataMap); err != nil {
		return err
	}

	return nil
}

// // 查询基站设备参数
// func (obj *BparamLgc) GetOamDeviceParamByBtsIdLgc(dataModel *bparammodel.BtsDeviceParam) error {
// 	//将数据发送给协议栈适配层，以便查询基站数据
// 	if err := obj.psAdaptAPi.PsAdaptQueryOamDeviceParam(dataModel); err != nil {
// 		return err
// 	}

// 	return nil
// }
