package com.yida.data.user.controller;

import com.yida.data.common.core.annotation.ControllerLog;
import com.yida.data.common.core.common.ModuleName;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.system.enums.OperationLogTypeEnum;
import com.yida.data.common.core.entity.user.EduUserDevice;
import com.yida.data.log.annotation.OperationLog;
import com.yida.data.user.service.EduUserDeviceService;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api(tags = "用户设备底图信息")
@RestController
@RequestMapping("/userDevice")
public class EduUserDeviceController {
    @Resource
    private EduUserDeviceService eduUserDeviceService;

    @ApiOperation("保存、更新用户设备联系信息")
    @PostMapping("/saveUserDevice")
    @OperationLog(module = ModuleName.USER, methods = "保存、更新用户和厂商的关联信息", type = OperationLogTypeEnum.SAVE)
    public ResultBean saveUserDevice(@RequestBody EduUserDevice userDevice) {
        eduUserDeviceService.saveUserDevice(userDevice);
        return ResultBean.buildSuccess();
    }

}
