新增pc端版本配置
parent
1a63064cf9
commit
f8a0749cb0
|
@ -0,0 +1,73 @@
|
||||||
|
package com.mcwl.web.controller.resource;
|
||||||
|
|
||||||
|
import com.mcwl.common.constant.HttpStatus;
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.resource.domain.PcVersion;
|
||||||
|
import com.mcwl.resource.service.impl.PcVersionServiceImpl;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pc端版本
|
||||||
|
*
|
||||||
|
* @author DaiZibo
|
||||||
|
* @date 2025/5/9
|
||||||
|
* @apiNote
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Api(tags = "pc端版本")
|
||||||
|
@RequestMapping("/version")
|
||||||
|
@RestController
|
||||||
|
public class PcVersionController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PcVersionServiceImpl pcVersionService;
|
||||||
|
|
||||||
|
@ApiOperation(value = "查看pc版本列表")
|
||||||
|
@PostMapping("/list")
|
||||||
|
public R<List<PcVersion>> selectList(){
|
||||||
|
|
||||||
|
List<PcVersion> pcVersionList = pcVersionService.selectList();
|
||||||
|
return R.ok(pcVersionList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改版本")
|
||||||
|
@PostMapping("/update")
|
||||||
|
public R update(@RequestBody PcVersion pcVersion){
|
||||||
|
|
||||||
|
pcVersionService.update(pcVersion);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation(value = "根据版本号查询版本")
|
||||||
|
@PostMapping("/selectVersion")
|
||||||
|
public R selectVersion(@RequestParam String versionNumber){
|
||||||
|
|
||||||
|
PcVersion pcVersion = pcVersionService.selectVersion(versionNumber);
|
||||||
|
|
||||||
|
return R.ok(pcVersion);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增版本")
|
||||||
|
@PostMapping("/addVersion")
|
||||||
|
public R addVersion(@RequestBody PcVersion pcVersion){
|
||||||
|
|
||||||
|
//校验版本号
|
||||||
|
PcVersion pcVersion1 = pcVersionService.selectVersion(pcVersion.getVersionNumber());
|
||||||
|
if (pcVersion1 != null){
|
||||||
|
|
||||||
|
return R.fail(HttpStatus.SHOW_ERROR_MSG,"版本号重复");
|
||||||
|
}
|
||||||
|
pcVersionService.addVersion(pcVersion);
|
||||||
|
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,56 @@
|
||||||
|
package com.mcwl.resource.domain;
|
||||||
|
|
||||||
|
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.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pc端版本表
|
||||||
|
*
|
||||||
|
* @author DaiZibo
|
||||||
|
* @date 2025/5/9
|
||||||
|
* @apiNote
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Builder
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiModel(description = "pc端版本表")
|
||||||
|
@TableName("pc_version")
|
||||||
|
public class PcVersion {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键ID")
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "版本号")
|
||||||
|
private String versionNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "版本路径")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "描述")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否更新 0:不 1:强制")
|
||||||
|
private Integer isBug;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "hash值")
|
||||||
|
private String hashCode;
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.mcwl.resource.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.mcwl.resource.domain.PcVersion;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author DaiZibo
|
||||||
|
* @date 2025/5/9
|
||||||
|
* @apiNote
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface PcVersionMapper extends BaseMapper<PcVersion> {
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.mcwl.resource.service;
|
||||||
|
|
||||||
|
import com.mcwl.resource.domain.PcVersion;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author DaiZibo
|
||||||
|
* @date 2025/5/9
|
||||||
|
* @apiNote
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface PcVersionService {
|
||||||
|
List<PcVersion> selectList();
|
||||||
|
|
||||||
|
void update(PcVersion pcVersion);
|
||||||
|
|
||||||
|
PcVersion selectVersion(String versionNumber);
|
||||||
|
|
||||||
|
void addVersion(PcVersion pcVersion);
|
||||||
|
}
|
|
@ -0,0 +1,61 @@
|
||||||
|
package com.mcwl.resource.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.mcwl.resource.domain.PcVersion;
|
||||||
|
import com.mcwl.resource.mapper.PcVersionMapper;
|
||||||
|
import com.mcwl.resource.service.PcVersionService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pc端版本业务实现层
|
||||||
|
*
|
||||||
|
* @author DaiZibo
|
||||||
|
* @date 2025/5/9
|
||||||
|
* @apiNote
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class PcVersionServiceImpl implements PcVersionService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PcVersionMapper pcVersionMapper;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PcVersion> selectList() {
|
||||||
|
|
||||||
|
LambdaQueryWrapper<PcVersion> pcVersionLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
pcVersionLambdaQueryWrapper.orderByDesc(PcVersion::getCreateTime);
|
||||||
|
|
||||||
|
return pcVersionMapper.selectList(pcVersionLambdaQueryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(PcVersion pcVersion) {
|
||||||
|
|
||||||
|
|
||||||
|
pcVersionMapper.updateById(pcVersion);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PcVersion selectVersion(String versionNumber) {
|
||||||
|
|
||||||
|
LambdaQueryWrapper<PcVersion> pcVersionLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
pcVersionLambdaQueryWrapper.eq(PcVersion::getVersionNumber, versionNumber);
|
||||||
|
|
||||||
|
PcVersion pcVersion = pcVersionMapper.selectOne(pcVersionLambdaQueryWrapper);
|
||||||
|
|
||||||
|
return pcVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addVersion(PcVersion pcVersion) {
|
||||||
|
|
||||||
|
pcVersion.setCreateTime(new Date());
|
||||||
|
pcVersionMapper.insert(pcVersion);
|
||||||
|
}
|
||||||
|
}
|
|
@ -63,6 +63,7 @@ public class ReportServiceImpl implements ReportService {
|
||||||
//构造查询条件
|
//构造查询条件
|
||||||
LambdaQueryWrapper<Report> reportLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Report> reportLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
reportLambdaQueryWrapper.eq(Report::getDelFlag, 0);
|
reportLambdaQueryWrapper.eq(Report::getDelFlag, 0);
|
||||||
|
reportLambdaQueryWrapper.orderByDesc(Report::getCreateTime);
|
||||||
if (pageVo.getType() != null) {
|
if (pageVo.getType() != null) {
|
||||||
reportLambdaQueryWrapper.eq(Report::getStatus, 0);
|
reportLambdaQueryWrapper.eq(Report::getStatus, 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue