This commit is contained in:
adan 2024-12-09 00:05:23 +08:00
parent 2289a8c40d
commit 6dbb0ec61f
14 changed files with 871 additions and 4 deletions

View File

@ -0,0 +1,101 @@
package com.ruoyi.system.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.annotation.Anonymous;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.Contact;
import com.ruoyi.system.service.IContactService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* contactController
*
* @author ruoyi
* @date 2024-12-08
*/
@CrossOrigin
@RestController
@RequestMapping("/system/contact")
public class ContactController extends BaseController
{
@Autowired
private IContactService contactService;
/**
* 查询contact列表
*/
/*@PreAuthorize("@ss.hasPermi('system:contact:list')")*/
@Anonymous
@GetMapping("/list")
public TableDataInfo list(Contact contact)
{
startPage();
List<Contact> list = contactService.selectContactList(contact);
return getDataTable(list);
}
/**
* 导出contact列表
*/
@PreAuthorize("@ss.hasPermi('system:contact:export')")
@Log(title = "contact", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, Contact contact)
{
List<Contact> list = contactService.selectContactList(contact);
ExcelUtil<Contact> util = new ExcelUtil<Contact>(Contact.class);
util.exportExcel(response, list, "contact数据");
}
/**
* 获取contact详细信息
*/
@PreAuthorize("@ss.hasPermi('system:contact:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Integer id)
{
return success(contactService.selectContactById(id));
}
/**
* 新增contact
*/
@PreAuthorize("@ss.hasPermi('system:contact:add')")
@Log(title = "contact", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody Contact contact)
{
return toAjax(contactService.insertContact(contact));
}
/**
* 修改contact
*/
@PreAuthorize("@ss.hasPermi('system:contact:edit')")
@Log(title = "contact", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody Contact contact)
{
return toAjax(contactService.updateContact(contact));
}
/**
* 删除contact
*/
@PreAuthorize("@ss.hasPermi('system:contact:remove')")
@Log(title = "contact", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Integer[] ids)
{
return toAjax(contactService.deleteContactByIds(ids));
}
}

View File

@ -87,9 +87,10 @@ public class Item2Controller extends BaseController
/**
* 修改item2
*/
@PreAuthorize("@ss.hasPermi('system:item2:edit')")
/*@PreAuthorize("@ss.hasPermi('system:item2:edit')")*/
@Anonymous
@Log(title = "item2", businessType = BusinessType.UPDATE)
@PutMapping
@PutMapping("/update")
public AjaxResult edit(@RequestBody Item2 item2)
{
return toAjax(item2Service.updateItem2(item2));
@ -98,7 +99,8 @@ public class Item2Controller extends BaseController
/**
* 删除item2
*/
@PreAuthorize("@ss.hasPermi('system:item2:remove')")
/* @PreAuthorize("@ss.hasPermi('system:item2:remove')")*/
@Anonymous
@Log(title = "item2", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Integer[] ids)

View File

@ -34,7 +34,7 @@ public class MyUserController extends BaseController
* 查询MyUser列表
*/
/*@PreAuthorize("@ss.hasPermi('system:MyUser:list')")*/
@Anonymous
@Anonymous
@GetMapping("/list")
public TableDataInfo list(MyUser myUser)
{

View File

@ -0,0 +1,101 @@
package com.ruoyi.system.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.annotation.Anonymous;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.Stroke;
import com.ruoyi.system.service.IStrokeService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* strokeController
*
* @author ruoyi
* @date 2024-12-08
*/
@CrossOrigin
@RestController
@RequestMapping("/system/stroke")
public class StrokeController extends BaseController
{
@Autowired
private IStrokeService strokeService;
/**
* 查询stroke列表
*/
/*@PreAuthorize("@ss.hasPermi('system:stroke:list')")*/
@Anonymous
@GetMapping("/list")
public TableDataInfo list(Stroke stroke)
{
startPage();
List<Stroke> list = strokeService.selectStrokeList(stroke);
return getDataTable(list);
}
/**
* 导出stroke列表
*/
@PreAuthorize("@ss.hasPermi('system:stroke:export')")
@Log(title = "stroke", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, Stroke stroke)
{
List<Stroke> list = strokeService.selectStrokeList(stroke);
ExcelUtil<Stroke> util = new ExcelUtil<Stroke>(Stroke.class);
util.exportExcel(response, list, "stroke数据");
}
/**
* 获取stroke详细信息
*/
@PreAuthorize("@ss.hasPermi('system:stroke:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Integer id)
{
return success(strokeService.selectStrokeById(id));
}
/**
* 新增stroke
*/
@PreAuthorize("@ss.hasPermi('system:stroke:add')")
@Log(title = "stroke", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody Stroke stroke)
{
return toAjax(strokeService.insertStroke(stroke));
}
/**
* 修改stroke
*/
@PreAuthorize("@ss.hasPermi('system:stroke:edit')")
@Log(title = "stroke", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody Stroke stroke)
{
return toAjax(strokeService.updateStroke(stroke));
}
/**
* 删除stroke
*/
@PreAuthorize("@ss.hasPermi('system:stroke:remove')")
@Log(title = "stroke", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Integer[] ids)
{
return toAjax(strokeService.deleteStrokeByIds(ids));
}
}

View File

@ -0,0 +1,65 @@
package com.ruoyi.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* contact对象 contact
*
* @author ruoyi
* @date 2024-12-08
*/
public class Contact extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Integer id;
/** text */
@Excel(name = "text")
private String text;
/** result */
@Excel(name = "result")
private String result;
public void setId(Integer id)
{
this.id = id;
}
public Integer getId()
{
return id;
}
public void setText(String text)
{
this.text = text;
}
public String getText()
{
return text;
}
public void setResult(String result)
{
this.result = result;
}
public String getResult()
{
return result;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("text", getText())
.append("result", getResult())
.toString();
}
}

View File

@ -0,0 +1,51 @@
package com.ruoyi.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* stroke对象 stroke
*
* @author ruoyi
* @date 2024-12-08
*/
public class Stroke extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Integer id;
/** text */
@Excel(name = "text")
private String text;
public void setId(Integer id)
{
this.id = id;
}
public Integer getId()
{
return id;
}
public void setText(String text)
{
this.text = text;
}
public String getText()
{
return text;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("text", getText())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.Contact;
/**
* contactMapper接口
*
* @author ruoyi
* @date 2024-12-08
*/
public interface ContactMapper
{
/**
* 查询contact
*
* @param id contact主键
* @return contact
*/
public Contact selectContactById(Integer id);
/**
* 查询contact列表
*
* @param contact contact
* @return contact集合
*/
public List<Contact> selectContactList(Contact contact);
/**
* 新增contact
*
* @param contact contact
* @return 结果
*/
public int insertContact(Contact contact);
/**
* 修改contact
*
* @param contact contact
* @return 结果
*/
public int updateContact(Contact contact);
/**
* 删除contact
*
* @param id contact主键
* @return 结果
*/
public int deleteContactById(Integer id);
/**
* 批量删除contact
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteContactByIds(Integer[] ids);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.Stroke;
/**
* strokeMapper接口
*
* @author ruoyi
* @date 2024-12-08
*/
public interface StrokeMapper
{
/**
* 查询stroke
*
* @param id stroke主键
* @return stroke
*/
public Stroke selectStrokeById(Integer id);
/**
* 查询stroke列表
*
* @param stroke stroke
* @return stroke集合
*/
public List<Stroke> selectStrokeList(Stroke stroke);
/**
* 新增stroke
*
* @param stroke stroke
* @return 结果
*/
public int insertStroke(Stroke stroke);
/**
* 修改stroke
*
* @param stroke stroke
* @return 结果
*/
public int updateStroke(Stroke stroke);
/**
* 删除stroke
*
* @param id stroke主键
* @return 结果
*/
public int deleteStrokeById(Integer id);
/**
* 批量删除stroke
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteStrokeByIds(Integer[] ids);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.Contact;
/**
* contactService接口
*
* @author ruoyi
* @date 2024-12-08
*/
public interface IContactService
{
/**
* 查询contact
*
* @param id contact主键
* @return contact
*/
public Contact selectContactById(Integer id);
/**
* 查询contact列表
*
* @param contact contact
* @return contact集合
*/
public List<Contact> selectContactList(Contact contact);
/**
* 新增contact
*
* @param contact contact
* @return 结果
*/
public int insertContact(Contact contact);
/**
* 修改contact
*
* @param contact contact
* @return 结果
*/
public int updateContact(Contact contact);
/**
* 批量删除contact
*
* @param ids 需要删除的contact主键集合
* @return 结果
*/
public int deleteContactByIds(Integer[] ids);
/**
* 删除contact信息
*
* @param id contact主键
* @return 结果
*/
public int deleteContactById(Integer id);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.Stroke;
/**
* strokeService接口
*
* @author ruoyi
* @date 2024-12-08
*/
public interface IStrokeService
{
/**
* 查询stroke
*
* @param id stroke主键
* @return stroke
*/
public Stroke selectStrokeById(Integer id);
/**
* 查询stroke列表
*
* @param stroke stroke
* @return stroke集合
*/
public List<Stroke> selectStrokeList(Stroke stroke);
/**
* 新增stroke
*
* @param stroke stroke
* @return 结果
*/
public int insertStroke(Stroke stroke);
/**
* 修改stroke
*
* @param stroke stroke
* @return 结果
*/
public int updateStroke(Stroke stroke);
/**
* 批量删除stroke
*
* @param ids 需要删除的stroke主键集合
* @return 结果
*/
public int deleteStrokeByIds(Integer[] ids);
/**
* 删除stroke信息
*
* @param id stroke主键
* @return 结果
*/
public int deleteStrokeById(Integer id);
}

View File

@ -0,0 +1,93 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ContactMapper;
import com.ruoyi.system.domain.Contact;
import com.ruoyi.system.service.IContactService;
/**
* contactService业务层处理
*
* @author ruoyi
* @date 2024-12-08
*/
@Service
public class ContactServiceImpl implements IContactService
{
@Autowired
private ContactMapper contactMapper;
/**
* 查询contact
*
* @param id contact主键
* @return contact
*/
@Override
public Contact selectContactById(Integer id)
{
return contactMapper.selectContactById(id);
}
/**
* 查询contact列表
*
* @param contact contact
* @return contact
*/
@Override
public List<Contact> selectContactList(Contact contact)
{
return contactMapper.selectContactList(contact);
}
/**
* 新增contact
*
* @param contact contact
* @return 结果
*/
@Override
public int insertContact(Contact contact)
{
return contactMapper.insertContact(contact);
}
/**
* 修改contact
*
* @param contact contact
* @return 结果
*/
@Override
public int updateContact(Contact contact)
{
return contactMapper.updateContact(contact);
}
/**
* 批量删除contact
*
* @param ids 需要删除的contact主键
* @return 结果
*/
@Override
public int deleteContactByIds(Integer[] ids)
{
return contactMapper.deleteContactByIds(ids);
}
/**
* 删除contact信息
*
* @param id contact主键
* @return 结果
*/
@Override
public int deleteContactById(Integer id)
{
return contactMapper.deleteContactById(id);
}
}

View File

@ -0,0 +1,93 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.StrokeMapper;
import com.ruoyi.system.domain.Stroke;
import com.ruoyi.system.service.IStrokeService;
/**
* strokeService业务层处理
*
* @author ruoyi
* @date 2024-12-08
*/
@Service
public class StrokeServiceImpl implements IStrokeService
{
@Autowired
private StrokeMapper strokeMapper;
/**
* 查询stroke
*
* @param id stroke主键
* @return stroke
*/
@Override
public Stroke selectStrokeById(Integer id)
{
return strokeMapper.selectStrokeById(id);
}
/**
* 查询stroke列表
*
* @param stroke stroke
* @return stroke
*/
@Override
public List<Stroke> selectStrokeList(Stroke stroke)
{
return strokeMapper.selectStrokeList(stroke);
}
/**
* 新增stroke
*
* @param stroke stroke
* @return 结果
*/
@Override
public int insertStroke(Stroke stroke)
{
return strokeMapper.insertStroke(stroke);
}
/**
* 修改stroke
*
* @param stroke stroke
* @return 结果
*/
@Override
public int updateStroke(Stroke stroke)
{
return strokeMapper.updateStroke(stroke);
}
/**
* 批量删除stroke
*
* @param ids 需要删除的stroke主键
* @return 结果
*/
@Override
public int deleteStrokeByIds(Integer[] ids)
{
return strokeMapper.deleteStrokeByIds(ids);
}
/**
* 删除stroke信息
*
* @param id stroke主键
* @return 结果
*/
@Override
public int deleteStrokeById(Integer id)
{
return strokeMapper.deleteStrokeById(id);
}
}

View File

@ -0,0 +1,61 @@
<?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.ruoyi.system.mapper.ContactMapper">
<resultMap type="Contact" id="ContactResult">
<result property="id" column="id" />
<result property="text" column="text" />
<result property="result" column="result" />
</resultMap>
<sql id="selectContactVo">
select id, text, result from contact
</sql>
<select id="selectContactList" parameterType="Contact" resultMap="ContactResult">
<include refid="selectContactVo"/>
<where>
<if test="text != null and text != ''"> and text = #{text}</if>
<if test="result != null and result != ''"> and result = #{result}</if>
</where>
</select>
<select id="selectContactById" parameterType="Integer" resultMap="ContactResult">
<include refid="selectContactVo"/>
where id = #{id}
</select>
<insert id="insertContact" parameterType="Contact" useGeneratedKeys="true" keyProperty="id">
insert into contact
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="text != null">text,</if>
<if test="result != null">result,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="text != null">#{text},</if>
<if test="result != null">#{result},</if>
</trim>
</insert>
<update id="updateContact" parameterType="Contact">
update contact
<trim prefix="SET" suffixOverrides=",">
<if test="text != null">text = #{text},</if>
<if test="result != null">result = #{result},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteContactById" parameterType="Integer">
delete from contact where id = #{id}
</delete>
<delete id="deleteContactByIds" parameterType="String">
delete from contact where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,56 @@
<?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.ruoyi.system.mapper.StrokeMapper">
<resultMap type="Stroke" id="StrokeResult">
<result property="id" column="id" />
<result property="text" column="text" />
</resultMap>
<sql id="selectStrokeVo">
select id, text from stroke
</sql>
<select id="selectStrokeList" parameterType="Stroke" resultMap="StrokeResult">
<include refid="selectStrokeVo"/>
<where>
<if test="text != null and text != ''"> and text = #{text}</if>
</where>
</select>
<select id="selectStrokeById" parameterType="Integer" resultMap="StrokeResult">
<include refid="selectStrokeVo"/>
where id = #{id}
</select>
<insert id="insertStroke" parameterType="Stroke" useGeneratedKeys="true" keyProperty="id">
insert into stroke
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="text != null">text,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="text != null">#{text},</if>
</trim>
</insert>
<update id="updateStroke" parameterType="Stroke">
update stroke
<trim prefix="SET" suffixOverrides=",">
<if test="text != null">text = #{text},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteStrokeById" parameterType="Integer">
delete from stroke where id = #{id}
</delete>
<delete id="deleteStrokeByIds" parameterType="String">
delete from stroke where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>