...
This commit is contained in:
parent
c6cbfe70ce
commit
ceec5db424
@ -0,0 +1,97 @@
|
||||
package com.jg.project.about.controller;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.jg.common.utils.QueryPage;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.jg.framework.web.controller.BaseController;
|
||||
import com.jg.project.about.domain.AboutPartOne;
|
||||
import com.jg.project.about.service.IAboutPartOneService;
|
||||
import com.jg.framework.web.domain.R;
|
||||
|
||||
/**
|
||||
* 关于第一部分Controller
|
||||
*
|
||||
* @author wyd
|
||||
* @date 2024-04-23
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "关于第一部分")
|
||||
@RestController
|
||||
@RequestMapping("/PartOne")
|
||||
public class AboutPartOneController extends BaseController{
|
||||
@Resource
|
||||
private IAboutPartOneService aboutPartOneService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 关于第一部分分页列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('PartOne:partone:listPage')")
|
||||
@ApiOperation(value = "关于第一部分分页列表", notes = "关于第一部分分页列表信息")
|
||||
@PostMapping("/listPage")
|
||||
public R listPage(QueryPage queryPage, AboutPartOne aboutPartOne) {
|
||||
startPage();
|
||||
List<AboutPartOne> list = aboutPartOneService.selectAboutPartOneList(aboutPartOne);
|
||||
return R.page(queryPage.getPageNum(),queryPage.getPageSize(),list.size(),list);
|
||||
}
|
||||
/**
|
||||
* 关于第一部分列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('PartOne:partone:list')")
|
||||
@ApiOperation(value = "关于第一部分列表", notes = "关于第一部分列表信息")
|
||||
@GetMapping("/list")
|
||||
public R<List<AboutPartOne>> list() {
|
||||
List<AboutPartOne> list = aboutPartOneService.list();
|
||||
return R.ok(list);
|
||||
}
|
||||
/**
|
||||
* 关于第一部分id详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('PartOne:partone:query')")
|
||||
@ApiOperation(value = "关于第一部分id详细信息", notes = "关于第一部分id详细信息")
|
||||
@GetMapping("/query")
|
||||
public R<AboutPartOne> query(Long id) {
|
||||
AboutPartOne queryinfo = aboutPartOneService.getById(id);
|
||||
return R.ok(queryinfo);
|
||||
}
|
||||
/**
|
||||
* 关于第一部分新增信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('PartOne:partone:add')")
|
||||
@ApiOperation(value = "关于第一部分新增信息", notes = "关于第一部分新增信息")
|
||||
@PostMapping("/add")
|
||||
public R<Boolean> add(AboutPartOne aboutPartOne) {
|
||||
boolean res = aboutPartOneService.save(aboutPartOne);
|
||||
return R.ok(res);
|
||||
}
|
||||
/**
|
||||
* 关于第一部分修改信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('PartOne:partone:edit')")
|
||||
@ApiOperation(value = "关于第一部分修改信息", notes = "关于第一部分修改信息")
|
||||
@PostMapping("/edit")
|
||||
public R<Boolean> edit(AboutPartOne aboutPartOne) {
|
||||
boolean res = aboutPartOneService.updateById(aboutPartOne);
|
||||
return R.ok(res);
|
||||
}
|
||||
/**
|
||||
* 关于第一部分删除信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('PartOne:partone:remove')")
|
||||
@ApiOperation(value = "关于第一部分删除信息", notes = "关于第一部分删除信息")
|
||||
@PostMapping("/remove")
|
||||
public R<Boolean> remove(Long id) {
|
||||
boolean res = aboutPartOneService.removeById(id);
|
||||
return R.ok(res);
|
||||
}
|
||||
}
|
69
src/main/java/com/jg/project/about/domain/AboutPartOne.java
Normal file
69
src/main/java/com/jg/project/about/domain/AboutPartOne.java
Normal file
@ -0,0 +1,69 @@
|
||||
package com.jg.project.about.domain;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
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.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 关于第一部分对象 about_part_one
|
||||
*
|
||||
* @author wyd
|
||||
* @date 2024-04-23
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@ApiModel("关于第一部分表")
|
||||
@TableName("about_part_one")
|
||||
public class AboutPartOne{
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/** 主键 */
|
||||
@JSONField(serializeUsing = ToStringSerializer.class)
|
||||
@ApiModelProperty("主键")
|
||||
@TableId(value = "id" , type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/** 第一标题 */
|
||||
@ApiModelProperty("第一标题")
|
||||
@TableField("title_one")
|
||||
private String titleOne;
|
||||
/** 第二标题 */
|
||||
@ApiModelProperty("第二标题")
|
||||
@TableField("title_two")
|
||||
private String titleTwo;
|
||||
/** 备注 */
|
||||
@ApiModelProperty("备注")
|
||||
@TableField("remarks")
|
||||
private String remarks;
|
||||
/** 图标 */
|
||||
@ApiModelProperty("图标")
|
||||
@TableField("icon")
|
||||
private String icon;
|
||||
/** 排序 */
|
||||
@ApiModelProperty("排序")
|
||||
@TableField("sorts")
|
||||
private Long sorts;
|
||||
/** 创建时间 */
|
||||
@ApiModelProperty(value = "创建时间",hidden = true)
|
||||
@TableField("create_time")
|
||||
@JSONField(serializeUsing = ToStringSerializer.class)
|
||||
private String createTime;
|
||||
/** 更新时间 */
|
||||
@ApiModelProperty(value = "更新时间",hidden = true)
|
||||
@TableField("update_time")
|
||||
@JSONField(serializeUsing = ToStringSerializer.class)
|
||||
private String updateTime;
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.jg.project.about.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jg.project.about.domain.AboutPartOne;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 关于第一部分Mapper接口
|
||||
*
|
||||
* @author wyd
|
||||
* @date 2024-04-23
|
||||
*/
|
||||
public interface AboutPartOneMapper extends BaseMapper<AboutPartOne> {
|
||||
/**
|
||||
* 查询关于第一部分分页列表
|
||||
*
|
||||
* @param aboutPartOne 关于第一部分
|
||||
* @return 关于第一部分集合
|
||||
*/
|
||||
public List<AboutPartOne> selectAboutPartOneList(AboutPartOne aboutPartOne);
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.jg.project.about.service;
|
||||
|
||||
|
||||
import com.jg.project.about.domain.AboutPartOne;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 关于第一部分Service接口
|
||||
*
|
||||
* @author wyd
|
||||
* @date 2024-04-23
|
||||
*/
|
||||
public interface IAboutPartOneService extends IService<AboutPartOne> {
|
||||
/**
|
||||
* 查询关于第一部分分页列表
|
||||
*
|
||||
* @param aboutPartOne 关于第一部分
|
||||
* @return 关于第一部分集合
|
||||
*/
|
||||
public List<AboutPartOne> selectAboutPartOneList(AboutPartOne aboutPartOne);
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.jg.project.about.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jg.project.about.mapper.AboutPartOneMapper;
|
||||
import com.jg.project.about.domain.AboutPartOne;
|
||||
import com.jg.project.about.service.IAboutPartOneService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 关于第一部分Service业务层处理
|
||||
*
|
||||
* @author wyd
|
||||
* @date 2024-04-23
|
||||
*/
|
||||
@Service
|
||||
public class AboutPartOneServiceImpl extends ServiceImpl<AboutPartOneMapper, AboutPartOne> implements IAboutPartOneService {
|
||||
|
||||
@Resource
|
||||
private AboutPartOneMapper aboutPartOneMapper;
|
||||
|
||||
/**
|
||||
* 查询关于第一部分分页列表
|
||||
*
|
||||
* @param aboutPartOne 关于第一部分
|
||||
* @return 关于第一部分
|
||||
*/
|
||||
@Override
|
||||
public List<AboutPartOne> selectAboutPartOneList(AboutPartOne aboutPartOne)
|
||||
{
|
||||
return aboutPartOneMapper.selectAboutPartOneList(aboutPartOne);
|
||||
}
|
||||
}
|
30
src/main/resources/mybatis/PartOne/AboutPartOneMapper.xml
Normal file
30
src/main/resources/mybatis/PartOne/AboutPartOneMapper.xml
Normal file
@ -0,0 +1,30 @@
|
||||
<?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.jg.project.about.mapper.AboutPartOneMapper">
|
||||
<resultMap type="AboutPartOne" id="AboutPartOneResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="titleOne" column="title_one" />
|
||||
<result property="titleTwo" column="title_two" />
|
||||
<result property="remarks" column="remarks" />
|
||||
<result property="icon" column="icon" />
|
||||
<result property="sorts" column="sorts" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAboutPartOneVo">
|
||||
select id, title_one, title_two, remarks, icon, sorts, create_time, update_time from about_part_one
|
||||
</sql>
|
||||
|
||||
<select id="selectAboutPartOneList" parameterType="AboutPartOne" resultMap="AboutPartOneResult">
|
||||
<include refid="selectAboutPartOneVo"/>
|
||||
<where>
|
||||
<if test="titleOne != null and titleOne != ''"> and title_one = #{titleOne}</if>
|
||||
<if test="titleTwo != null and titleTwo != ''"> and title_two = #{titleTwo}</if>
|
||||
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
|
||||
<if test="icon != null and icon != ''"> and icon = #{icon}</if>
|
||||
<if test="sorts != null "> and sorts = #{sorts}</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
Binary file not shown.
Binary file not shown.
BIN
target/classes/com/jg/project/about/domain/AboutPartOne.class
Normal file
BIN
target/classes/com/jg/project/about/domain/AboutPartOne.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
30
target/classes/mybatis/PartOne/AboutPartOneMapper.xml
Normal file
30
target/classes/mybatis/PartOne/AboutPartOneMapper.xml
Normal file
@ -0,0 +1,30 @@
|
||||
<?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.jg.project.about.mapper.AboutPartOneMapper">
|
||||
<resultMap type="AboutPartOne" id="AboutPartOneResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="titleOne" column="title_one" />
|
||||
<result property="titleTwo" column="title_two" />
|
||||
<result property="remarks" column="remarks" />
|
||||
<result property="icon" column="icon" />
|
||||
<result property="sorts" column="sorts" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAboutPartOneVo">
|
||||
select id, title_one, title_two, remarks, icon, sorts, create_time, update_time from about_part_one
|
||||
</sql>
|
||||
|
||||
<select id="selectAboutPartOneList" parameterType="AboutPartOne" resultMap="AboutPartOneResult">
|
||||
<include refid="selectAboutPartOneVo"/>
|
||||
<where>
|
||||
<if test="titleOne != null and titleOne != ''"> and title_one = #{titleOne}</if>
|
||||
<if test="titleTwo != null and titleTwo != ''"> and title_two = #{titleTwo}</if>
|
||||
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
|
||||
<if test="icon != null and icon != ''"> and icon = #{icon}</if>
|
||||
<if test="sorts != null "> and sorts = #{sorts}</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user