- 删除 DeltaGunCodeController/Entity/Mapper/Service/Impl 与建表脚本 - WebSecurityConfig 移除 /delta-gun-code/** 白名单 - 配套数据库清理(已执行):菜单 1000/1001/1002、角色关联 3 行、 delta_gun_code 表;备份在服务器 /opt/freedom/backup/*-20261020.sql - 项目保留范围:系统管理 + 待办清单(含公开看板)
This commit is contained in:
@@ -76,11 +76,6 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
.authorizeRequests()// 验证码允许匿名访问
|
||||
.antMatchers("/email-sender/sendEmailVerificationCode","/sys-user/register")
|
||||
.anonymous()
|
||||
// 三角洲改枪码:公开复制接口无需登录,后台管理接口需登录
|
||||
.antMatchers("/delta-gun-code/public/**")
|
||||
.permitAll()
|
||||
.antMatchers("/delta-gun-code/**")
|
||||
.authenticated()
|
||||
// 待办清单:多人数据隔离,必须登录后访问
|
||||
.antMatchers("/todo/**")
|
||||
.authenticated()
|
||||
|
||||
@@ -1,145 +0,0 @@
|
||||
package com.freedom.admin.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.freedom.admin.base.BaseController;
|
||||
import com.freedom.admin.common.Result;
|
||||
import com.freedom.admin.entity.DeltaGunCode;
|
||||
import com.freedom.admin.service.DeltaGunCodeService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 控制层-三角洲改枪码表
|
||||
*
|
||||
* @author zhangjiaxun
|
||||
* @description 后台维护改枪码 + 公开复制接口(无需登录)
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("delta-gun-code")
|
||||
@Log4j2
|
||||
public class DeltaGunCodeController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private DeltaGunCodeService deltaGunCodeService;
|
||||
|
||||
/**
|
||||
* 后台管理-分页查询改枪码列表
|
||||
*/
|
||||
@RequestMapping("findPageList")
|
||||
public Result<DeltaGunCode> findPageList(long pageNum, long pageSize, DeltaGunCode deltaGunCode) {
|
||||
QueryWrapper<DeltaGunCode> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("del_flag", 0);
|
||||
queryWrapper.like(StringUtils.isNotBlank(deltaGunCode.getName()), "name", deltaGunCode.getName());
|
||||
queryWrapper.like(StringUtils.isNotBlank(deltaGunCode.getGunName()), "gun_name", deltaGunCode.getGunName());
|
||||
queryWrapper.like(StringUtils.isNotBlank(deltaGunCode.getCategory()), "category", deltaGunCode.getCategory());
|
||||
queryWrapper.eq(deltaGunCode.getStatus() != null, "status", deltaGunCode.getStatus());
|
||||
queryWrapper.orderByAsc("sort").orderByDesc("id");
|
||||
Page<DeltaGunCode> page = deltaGunCodeService.page(new Page<>(pageNum, pageSize), queryWrapper);
|
||||
return Result.ok().setData(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 公开页面-查询所有启用的改枪码(无需登录)
|
||||
*/
|
||||
@RequestMapping("public/list")
|
||||
public Result<DeltaGunCode> publicList() {
|
||||
QueryWrapper<DeltaGunCode> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("del_flag", 0);
|
||||
queryWrapper.eq("status", 1);
|
||||
queryWrapper.orderByAsc("sort").orderByDesc("id");
|
||||
List<DeltaGunCode> list = deltaGunCodeService.list(queryWrapper);
|
||||
return Result.ok().setData(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 公开页面-复制成功后增加复制次数(无需登录)
|
||||
*/
|
||||
@RequestMapping("public/addCopyCount")
|
||||
public Result addCopyCount(Long id) {
|
||||
if (id == null) {
|
||||
return Result.error().message("参数缺失");
|
||||
}
|
||||
UpdateWrapper<DeltaGunCode> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("id", id).eq("del_flag", 0)
|
||||
.setSql("copy_count = copy_count + 1");
|
||||
deltaGunCodeService.update(updateWrapper);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台管理-新增改枪码
|
||||
*/
|
||||
@RequestMapping("add")
|
||||
public Result add(DeltaGunCode deltaGunCode) {
|
||||
if (StringUtils.isBlank(deltaGunCode.getName())) {
|
||||
return Result.error().message("配装名称不能为空");
|
||||
}
|
||||
if (StringUtils.isBlank(deltaGunCode.getCode())) {
|
||||
return Result.error().message("改枪码不能为空");
|
||||
}
|
||||
try {
|
||||
if (deltaGunCode.getStatus() == null) {
|
||||
deltaGunCode.setStatus(1);
|
||||
}
|
||||
if (deltaGunCode.getSort() == null) {
|
||||
deltaGunCode.setSort(0);
|
||||
}
|
||||
deltaGunCode.setCopyCount(0);
|
||||
deltaGunCode.setCreateBy(getUsername());
|
||||
deltaGunCode.setCreateDate(new Date());
|
||||
boolean save = deltaGunCodeService.save(deltaGunCode);
|
||||
return Result.ok().setData(save);
|
||||
} catch (Exception e) {
|
||||
log.error("新增改枪码失败", e);
|
||||
return Result.error().message("新增失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台管理-更新改枪码
|
||||
*/
|
||||
@RequestMapping("update")
|
||||
public Result update(DeltaGunCode deltaGunCode) {
|
||||
if (deltaGunCode.getId() == null) {
|
||||
return Result.error().message("参数缺失");
|
||||
}
|
||||
if (StringUtils.isBlank(deltaGunCode.getName())) {
|
||||
return Result.error().message("配装名称不能为空");
|
||||
}
|
||||
if (StringUtils.isBlank(deltaGunCode.getCode())) {
|
||||
return Result.error().message("改枪码不能为空");
|
||||
}
|
||||
try {
|
||||
deltaGunCode.setUpdateBy(getUsername());
|
||||
deltaGunCode.setUpdateDate(new Date());
|
||||
boolean update = deltaGunCodeService.updateById(deltaGunCode);
|
||||
return Result.ok().setData(update);
|
||||
} catch (Exception e) {
|
||||
log.error("更新改枪码失败", e);
|
||||
return Result.error().message("更新失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台管理-删除改枪码(逻辑删除)
|
||||
*/
|
||||
@RequestMapping("remove")
|
||||
public Result remove(DeltaGunCode deltaGunCode) {
|
||||
try {
|
||||
boolean remove = deltaGunCodeService.removeById(deltaGunCode.getId());
|
||||
return Result.ok().setData(remove);
|
||||
} catch (Exception e) {
|
||||
log.error("删除改枪码失败", e);
|
||||
return Result.error().message("删除失败");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
package com.freedom.admin.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* delta_gun_code
|
||||
* 三角洲行动-改枪码
|
||||
*
|
||||
* @author zhangjiaxun
|
||||
*/
|
||||
@Data
|
||||
@TableName("delta_gun_code")
|
||||
public class DeltaGunCode implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 配装名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 枪械/载具名称
|
||||
*/
|
||||
private String gunName;
|
||||
|
||||
/**
|
||||
* 分类标签(如:主武器/副武器/载具配置)
|
||||
*/
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 改枪码内容
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 备注说明
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 状态:1显示 0隐藏
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 被复制次数
|
||||
*/
|
||||
private Integer copyCount;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createDate;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateDate;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
private Boolean delFlag;
|
||||
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.freedom.admin.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.freedom.admin.entity.DeltaGunCode;
|
||||
|
||||
/**
|
||||
* 数据访问层-三角洲改枪码表
|
||||
*
|
||||
* @author zhangjiaxun
|
||||
*/
|
||||
public interface DeltaGunCodeMapper extends BaseMapper<DeltaGunCode> {
|
||||
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.freedom.admin.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.freedom.admin.entity.DeltaGunCode;
|
||||
|
||||
/**
|
||||
* 业务层-三角洲改枪码表
|
||||
*
|
||||
* @author zhangjiaxun
|
||||
*/
|
||||
public interface DeltaGunCodeService extends IService<DeltaGunCode> {
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.freedom.admin.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.freedom.admin.entity.DeltaGunCode;
|
||||
import com.freedom.admin.mapper.DeltaGunCodeMapper;
|
||||
import com.freedom.admin.service.DeltaGunCodeService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 业务层实现-三角洲改枪码表
|
||||
*
|
||||
* @author zhangjiaxun
|
||||
*/
|
||||
@Service
|
||||
@Log4j2
|
||||
public class DeltaGunCodeServiceImpl extends ServiceImpl<DeltaGunCodeMapper, DeltaGunCode> implements DeltaGunCodeService {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user