src/main/java/org/springblade/common/config/BladeConfiguration.java
@@ -72,6 +72,7 @@ secureRegistry.excludePathPatterns("/blade-user/**"); secureRegistry.excludePathPatterns("/trainingRegistration/**"); secureRegistry.excludePathPatterns("/seinspect/**"); secureRegistry.excludePathPatterns("/coinspect/**"); return secureRegistry; } src/main/java/org/springblade/common/utils/arg.java
@@ -19,7 +19,7 @@ import java.util.Set; public class arg { public static String url = "http://47.49.21.216:80"; public static String url = "http://192.168.0.109:80"; public static String test01(String path, Object obj) throws Exception { CloseableHttpClient httpClient = HttpClients.createDefault(); src/main/java/org/springblade/modules/coinspect/controller/CoinspectController.java
New file @@ -0,0 +1,130 @@ /* * 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.coinspect.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.common.utils.arg; 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.coinspect.entity.Coinspect; import org.springblade.modules.coinspect.service.ICoinspectService; import org.springblade.modules.coinspect.vo.CoinspectVO; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; /** * 控制器 * * @author BladeX * @since 2021-08-03 */ @RestController @AllArgsConstructor @RequestMapping("/coinspect") @Api(value = "", tags = "接口") public class CoinspectController extends BladeController { private final ICoinspectService coinspectService; /** * 详情 */ @GetMapping("/detail") @ApiOperationSupport(order = 1) @ApiOperation(value = "详情", notes = "传入coinspect") public R<Coinspect> detail(Coinspect coinspect) { Coinspect detail = coinspectService.getOne(Condition.getQueryWrapper(coinspect)); return R.data(detail); } /** * 分页 */ @GetMapping("/list") @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "传入coinspect") public R<IPage<Coinspect>> list(Coinspect coinspect, Query query) { IPage<Coinspect> pages = coinspectService.page(Condition.getPage(query), Condition.getQueryWrapper(coinspect)); return R.data(pages); } /** * 自定义分页 */ @GetMapping("/page") @ApiOperationSupport(order = 3) @ApiOperation(value = "分页", notes = "传入coinspect") public R<IPage<CoinspectVO>> page(CoinspectVO coinspect, Query query) { IPage<CoinspectVO> pages = coinspectService.selectCoinspectPage(Condition.getPage(query), coinspect); return R.data(pages); } /** * 新增 */ @PostMapping("/save") @ApiOperationSupport(order = 4) @ApiOperation(value = "新增", notes = "传入coinspect") public R save(@Valid @RequestBody Coinspect coinspect) throws Exception { arg.test01(arg.url+"/coinspect/save",coinspect); return R.status(coinspectService.save(coinspect)); } /** * 修改 */ @PostMapping("/update") @ApiOperationSupport(order = 5) @ApiOperation(value = "修改", notes = "传入coinspect") public R update(@Valid @RequestBody Coinspect coinspect) throws Exception { arg.test01(arg.url+"/coinspect/update",coinspect); return R.status(coinspectService.updateById(coinspect)); } /** * 新增或修改 */ @PostMapping("/submit") @ApiOperationSupport(order = 6) @ApiOperation(value = "新增或修改", notes = "传入coinspect") public R submit(@Valid @RequestBody Coinspect coinspect) { return R.status(coinspectService.saveOrUpdate(coinspect)); } /** * 删除 */ @PostMapping("/remove") @ApiOperationSupport(order = 8) @ApiOperation(value = "删除", notes = "传入ids") public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { arg.sendPostRemoveByIds(arg.url+"/coinspect/remove",ids); return R.status(coinspectService.removeByIds(Func.toLongList(ids))); } } src/main/java/org/springblade/modules/coinspect/dto/CoinspectDTO.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.coinspect.dto; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.modules.coinspect.entity.Coinspect; /** * 数据传输对象实体类 * * @author BladeX * @since 2021-08-03 */ @Data @EqualsAndHashCode(callSuper = true) public class CoinspectDTO extends Coinspect { private static final long serialVersionUID = 1L; } src/main/java/org/springblade/modules/coinspect/entity/Coinspect.java
New file @@ -0,0 +1,82 @@ /* * 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.coinspect.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; 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.util.Date; /** * 实体类 * * @author BladeX * @since 2021-08-03 */ @Data @TableName("sys_coinspect") @ApiModel(value = "Coinspect对象", description = "Coinspect对象") public class Coinspect implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) private Integer id; /** * 检查人姓名 */ @ApiModelProperty(value = "检查人姓名") private String name; /** * 被检查单位名称 */ @ApiModelProperty(value = "被检查单位名称") @TableField("sName") private String sname; /** * 检查人单位 */ @ApiModelProperty(value = "检查人单位") @TableField("deptName") private String deptname; /** * 检查日期 */ @ApiModelProperty(value = "检查日期") @TableField("reviewTime") private String reviewtime; /** * 检查内容 */ @ApiModelProperty(value = "检查内容") private String insid; /** * 检查结果 */ @ApiModelProperty(value = "检查结果") private String results; } src/main/java/org/springblade/modules/coinspect/mapper/CoinspectMapper.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.coinspect.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import org.springblade.modules.coinspect.entity.Coinspect; import org.springblade.modules.coinspect.vo.CoinspectVO; import java.util.List; /** * Mapper 接口 * * @author BladeX * @since 2021-08-03 */ public interface CoinspectMapper extends BaseMapper<Coinspect> { /** * 自定义分页 * * @param page * @param coinspect * @return */ List<CoinspectVO> selectCoinspectPage(IPage page, CoinspectVO coinspect); } src/main/java/org/springblade/modules/coinspect/mapper/CoinspectMapper.xml
New file @@ -0,0 +1,21 @@ <?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.coinspect.mapper.CoinspectMapper"> <!-- 通用查询映射结果 --> <resultMap id="coinspectResultMap" type="org.springblade.modules.coinspect.entity.Coinspect"> <id column="id" property="id"/> <result column="name" property="name"/> <result column="sName" property="sname"/> <result column="deptName" property="deptname"/> <result column="reviewTime" property="reviewtime"/> <result column="insid" property="insid"/> <result column="results" property="results"/> </resultMap> <select id="selectCoinspectPage" resultMap="coinspectResultMap"> select * from sys_coinspect where is_deleted = 0 </select> </mapper> src/main/java/org/springblade/modules/coinspect/service/ICoinspectService.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.coinspect.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import org.springblade.modules.coinspect.entity.Coinspect; import org.springblade.modules.coinspect.vo.CoinspectVO; /** * 服务类 * * @author BladeX * @since 2021-08-03 */ public interface ICoinspectService extends IService<Coinspect> { /** * 自定义分页 * * @param page * @param coinspect * @return */ IPage<CoinspectVO> selectCoinspectPage(IPage<CoinspectVO> page, CoinspectVO coinspect); } src/main/java/org/springblade/modules/coinspect/service/impl/CoinspectServiceImpl.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.coinspect.service.impl; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springblade.modules.coinspect.entity.Coinspect; import org.springblade.modules.coinspect.mapper.CoinspectMapper; import org.springblade.modules.coinspect.service.ICoinspectService; import org.springblade.modules.coinspect.vo.CoinspectVO; import org.springframework.stereotype.Service; /** * 服务实现类 * * @author BladeX * @since 2021-08-03 */ @Service public class CoinspectServiceImpl extends ServiceImpl<CoinspectMapper, Coinspect> implements ICoinspectService { @Override public IPage<CoinspectVO> selectCoinspectPage(IPage<CoinspectVO> page, CoinspectVO coinspect) { return page.setRecords(baseMapper.selectCoinspectPage(page, coinspect)); } } src/main/java/org/springblade/modules/coinspect/vo/CoinspectVO.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.coinspect.vo; import io.swagger.annotations.ApiModel; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.modules.coinspect.entity.Coinspect; /** * 视图实体类 * * @author BladeX * @since 2021-08-03 */ @Data @EqualsAndHashCode(callSuper = true) @ApiModel(value = "CoinspectVO对象", description = "CoinspectVO对象") public class CoinspectVO extends Coinspect { private static final long serialVersionUID = 1L; } src/main/resources/application.yml
@@ -49,7 +49,7 @@ #实体扫描,多个package用逗号或者分号分隔 typeAliasesPackage: org.springblade.**.entity #typeEnumsPackage: org.springblade.dashboard.entity.enums global-config: global-config:` # 关闭MP3.0自带的banner banner: false db-config: