parent
560fcbca3e
commit
aab5dbf6ab
@ -0,0 +1,107 @@
|
||||
package com.ruoyi.pt.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.pt.entity.RemoteLog;
|
||||
import com.ruoyi.pt.service.RemoteLogService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 算法日志表(RemoteLog)表控制层
|
||||
*
|
||||
* @author wu
|
||||
* @since 2024-02-22 09:56:40
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("pt/remoteLog")
|
||||
@Api(tags = "算法日志表")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class RemoteLogController extends BaseController {
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Resource
|
||||
private RemoteLogService remoteLogService;
|
||||
|
||||
/**
|
||||
* 分页条件查询所有数据
|
||||
*
|
||||
* @param page 分页条件
|
||||
* @param remoteLog 查询条件
|
||||
* @return 所有数据
|
||||
*/
|
||||
@GetMapping
|
||||
@ApiOperation(value = "分页条件查询算法日志表", response = RemoteLog.class)
|
||||
public AjaxResult page(Page<RemoteLog> page, RemoteLog remoteLog) {
|
||||
QueryWrapper<RemoteLog> wrapper = new QueryWrapper<>(remoteLog);
|
||||
wrapper.orderByDesc("running_time");
|
||||
return success(remoteLogService.page(page, wrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 单条数据
|
||||
*/
|
||||
@GetMapping("{id}")
|
||||
@ApiOperation(value = "通过主键查询单条算法日志表", response = RemoteLog.class)
|
||||
public AjaxResult getById(@PathVariable Serializable id) {
|
||||
return success(remoteLogService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param remoteLog 实体对象
|
||||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping
|
||||
@ApiOperation(value = "新增算法日志表", response = RemoteLog.class)
|
||||
public AjaxResult insert(@RequestBody RemoteLog remoteLog) {
|
||||
return success(remoteLogService.save(remoteLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param remoteLog 实体对象
|
||||
* @return 修改结果
|
||||
*/
|
||||
@PutMapping
|
||||
@ApiOperation(value = "修改算法日志表")
|
||||
public AjaxResult update(@RequestBody RemoteLog remoteLog) {
|
||||
return success(remoteLogService.updateById(remoteLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*
|
||||
* @param idList 主键集合
|
||||
* @return 删除结果
|
||||
*/
|
||||
@DeleteMapping
|
||||
@ApiOperation(value = "删除算法日志表")
|
||||
public AjaxResult delete(@RequestParam("idList") List<Long> idList) {
|
||||
return success(remoteLogService.removeByIds(idList));
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,56 @@
|
||||
package com.ruoyi.pt.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
/**
|
||||
* 算法日志表(RemoteLog)表实体类
|
||||
*
|
||||
* @author wu
|
||||
* @since 2024-02-22 09:56:41
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("算法日志表实体类")
|
||||
@TableName(value = "remote_log")
|
||||
public class RemoteLog implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 254874897853314465L;
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ApiModelProperty(value = "主键id")
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 算法运行时间
|
||||
*/
|
||||
@ApiModelProperty(value = "算法运行时间")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime runningTime;
|
||||
|
||||
/**
|
||||
* 获取事件条数
|
||||
*/
|
||||
@ApiModelProperty(value = "获取事件条数")
|
||||
private Integer hqTotal;
|
||||
|
||||
/**
|
||||
* 推送驾驶舱条数
|
||||
*/
|
||||
@ApiModelProperty(value = "推送驾驶舱条数")
|
||||
private Integer tsTotal;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,15 @@
|
||||
package com.ruoyi.pt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.pt.entity.RemoteLog;
|
||||
|
||||
/**
|
||||
* 算法日志表(RemoteLog)表数据库访问层
|
||||
*
|
||||
* @author wu
|
||||
* @since 2024-02-22 09:56:41
|
||||
*/
|
||||
public interface RemoteLogMapper extends BaseMapper<RemoteLog> {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,15 @@
|
||||
package com.ruoyi.pt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.pt.entity.RemoteLog;
|
||||
|
||||
/**
|
||||
* 算法日志表(RemoteLog)表服务接口
|
||||
*
|
||||
* @author wu
|
||||
* @since 2024-02-22 09:56:41
|
||||
*/
|
||||
public interface RemoteLogService extends IService<RemoteLog> {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,19 @@
|
||||
package com.ruoyi.pt.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.pt.mapper.RemoteLogMapper;
|
||||
import com.ruoyi.pt.entity.RemoteLog;
|
||||
import com.ruoyi.pt.service.RemoteLogService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 算法日志表(RemoteLog)表服务实现类
|
||||
*
|
||||
* @author wu
|
||||
* @since 2024-02-22 09:56:41
|
||||
*/
|
||||
@Service("remoteLogService")
|
||||
public class RemoteLogServiceImpl extends ServiceImpl<RemoteLogMapper, RemoteLog> implements RemoteLogService {
|
||||
|
||||
}
|
||||
|
Loading…
Reference in new issue