From bb37d0e5f1962479011d22c94fa5ceca08c592cd Mon Sep 17 00:00:00 2001 From: lixian <3207124233@qq.com> Date: Sun, 22 Dec 2024 16:38:32 +0800 Subject: [PATCH] person controller --- .../system/controller/FavoriteController.java | 116 ------------------ .../system/controller/PersonController.java | 26 ++-- .../com/ruoyi/system/domain/Favorite.java | 16 +-- .../java/com/ruoyi/system/domain/Person.java | 6 +- .../ruoyi/system/mapper/SalesidMapper.java | 87 ------------- .../service/impl/PersonServiceImpl.java | 2 +- 6 files changed, 25 insertions(+), 228 deletions(-) delete mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/controller/FavoriteController.java delete mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/mapper/SalesidMapper.java diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/FavoriteController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/FavoriteController.java deleted file mode 100644 index 902b806..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/FavoriteController.java +++ /dev/null @@ -1,116 +0,0 @@ -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.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -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.Favorite; -import com.ruoyi.system.service.IFavoriteService; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.common.core.page.TableDataInfo; - -/** - * 收藏信息Controller - * - * @author ruoyi - * @date 2024-12-20 - */ -@RestController -@RequestMapping("/system/favorite") -public class FavoriteController extends BaseController -{ - @Autowired - private IFavoriteService favoriteService; - - /** - * 查询收藏信息列表 - */ - @PreAuthorize("@ss.hasPermi('system:favorite:list')") - @GetMapping("/list") - public TableDataInfo list(Favorite favorite) - { - startPage(); - List list = favoriteService.selectFavoriteList(favorite); - return getDataTable(list); - } - - /** - * 导出收藏信息列表 - */ - @PreAuthorize("@ss.hasPermi('system:favorite:export')") - @Log(title = "收藏信息", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, Favorite favorite) - { - List list = favoriteService.selectFavoriteList(favorite); - ExcelUtil util = new ExcelUtil(Favorite.class); - util.exportExcel(response, list, "收藏信息数据"); - } - - /** - * 获取收藏信息详细信息 - */ - @PreAuthorize("@ss.hasPermi('system:favorite:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) - { - return success(favoriteService.selectFavoriteById(id)); - } - - /** - * 新增收藏信息 - */ - @PreAuthorize("@ss.hasPermi('system:favorite:add')") - @Log(title = "收藏信息", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody Favorite favorite) - { - return toAjax(favoriteService.insertFavorite(favorite)); - } - - /** - * 修改收藏信息 - */ - @PreAuthorize("@ss.hasPermi('system:favorite:edit')") - @Log(title = "收藏信息", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody Favorite favorite) - { - return toAjax(favoriteService.updateFavorite(favorite)); - } - - /** - * 删除收藏信息 - */ - @PreAuthorize("@ss.hasPermi('system:favorite:remove')") - @Log(title = "收藏信息", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) - { - return toAjax(favoriteService.deleteFavoriteByIds(ids)); - } - -// @PreAuthorize("@ss.hasPermi('system:favorite:list2')") - @Anonymous - @GetMapping("/list2") - public TableDataInfo list2(Favorite favorite) - { - startPage(); - List list = favoriteService.selectFavoriteList2(favorite); - return getDataTable(list); - } -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/PersonController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/PersonController.java index c36be20..e62bc25 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/PersonController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/PersonController.java @@ -24,10 +24,10 @@ import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; /** - * 用户信息Controller + * person模块Controller * * @author ruoyi - * @date 2024-12-20 + * @date 2024-11-28 */ @RestController @RequestMapping("/system/person") @@ -37,7 +37,7 @@ public class PersonController extends BaseController private IPersonService personService; /** - * 查询用户信息列表 + * 查询person模块列表 */ // @PreAuthorize("@ss.hasPermi('system:person:list')") @Anonymous @@ -50,20 +50,20 @@ public class PersonController extends BaseController } /** - * 导出用户信息列表 + * 导出person模块列表 */ @PreAuthorize("@ss.hasPermi('system:person:export')") - @Log(title = "用户信息", businessType = BusinessType.EXPORT) + @Log(title = "person模块", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, Person person) { List list = personService.selectPersonList(person); ExcelUtil util = new ExcelUtil(Person.class); - util.exportExcel(response, list, "用户信息数据"); + util.exportExcel(response, list, "person模块数据"); } /** - * 获取用户信息详细信息 + * 获取person模块详细信息 */ @PreAuthorize("@ss.hasPermi('system:person:query')") @GetMapping(value = "/{id}") @@ -73,10 +73,10 @@ public class PersonController extends BaseController } /** - * 新增用户信息 + * 新增person模块 */ @PreAuthorize("@ss.hasPermi('system:person:add')") - @Log(title = "用户信息", businessType = BusinessType.INSERT) + @Log(title = "person模块", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody Person person) { @@ -84,10 +84,10 @@ public class PersonController extends BaseController } /** - * 修改用户信息 + * 修改person模块 */ @PreAuthorize("@ss.hasPermi('system:person:edit')") - @Log(title = "用户信息", businessType = BusinessType.UPDATE) + @Log(title = "person模块", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody Person person) { @@ -95,10 +95,10 @@ public class PersonController extends BaseController } /** - * 删除用户信息 + * 删除person模块 */ @PreAuthorize("@ss.hasPermi('system:person:remove')") - @Log(title = "用户信息", businessType = BusinessType.DELETE) + @Log(title = "person模块", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/Favorite.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/Favorite.java index 57b73be..17194b3 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/Favorite.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/Favorite.java @@ -49,6 +49,14 @@ public class Favorite extends BaseEntity private Date time; + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + public Long getId() { return id; } @@ -113,14 +121,6 @@ public class Favorite extends BaseEntity this.sellerid = sellerid; } - public BigDecimal getPrice() { - return price; - } - - public void setPrice(BigDecimal price) { - this.price = price; - } - public String getClassification() { return classification; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/Person.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/Person.java index b823df1..de927f4 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/Person.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/Person.java @@ -9,7 +9,7 @@ import com.ruoyi.common.core.domain.BaseEntity; * 用户信息对象 person * * @author ruoyi - * @date 2024-12-20 + * @date 2024-12-22 */ public class Person extends BaseEntity { @@ -18,8 +18,8 @@ public class Person extends BaseEntity /** id */ private Long id; - /** 张三 */ - @Excel(name = "张三") + /** 姓名 */ + @Excel(name = "姓名") private String name; /** 图片 */ diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SalesidMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SalesidMapper.java deleted file mode 100644 index 1e96d75..0000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SalesidMapper.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import com.ruoyi.system.domain.Salesid; -import com.ruoyi.system.domain.Address2; - -/** - * 卖家信息Mapper接口 - * - * @author ruoyi - * @date 2024-12-20 - */ -public interface SalesidMapper -{ - /** - * 查询卖家信息 - * - * @param id 卖家信息主键 - * @return 卖家信息 - */ - public Salesid selectSalesidById(Long id); - - /** - * 查询卖家信息列表 - * - * @param salesid 卖家信息 - * @return 卖家信息集合 - */ - public List selectSalesidList(Salesid salesid); - - /** - * 新增卖家信息 - * - * @param salesid 卖家信息 - * @return 结果 - */ - public int insertSalesid(Salesid salesid); - - /** - * 修改卖家信息 - * - * @param salesid 卖家信息 - * @return 结果 - */ - public int updateSalesid(Salesid salesid); - - /** - * 删除卖家信息 - * - * @param id 卖家信息主键 - * @return 结果 - */ - public int deleteSalesidById(Long id); - - /** - * 批量删除卖家信息 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteSalesidByIds(Long[] ids); - - /** - * 批量删除卖家地址 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteAddress2BySalesids(Long[] ids); - - /** - * 批量新增卖家地址 - * - * @param address2List 卖家地址列表 - * @return 结果 - */ - public int batchAddress2(List address2List); - - - /** - * 通过卖家信息主键删除卖家地址信息 - * - * @param id 卖家信息ID - * @return 结果 - */ - public int deleteAddress2BySalesid(Long id); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PersonServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PersonServiceImpl.java index 0af8bdc..895afe6 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PersonServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PersonServiceImpl.java @@ -11,7 +11,7 @@ import com.ruoyi.system.service.IPersonService; * 用户信息Service业务层处理 * * @author ruoyi - * @date 2024-12-20 + * @date 2024-12-22 */ @Service public class PersonServiceImpl implements IPersonService