src/main/java/org/springblade/common/config/BladeConfiguration.java
@@ -103,6 +103,7 @@ secureRegistry.excludePathPatterns("/investigate/**"); secureRegistry.excludePathPatterns("/taskqd/**"); secureRegistry.excludePathPatterns("/taskfk/**"); secureRegistry.excludePathPatterns("/sensitiveword/**"); return secureRegistry; } src/main/java/org/springblade/modules/sensitiveword/controller/SensitivewordController.java
New file @@ -0,0 +1,124 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.sensitiveword.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; import org.springblade.modules.sensitiveword.entity.Sensitiveword; import org.springblade.modules.sensitiveword.service.ISensitivewordService; import org.springblade.modules.sensitiveword.vo.SensitivewordVO; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; /** * 控制器 * * @author BladeX * @since 2022-01-04 */ @RestController @AllArgsConstructor @RequestMapping("/sensitiveword") @Api(value = "", tags = "接口") public class SensitivewordController extends BladeController { private final ISensitivewordService sensitivewordService; /** * 详情 */ @GetMapping("/detail") @ApiOperationSupport(order = 1) @ApiOperation(value = "详情", notes = "传入sensitiveword") public R<Sensitiveword> detail(Sensitiveword sensitiveword) { Sensitiveword detail = sensitivewordService.getOne(Condition.getQueryWrapper(sensitiveword)); return R.data(detail); } /** * 分页 */ @GetMapping("/list") @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "传入sensitiveword") public R<IPage<Sensitiveword>> list(Sensitiveword sensitiveword, Query query) { IPage<Sensitiveword> pages = sensitivewordService.page(Condition.getPage(query), Condition.getQueryWrapper(sensitiveword)); return R.data(pages); } /** * 自定义分页 */ @GetMapping("/page") @ApiOperationSupport(order = 3) @ApiOperation(value = "分页", notes = "传入sensitiveword") public R<IPage<SensitivewordVO>> page(SensitivewordVO sensitiveword, Query query) { IPage<SensitivewordVO> pages = sensitivewordService.selectSensitivewordPage(Condition.getPage(query), sensitiveword); return R.data(pages); } /** * 新增 */ @PostMapping("/save") @ApiOperationSupport(order = 4) @ApiOperation(value = "新增", notes = "传入sensitiveword") public R save(@Valid @RequestBody Sensitiveword sensitiveword) { return R.status(sensitivewordService.save(sensitiveword)); } /** * 修改 */ @PostMapping("/update") @ApiOperationSupport(order = 5) @ApiOperation(value = "修改", notes = "传入sensitiveword") public R update(@Valid @RequestBody Sensitiveword sensitiveword) { return R.status(sensitivewordService.updateById(sensitiveword)); } /** * 新增或修改 */ @PostMapping("/submit") @ApiOperationSupport(order = 6) @ApiOperation(value = "新增或修改", notes = "传入sensitiveword") public R submit(@Valid @RequestBody Sensitiveword sensitiveword) { return R.status(sensitivewordService.saveOrUpdate(sensitiveword)); } /** * 删除 */ @PostMapping("/remove") @ApiOperationSupport(order = 8) @ApiOperation(value = "删除", notes = "传入ids") public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { return R.status(sensitivewordService.removeByIds(Func.toLongList(ids))); } } src/main/java/org/springblade/modules/sensitiveword/dto/SensitivewordDTO.java
New file @@ -0,0 +1,34 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.sensitiveword.dto; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.modules.sensitiveword.entity.Sensitiveword; /** * 数据传输对象实体类 * * @author BladeX * @since 2022-01-04 */ @Data @EqualsAndHashCode(callSuper = true) public class SensitivewordDTO extends Sensitiveword { private static final long serialVersionUID = 1L; } src/main/java/org/springblade/modules/sensitiveword/entity/Sensitiveword.java
New file @@ -0,0 +1,45 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.sensitiveword.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import lombok.Data; import java.io.Serializable; /** * 实体类 * * @author BladeX * @since 2022-01-04 */ @Data @TableName("sys_sensitiveword") @ApiModel(value = "Sensitiveword对象", description = "Sensitiveword对象") public class Sensitiveword implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) private Integer id; private String badword; } src/main/java/org/springblade/modules/sensitiveword/mapper/SensitivewordMapper.java
New file @@ -0,0 +1,43 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.sensitiveword.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import org.springblade.modules.sensitiveword.entity.Sensitiveword; import org.springblade.modules.sensitiveword.vo.SensitivewordVO; import java.util.List; /** * Mapper 接口 * * @author BladeX * @since 2022-01-04 */ public interface SensitivewordMapper extends BaseMapper<Sensitiveword> { /** * 自定义分页 * * @param page * @param sensitiveword * @return */ List<SensitivewordVO> selectSensitivewordPage(IPage page, SensitivewordVO sensitiveword); } src/main/java/org/springblade/modules/sensitiveword/mapper/SensitivewordMapper.xml
New file @@ -0,0 +1,16 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="org.springblade.modules.sensitiveword.mapper.SensitivewordMapper"> <!-- 通用查询映射结果 --> <resultMap id="sensitivewordResultMap" type="org.springblade.modules.sensitiveword.entity.Sensitiveword"> <id column="id" property="id"/> <result column="badword" property="badword"/> </resultMap> <select id="selectSensitivewordPage" resultMap="sensitivewordResultMap"> select * from sys_sensitiveword where is_deleted = 0 </select> </mapper> src/main/java/org/springblade/modules/sensitiveword/service/ISensitivewordService.java
New file @@ -0,0 +1,41 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.sensitiveword.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import org.springblade.modules.sensitiveword.entity.Sensitiveword; import org.springblade.modules.sensitiveword.vo.SensitivewordVO; /** * 服务类 * * @author BladeX * @since 2022-01-04 */ public interface ISensitivewordService extends IService<Sensitiveword> { /** * 自定义分页 * * @param page * @param sensitiveword * @return */ IPage<SensitivewordVO> selectSensitivewordPage(IPage<SensitivewordVO> page, SensitivewordVO sensitiveword); } src/main/java/org/springblade/modules/sensitiveword/service/impl/SensitivewordServiceImpl.java
New file @@ -0,0 +1,41 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.sensitiveword.service.impl; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springblade.modules.sensitiveword.entity.Sensitiveword; import org.springblade.modules.sensitiveword.mapper.SensitivewordMapper; import org.springblade.modules.sensitiveword.service.ISensitivewordService; import org.springblade.modules.sensitiveword.vo.SensitivewordVO; import org.springframework.stereotype.Service; /** * 服务实现类 * * @author BladeX * @since 2022-01-04 */ @Service public class SensitivewordServiceImpl extends ServiceImpl<SensitivewordMapper, Sensitiveword> implements ISensitivewordService { @Override public IPage<SensitivewordVO> selectSensitivewordPage(IPage<SensitivewordVO> page, SensitivewordVO sensitiveword) { return page.setRecords(baseMapper.selectSensitivewordPage(page, sensitiveword)); } } src/main/java/org/springblade/modules/sensitiveword/vo/SensitivewordVO.java
New file @@ -0,0 +1,36 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.sensitiveword.vo; import io.swagger.annotations.ApiModel; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.modules.sensitiveword.entity.Sensitiveword; /** * 视图实体类 * * @author BladeX * @since 2022-01-04 */ @Data @EqualsAndHashCode(callSuper = true) @ApiModel(value = "SensitivewordVO对象", description = "SensitivewordVO对象") public class SensitivewordVO extends Sensitiveword { private static final long serialVersionUID = 1L; }