1 files modified
16 files added
| | |
| | | .set(TokenConstant.ROLE_ID, user.getRoleId()) |
| | | .set("jurisdiction", user.getJurisdiction()) |
| | | .set("stype", user.getStype()) |
| | | .set("cardid", user.getCardid()) |
| | | .set(TokenConstant.OAUTH_ID, userInfo.getOauthId()) |
| | | .set(TokenConstant.ACCOUNT, user.getAccount()) |
| | | .set(TokenConstant.USER_NAME, user.getAccount()) |
| New file |
| | |
| | | /* |
| | | * 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.proclamation.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.proclamation.entity.Proclamation; |
| | | import org.springblade.modules.proclamation.service.IProclamationService; |
| | | import org.springblade.modules.proclamation.vo.ProclamationVO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-02-22 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("proclamation/proclamation") |
| | | @Api(value = "", tags = "接口") |
| | | public class ProclamationController extends BladeController { |
| | | |
| | | private final IProclamationService proclamationService; |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入proclamation") |
| | | public R<Proclamation> detail(Proclamation proclamation) { |
| | | Proclamation detail = proclamationService.getOne(Condition.getQueryWrapper(proclamation)); |
| | | return R.data(detail); |
| | | } |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入proclamation") |
| | | public R<IPage<Proclamation>> list(Proclamation proclamation, Query query) { |
| | | IPage<Proclamation> pages = proclamationService.page(Condition.getPage(query), Condition.getQueryWrapper(proclamation)); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入proclamation") |
| | | public R<IPage<ProclamationVO>> page(ProclamationVO proclamation, Query query) { |
| | | IPage<ProclamationVO> pages = proclamationService.selectProclamationPage(Condition.getPage(query), proclamation); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入proclamation") |
| | | public R save(@Valid @RequestBody Proclamation proclamation) { |
| | | return R.status(proclamationService.save(proclamation)); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入proclamation") |
| | | public R update(@Valid @RequestBody Proclamation proclamation) { |
| | | return R.status(proclamationService.updateById(proclamation)); |
| | | } |
| | | |
| | | /** |
| | | * 新增或修改 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入proclamation") |
| | | public R submit(@Valid @RequestBody Proclamation proclamation) { |
| | | proclamation.setTime(new Date()); |
| | | return R.status(proclamationService.saveOrUpdate(proclamation)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(proclamationService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.proclamation.dto; |
| | | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.modules.proclamation.entity.Proclamation; |
| | | |
| | | /** |
| | | * 数据传输对象实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-02-22 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class ProclamationDTO extends Proclamation { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.proclamation.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | 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 2022-02-22 |
| | | */ |
| | | @Data |
| | | @TableName("sys_proclamation") |
| | | @ApiModel(value = "Proclamation对象", description = "Proclamation对象") |
| | | public class Proclamation implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 公告名称 |
| | | */ |
| | | @ApiModelProperty(value = "公告名称") |
| | | private String name; |
| | | /** |
| | | * 公告内容 |
| | | */ |
| | | @ApiModelProperty(value = "公告内容") |
| | | private String context; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date time; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.proclamation.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.proclamation.entity.Proclamation; |
| | | import org.springblade.modules.proclamation.vo.ProclamationVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Mapper 接口 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-02-22 |
| | | */ |
| | | public interface ProclamationMapper extends BaseMapper<Proclamation> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param proclamation |
| | | * @return |
| | | */ |
| | | List<ProclamationVO> selectProclamationPage(IPage page, ProclamationVO proclamation); |
| | | |
| | | } |
| New file |
| | |
| | | <?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.proclamation.mapper.ProclamationMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="proclamationResultMap" type="org.springblade.modules.proclamation.entity.Proclamation"> |
| | | <id column="id" property="id"/> |
| | | <result column="name" property="name"/> |
| | | <result column="context" property="context"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectProclamationPage" resultMap="proclamationResultMap"> |
| | | select * from sys_proclamation where is_deleted = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | /* |
| | | * 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.proclamation.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.modules.proclamation.entity.Proclamation; |
| | | import org.springblade.modules.proclamation.vo.ProclamationVO; |
| | | |
| | | /** |
| | | * 服务类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-02-22 |
| | | */ |
| | | public interface IProclamationService extends IService<Proclamation> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param proclamation |
| | | * @return |
| | | */ |
| | | IPage<ProclamationVO> selectProclamationPage(IPage<ProclamationVO> page, ProclamationVO proclamation); |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.proclamation.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.modules.proclamation.entity.Proclamation; |
| | | import org.springblade.modules.proclamation.mapper.ProclamationMapper; |
| | | import org.springblade.modules.proclamation.service.IProclamationService; |
| | | import org.springblade.modules.proclamation.vo.ProclamationVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * 服务实现类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-02-22 |
| | | */ |
| | | @Service |
| | | public class ProclamationServiceImpl extends ServiceImpl<ProclamationMapper, Proclamation> implements IProclamationService { |
| | | |
| | | @Override |
| | | public IPage<ProclamationVO> selectProclamationPage(IPage<ProclamationVO> page, ProclamationVO proclamation) { |
| | | return page.setRecords(baseMapper.selectProclamationPage(page, proclamation)); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.proclamation.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.modules.proclamation.entity.Proclamation; |
| | | |
| | | /** |
| | | * 视图实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-02-22 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "ProclamationVO对象", description = "ProclamationVO对象") |
| | | public class ProclamationVO extends Proclamation { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.rotation.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.rotation.entity.Rotation; |
| | | import org.springblade.modules.rotation.service.IRotationService; |
| | | import org.springblade.modules.rotation.vo.RotationVO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 轮播图 控制器 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-02-22 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("rotation/rotation") |
| | | @Api(value = "轮播图", tags = "轮播图接口") |
| | | public class RotationController extends BladeController { |
| | | |
| | | private final IRotationService rotationService; |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入rotation") |
| | | public R<Rotation> detail(Rotation rotation) { |
| | | Rotation detail = rotationService.getOne(Condition.getQueryWrapper(rotation)); |
| | | return R.data(detail); |
| | | } |
| | | |
| | | /** |
| | | * 分页 轮播图 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入rotation") |
| | | public R<IPage<Rotation>> list(Rotation rotation, Query query) { |
| | | IPage<Rotation> pages = rotationService.page(Condition.getPage(query), Condition.getQueryWrapper(rotation)); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 自定义分页 轮播图 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入rotation") |
| | | public R<IPage<RotationVO>> page(RotationVO rotation, Query query) { |
| | | IPage<RotationVO> pages = rotationService.selectRotationPage(Condition.getPage(query), rotation); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 新增 轮播图 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入rotation") |
| | | public R save(@Valid @RequestBody Rotation rotation) { |
| | | return R.status(rotationService.save(rotation)); |
| | | } |
| | | |
| | | /** |
| | | * 修改 轮播图 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入rotation") |
| | | public R update(@Valid @RequestBody Rotation rotation) { |
| | | return R.status(rotationService.updateById(rotation)); |
| | | } |
| | | |
| | | /** |
| | | * 新增或修改 轮播图 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入rotation") |
| | | public R submit(@Valid @RequestBody Rotation rotation) { |
| | | rotation.setTime(new Date()); |
| | | return R.status(rotationService.saveOrUpdate(rotation)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除 轮播图 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(rotationService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.rotation.dto; |
| | | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.modules.rotation.entity.Rotation; |
| | | |
| | | /** |
| | | * 轮播图数据传输对象实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-02-22 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class RotationDTO extends Rotation { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.rotation.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 2022-02-22 |
| | | */ |
| | | @Data |
| | | @TableName("sys_rotation") |
| | | @ApiModel(value = "Rotation对象", description = "轮播图") |
| | | public class Rotation implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 图片地址 |
| | | */ |
| | | @ApiModelProperty(value = "图片地址") |
| | | private String url; |
| | | /** |
| | | * 跳转地址 |
| | | */ |
| | | @ApiModelProperty(value = "跳转地址") |
| | | @TableField("junpUrl") |
| | | private String junpurl; |
| | | /** |
| | | * 发布时间 |
| | | */ |
| | | @ApiModelProperty(value = "名称") |
| | | private String name; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date time; |
| | | |
| | | /** |
| | | * 类型 0:轮播图 1:公告 |
| | | */ |
| | | private String type; |
| | | /** |
| | | * 内容 |
| | | */ |
| | | private String context; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.rotation.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.rotation.entity.Rotation; |
| | | import org.springblade.modules.rotation.vo.RotationVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 轮播图 Mapper 接口 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-02-22 |
| | | */ |
| | | public interface RotationMapper extends BaseMapper<Rotation> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param rotation |
| | | * @return |
| | | */ |
| | | List<RotationVO> selectRotationPage(IPage page, RotationVO rotation); |
| | | |
| | | } |
| New file |
| | |
| | | <?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.rotation.mapper.RotationMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="rotationResultMap" type="org.springblade.modules.rotation.entity.Rotation"> |
| | | <id column="id" property="id"/> |
| | | <result column="url" property="url"/> |
| | | <result column="junpUrl" property="junpurl"/> |
| | | <result column="name" property="name"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectRotationPage" resultMap="rotationResultMap"> |
| | | select * from sys_rotation where is_deleted = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | /* |
| | | * 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.rotation.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.modules.rotation.entity.Rotation; |
| | | import org.springblade.modules.rotation.vo.RotationVO; |
| | | |
| | | /** |
| | | * 轮播图 服务类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-02-22 |
| | | */ |
| | | public interface IRotationService extends IService<Rotation> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param rotation |
| | | * @return |
| | | */ |
| | | IPage<RotationVO> selectRotationPage(IPage<RotationVO> page, RotationVO rotation); |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.rotation.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.modules.rotation.entity.Rotation; |
| | | import org.springblade.modules.rotation.mapper.RotationMapper; |
| | | import org.springblade.modules.rotation.service.IRotationService; |
| | | import org.springblade.modules.rotation.vo.RotationVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * 轮播图 服务实现类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-02-22 |
| | | */ |
| | | @Service |
| | | public class RotationServiceImpl extends ServiceImpl<RotationMapper, Rotation> implements IRotationService { |
| | | |
| | | @Override |
| | | public IPage<RotationVO> selectRotationPage(IPage<RotationVO> page, RotationVO rotation) { |
| | | return page.setRecords(baseMapper.selectRotationPage(page, rotation)); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.rotation.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.modules.rotation.entity.Rotation; |
| | | |
| | | /** |
| | | * 轮播图视图实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2022-02-22 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "RotationVO对象", description = "轮播图") |
| | | public class RotationVO extends Rotation { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |