57 lines
2.1 KiB
Java
57 lines
2.1 KiB
Java
|
|
package com.unisinsight.project.controller;
|
||
|
|
|
||
|
|
import cn.hutool.json.JSONUtil;
|
||
|
|
import com.unisinsight.project.entity.req.DeviceImageMappingReq;
|
||
|
|
import com.unisinsight.project.entity.res.DeviceImageMappingRes;
|
||
|
|
import com.unisinsight.project.exception.BaseErrorCode;
|
||
|
|
import com.unisinsight.project.exception.Result;
|
||
|
|
import com.unisinsight.project.service.DeviceImageMappingService;
|
||
|
|
import io.swagger.annotations.Api;
|
||
|
|
import io.swagger.annotations.ApiOperation;
|
||
|
|
import lombok.extern.slf4j.Slf4j;
|
||
|
|
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 java.util.List;
|
||
|
|
import java.util.Objects;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @description:
|
||
|
|
* @author: rdpnr_puzhi
|
||
|
|
* @create: 2025/08/07
|
||
|
|
*/
|
||
|
|
@Slf4j
|
||
|
|
@RestController
|
||
|
|
@RequestMapping("/api/nex/v1/device/image/mapping")
|
||
|
|
@Api(tags = "终端镜像映射关系Controller")
|
||
|
|
public class DeviceImageMappingController {
|
||
|
|
|
||
|
|
@Resource
|
||
|
|
private DeviceImageMappingService deviceImageMappingService;
|
||
|
|
|
||
|
|
@ApiOperation(value = "终端镜像映射新增")
|
||
|
|
@PostMapping("/add")
|
||
|
|
public Result<?> insert(@RequestBody DeviceImageMappingReq deviceImageMappingReq) {
|
||
|
|
if (Objects.isNull(deviceImageMappingReq)) {
|
||
|
|
return Result.errorResult(BaseErrorCode.PARAMS_CHK_ERROR);
|
||
|
|
}
|
||
|
|
log.info("终端镜像映射新增请求参数为:{}", JSONUtil.toJsonStr(deviceImageMappingReq));
|
||
|
|
return deviceImageMappingService.insert(deviceImageMappingReq);
|
||
|
|
}
|
||
|
|
|
||
|
|
@ApiOperation(value = "终端镜像映射查询")
|
||
|
|
@PostMapping("/select")
|
||
|
|
public Result<List<DeviceImageMappingRes>> select(@RequestBody DeviceImageMappingReq deviceImageMappingReq) {
|
||
|
|
if (Objects.isNull(deviceImageMappingReq)) {
|
||
|
|
return Result.errorResult(BaseErrorCode.PARAMS_CHK_ERROR);
|
||
|
|
}
|
||
|
|
log.info("终端镜像映射查询请求参数为:{}", JSONUtil.toJsonStr(deviceImageMappingReq));
|
||
|
|
return deviceImageMappingService.select(deviceImageMappingReq);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|