提交 6e88a287 authored 作者: 宋文杰's avatar 宋文杰

feat(info information): add info information module

上级 edff9146
package com.elephant.framework.galaxy.aroad.module.info.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.elephant.framework.galaxy.aroad.response.R;
import com.elephant.framework.galaxy.aroad.module.common.annotation.SysLog;
import com.elephant.framework.galaxy.aroad.module.info.entity.InfoInformations;
import com.elephant.framework.galaxy.aroad.module.info.service.InfoInformationsService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import com.elephant.framework.galaxy.aroad.module.common.controller.BaseController;
/**
* 信息表
*
* @author songwenjie
* @date 2019-04-28 10:34:46
*/
@RestController
@AllArgsConstructor
@RequestMapping("/infoinformations")
public class InfoInformationsController extends BaseController {
private final InfoInformationsService infoInformationsService;
/**
* 分页查询
* @param page 分页对象
* @param infoInformations 信息表
* @return
*/
@GetMapping("/page")
public R getInfoInformationsPage(Page page, InfoInformations infoInformations) {
return new R<>(infoInformationsService.page(page,Wrappers.query(infoInformations)));
}
/**
* 通过id查询信息表
* @param infoId id
* @return R
*/
@GetMapping("/{infoId}")
public R getById(@PathVariable("infoId") Integer infoId){
return new R<>(infoInformationsService.getById(infoId));
}
/**
* 新增信息表
* @param infoInformations 信息表
* @return R
*/
@SysLog("新增信息表")
@PostMapping
public R save(@RequestBody InfoInformations infoInformations){
return new R<>(infoInformationsService.save(infoInformations));
}
/**
* 修改信息表
* @param infoInformations 信息表
* @return R
*/
@SysLog("修改信息表")
@PutMapping
public R updateById(@RequestBody InfoInformations infoInformations){
return new R<>(infoInformationsService.updateById(infoInformations));
}
/**
* 通过id删除信息表
* @param infoId id
* @return R
*/
@SysLog("删除信息表")
@DeleteMapping("/{infoId}")
public R removeById(@PathVariable Integer infoId){
return new R<>(infoInformationsService.removeById(infoId));
}
}
package com.elephant.framework.galaxy.aroad.module.info.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* 信息表
*
* @author songwenjie
* @date 2019-04-28 10:34:46
*/
@Data
@TableName("info_informations")
@EqualsAndHashCode(callSuper = true)
public class InfoInformations extends Model<InfoInformations> {
private static final long serialVersionUID = 1L;
/**
* 信息id
*/
@TableId
private Integer infoId;
/**
* 模板id
*/
private Integer templateId;
/**
* 信息标题
*/
private String infoTitle;
/**
* 信息内容
*/
private String infoContent;
/**
* 信息备注
*/
private String infoRemark;
/**
* 发布人id
*/
private Integer reporterId;
/**
* 上报时间
*/
private LocalDateTime reportingTime;
}
package com.elephant.framework.galaxy.aroad.module.info.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.elephant.framework.galaxy.aroad.module.info.entity.InfoInformations;
/**
* 信息表
*
* @author songwenjie
* @date 2019-04-28 10:34:46
*/
public interface InfoInformationsMapper extends BaseMapper<InfoInformations> {
}
package com.elephant.framework.galaxy.aroad.module.info.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.elephant.framework.galaxy.aroad.module.info.entity.InfoInformations;
/**
* 信息表
*
* @author songwenjie
* @date 2019-04-28 10:34:46
*/
public interface InfoInformationsService extends IService<InfoInformations> {
}
package com.elephant.framework.galaxy.aroad.module.info.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.elephant.framework.galaxy.aroad.module.info.entity.InfoInformations;
import com.elephant.framework.galaxy.aroad.module.info.mapper.InfoInformationsMapper;
import com.elephant.framework.galaxy.aroad.module.info.service.InfoInformationsService;
import org.springframework.stereotype.Service;
/**
* 信息表
*
* @author songwenjie
* @date 2019-04-28 10:34:46
*/
@Service
public class InfoInformationsServiceImpl extends ServiceImpl<InfoInformationsMapper, InfoInformations> implements InfoInformationsService {
}
<?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="com.elephant.framework.galaxy.aroad.module.info.mapper.InfoInformationsMapper">
<resultMap id="infoInformationsMap" type="com.elephant.framework.galaxy.aroad.module.info.entity.InfoInformations">
<id property="infoId" column="info_id"/>
<result property="templateId" column="template_id"/>
<result property="infoTitle" column="info_title"/>
<result property="infoContent" column="info_content"/>
<result property="infoRemark" column="info_remark"/>
<result property="reporterId" column="reporter_id"/>
<result property="reportingTime" column="reporting_time"/>
</resultMap>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论