person controller

This commit is contained in:
lixian 2024-12-22 16:38:32 +08:00
parent e6dc119bd3
commit bb37d0e5f1
6 changed files with 25 additions and 228 deletions

View File

@ -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<Favorite> 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<Favorite> list = favoriteService.selectFavoriteList(favorite);
ExcelUtil<Favorite> util = new ExcelUtil<Favorite>(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<Favorite> list = favoriteService.selectFavoriteList2(favorite);
return getDataTable(list);
}
}

View File

@ -24,10 +24,10 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
/** /**
* 用户信息Controller * person模块Controller
* *
* @author ruoyi * @author ruoyi
* @date 2024-12-20 * @date 2024-11-28
*/ */
@RestController @RestController
@RequestMapping("/system/person") @RequestMapping("/system/person")
@ -37,7 +37,7 @@ public class PersonController extends BaseController
private IPersonService personService; private IPersonService personService;
/** /**
* 查询用户信息列表 * 查询person模块列表
*/ */
// @PreAuthorize("@ss.hasPermi('system:person:list')") // @PreAuthorize("@ss.hasPermi('system:person:list')")
@Anonymous @Anonymous
@ -50,20 +50,20 @@ public class PersonController extends BaseController
} }
/** /**
* 导出用户信息列表 * 导出person模块列表
*/ */
@PreAuthorize("@ss.hasPermi('system:person:export')") @PreAuthorize("@ss.hasPermi('system:person:export')")
@Log(title = "用户信息", businessType = BusinessType.EXPORT) @Log(title = "person模块", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, Person person) public void export(HttpServletResponse response, Person person)
{ {
List<Person> list = personService.selectPersonList(person); List<Person> list = personService.selectPersonList(person);
ExcelUtil<Person> util = new ExcelUtil<Person>(Person.class); ExcelUtil<Person> util = new ExcelUtil<Person>(Person.class);
util.exportExcel(response, list, "用户信息数据"); util.exportExcel(response, list, "person模块数据");
} }
/** /**
* 获取用户信息详细信息 * 获取person模块详细信息
*/ */
@PreAuthorize("@ss.hasPermi('system:person:query')") @PreAuthorize("@ss.hasPermi('system:person:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
@ -73,10 +73,10 @@ public class PersonController extends BaseController
} }
/** /**
* 新增用户信息 * 新增person模块
*/ */
@PreAuthorize("@ss.hasPermi('system:person:add')") @PreAuthorize("@ss.hasPermi('system:person:add')")
@Log(title = "用户信息", businessType = BusinessType.INSERT) @Log(title = "person模块", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody Person person) public AjaxResult add(@RequestBody Person person)
{ {
@ -84,10 +84,10 @@ public class PersonController extends BaseController
} }
/** /**
* 修改用户信息 * 修改person模块
*/ */
@PreAuthorize("@ss.hasPermi('system:person:edit')") @PreAuthorize("@ss.hasPermi('system:person:edit')")
@Log(title = "用户信息", businessType = BusinessType.UPDATE) @Log(title = "person模块", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody Person person) public AjaxResult edit(@RequestBody Person person)
{ {
@ -95,10 +95,10 @@ public class PersonController extends BaseController
} }
/** /**
* 删除用户信息 * 删除person模块
*/ */
@PreAuthorize("@ss.hasPermi('system:person:remove')") @PreAuthorize("@ss.hasPermi('system:person:remove')")
@Log(title = "用户信息", businessType = BusinessType.DELETE) @Log(title = "person模块", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids)
{ {

View File

@ -49,6 +49,14 @@ public class Favorite extends BaseEntity
private Date time; private Date time;
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
public Long getId() { public Long getId() {
return id; return id;
} }
@ -113,14 +121,6 @@ public class Favorite extends BaseEntity
this.sellerid = sellerid; this.sellerid = sellerid;
} }
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
public String getClassification() { public String getClassification() {
return classification; return classification;
} }

View File

@ -9,7 +9,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* 用户信息对象 person * 用户信息对象 person
* *
* @author ruoyi * @author ruoyi
* @date 2024-12-20 * @date 2024-12-22
*/ */
public class Person extends BaseEntity public class Person extends BaseEntity
{ {
@ -18,8 +18,8 @@ public class Person extends BaseEntity
/** id */ /** id */
private Long id; private Long id;
/** 张三 */ /** 姓名 */
@Excel(name = "张三") @Excel(name = "姓名")
private String name; private String name;
/** 图片 */ /** 图片 */

View File

@ -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<Salesid> 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<Address2> address2List);
/**
* 通过卖家信息主键删除卖家地址信息
*
* @param id 卖家信息ID
* @return 结果
*/
public int deleteAddress2BySalesid(Long id);
}

View File

@ -11,7 +11,7 @@ import com.ruoyi.system.service.IPersonService;
* 用户信息Service业务层处理 * 用户信息Service业务层处理
* *
* @author ruoyi * @author ruoyi
* @date 2024-12-20 * @date 2024-12-22
*/ */
@Service @Service
public class PersonServiceImpl implements IPersonService public class PersonServiceImpl implements IPersonService