src/main/java/org/springblade/common/config/BladeConfiguration.java
@@ -76,6 +76,7 @@ secureRegistry.excludePathPatterns("/coinspect/**"); secureRegistry.excludePathPatterns("/blade-user/**"); secureRegistry.excludePathPatterns("/pushMsg/**"); secureRegistry.excludePathPatterns("/owner/**"); return secureRegistry; } src/main/java/org/springblade/modules/ownerFeed/controller/OwnerController.java
New file @@ -0,0 +1,120 @@ package org.springblade.modules.ownerFeed.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; 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.tenant.annotation.TenantDS; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; import org.springblade.modules.ownerFeed.entity.Owner; import org.springblade.modules.ownerFeed.service.IOwnerService; import org.springblade.modules.ownerFeed.vo.OwnerVO; import org.springblade.modules.ownerFeed.wrapper.OwnerWrapper; import org.springframework.web.bind.annotation.*; import springfox.documentation.annotations.ApiIgnore; import java.util.Map; /** * 控制器 * * @author Chill */ @TenantDS @RestController @RequestMapping("/owner") @AllArgsConstructor public class OwnerController extends BladeController { private final IOwnerService ownerService; /** * 详情 */ @GetMapping("/detail") @ApiOperationSupport(order = 1) @ApiOperation(value = "详情", notes = "传入owner") public R<OwnerVO> detail(Owner owner) { Owner detail = ownerService.getOne(Condition.getQueryWrapper(owner)); return R.data(OwnerWrapper.build().entityVO(detail)); } /** * 分页 */ @GetMapping("/list") @ApiImplicitParams({ @ApiImplicitParam(name = "category", value = "公告类型", paramType = "query", dataType = "integer"), @ApiImplicitParam(name = "title", value = "公告标题", paramType = "query", dataType = "string") }) @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "传入owner") public R<IPage<OwnerVO>> list(@ApiIgnore @RequestParam Map<String, Object> owner, Query query) { IPage<Owner> pages = ownerService.page(Condition.getPage(query), Condition.getQueryWrapper(owner, Owner.class)); return R.data(OwnerWrapper.build().pageVO(pages)); } /** * 多表联合查询自定义分页 */ @GetMapping("/page") @ApiImplicitParams({ @ApiImplicitParam(name = "category", value = "公告类型", paramType = "query", dataType = "integer"), @ApiImplicitParam(name = "title", value = "公告标题", paramType = "query", dataType = "string") }) @ApiOperationSupport(order = 3) @ApiOperation(value = "分页", notes = "传入owner") public R<IPage<OwnerVO>> page(@ApiIgnore OwnerVO owner, Query query) { IPage<OwnerVO> pages = ownerService.selectOwnerPage(Condition.getPage(query), owner); return R.data(pages); } /** * 新增 */ @PostMapping("/save") @ApiOperationSupport(order = 4) @ApiOperation(value = "新增", notes = "传入owner") public R save(@RequestBody Owner owner) { return R.status(ownerService.save(owner)); } /** * 修改 */ @PostMapping("/update") @ApiOperationSupport(order = 5) @ApiOperation(value = "修改", notes = "传入owner") public R update(@RequestBody Owner owner) { return R.status(ownerService.updateById(owner)); } /** * 新增或修改 */ @PostMapping("/submit") @ApiOperationSupport(order = 6) @ApiOperation(value = "新增或修改", notes = "传入owner") public R submit(@RequestBody Owner owner) { return R.status(ownerService.saveOrUpdate(owner)); } /** * 删除 */ @PostMapping("/remove") @ApiOperationSupport(order = 7) @ApiOperation(value = "逻辑删除", notes = "传入owner") public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { boolean temp = ownerService.removeByIds(Func.toLongList(ids)); return R.status(temp); } } src/main/java/org/springblade/modules/ownerFeed/entity/Owner.java
New file @@ -0,0 +1,105 @@ /* * 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.ownerFeed.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 io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import java.io.Serializable; /** * 实体类 * * @author Chill */ @Data @TableName("owner_feedback") public class Owner implements Serializable { private static final long serialVersionUID = 1L; /** * id */ @ApiModelProperty(value = "id") @TableId(value = "id", type = IdType.AUTO) private Integer id; /** * 服务单位 */ @ApiModelProperty(value = "服务单位") private String company; /** * 服务单位联系方式 */ @ApiModelProperty(value = "服务单位联系方式") @TableField("company_contact") private String companyContact; /** * 反馈时间 */ @ApiModelProperty(value = "反馈时间") @TableField("feedback_time") private String feedbackTime; /** * 反馈意见 */ @ApiModelProperty(value = "反馈意见") private String opinion; /** * 业主 */ @ApiModelProperty(value = "业主") private String owner; /** * 业主联系方式 */ @ApiModelProperty(value = "业主联系方式") @TableField("owner_contact") private String ownerContact; /** * 备注 */ @ApiModelProperty(value = "备注") private String remarks; /** * 处置结果 */ @ApiModelProperty(value = "处置结果") private String result; } src/main/java/org/springblade/modules/ownerFeed/mapper/OwnerMapper.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 owner, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * owner, 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.ownerFeed.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import org.springblade.modules.ownerFeed.entity.Owner; import org.springblade.modules.ownerFeed.vo.OwnerVO; import java.util.List; /** * Mapper 接口 * * @author Chill */ public interface OwnerMapper extends BaseMapper<Owner> { /** * 自定义分页 * * @param page 分页 * @param owner 实体 * @return List<OwnerVO> */ List<OwnerVO> selectOwnerPage(IPage page, OwnerVO owner); } src/main/java/org/springblade/modules/ownerFeed/mapper/OwnerMapper.xml
New file @@ -0,0 +1,9 @@ <?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.ownerFeed.mapper.OwnerMapper"> <select id="selectOwnerPage" resultType="org.springblade.modules.ownerFeed.vo.OwnerVO"> select * from owner_feedback </select> </mapper> src/main/java/org/springblade/modules/ownerFeed/service/IOwnerService.java
New file @@ -0,0 +1,42 @@ /* * 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 owner, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * owner, 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.ownerFeed.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import org.springblade.core.mp.base.BaseService; import org.springblade.modules.exam.entity.ExamPaper; import org.springblade.modules.ownerFeed.entity.Owner; import org.springblade.modules.ownerFeed.vo.OwnerVO; /** * 服务类 * * @author Chill */ public interface IOwnerService extends IService<Owner> { /** * 自定义分页 * @param page * @param owner * @return */ IPage<OwnerVO> selectOwnerPage(IPage<OwnerVO> page, OwnerVO owner); } src/main/java/org/springblade/modules/ownerFeed/service/impl/OwnerServiceImpl.java
New file @@ -0,0 +1,40 @@ /* * 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 owner, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * owner, 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.ownerFeed.service.impl; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springblade.modules.ownerFeed.entity.Owner; import org.springblade.modules.ownerFeed.mapper.OwnerMapper; import org.springblade.modules.ownerFeed.service.IOwnerService; import org.springblade.modules.ownerFeed.vo.OwnerVO; import org.springframework.stereotype.Service; /** * 服务实现类 * * @author Chill */ @Service public class OwnerServiceImpl extends ServiceImpl<OwnerMapper, Owner> implements IOwnerService { @Override public IPage<OwnerVO> selectOwnerPage(IPage<OwnerVO> page, OwnerVO owner) { return page.setRecords(baseMapper.selectOwnerPage(page, owner)); } } src/main/java/org/springblade/modules/ownerFeed/vo/OwnerVO.java
New file @@ -0,0 +1,16 @@ package org.springblade.modules.ownerFeed.vo; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.modules.ownerFeed.entity.Owner; /** * 通知公告视图类 * * @author Chill */ @Data @EqualsAndHashCode(callSuper = true) public class OwnerVO extends Owner { private static final long serialVersionUID = 1L; } src/main/java/org/springblade/modules/ownerFeed/wrapper/OwnerWrapper.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 owner, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * owner, 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.ownerFeed.wrapper; import org.springblade.core.mp.support.BaseEntityWrapper; import org.springblade.core.tool.utils.BeanUtil; import org.springblade.modules.ownerFeed.entity.Owner; import org.springblade.modules.ownerFeed.vo.OwnerVO; import java.util.Objects; /** * Owner包装类,返回视图层所需的字段 * * @author Chill */ public class OwnerWrapper extends BaseEntityWrapper<Owner, OwnerVO> { public static OwnerWrapper build() { return new OwnerWrapper(); } @Override public OwnerVO entityVO(Owner owner) { OwnerVO ownerVO = Objects.requireNonNull(BeanUtil.copy(owner, OwnerVO.class)); return ownerVO; } } src/main/resources/application-dev.yml
@@ -13,9 +13,14 @@ # commandTimeout: 5000 datasource: # MySql # url: jdbc:mysql://localhost:2083/zhbaw?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true # username: root # password: zhba0728 url: jdbc:mysql://223.82.109.183:2083/zhbaw?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true username: root password: zhba0728 # PostgreSQL #url: jdbc:postgresql://127.0.0.1:5432/bladex_boot #username: postgres