1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- package com.fdkankan.manage.controller;
- import com.fdkankan.manage.common.PageInfo;
- import com.fdkankan.manage.common.ResultCode;
- import com.fdkankan.manage.common.ResultData;
- import com.fdkankan.manage.entity.UserShareParam;
- import com.fdkankan.manage.exception.BusinessException;
- import com.fdkankan.manage.service.IJyUserShareService;
- import com.fdkankan.manage.vo.response.UserShareVo;
- import org.apache.commons.lang3.StringUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- /**
- * <p>
- * 前端控制器
- * </p>
- *
- * @author
- * @since 2024-03-27
- */
- @RestController
- @RequestMapping("/service/manage/jy/userShare")
- public class JyUserShareController {
- @Autowired
- IJyUserShareService jyUserShareService;
- @PostMapping("/list")
- public ResultData list(@RequestBody UserShareParam param){
- return ResultData.ok(jyUserShareService.pageList(param));
- }
- @PostMapping("/add")
- public ResultData add(@RequestBody UserShareVo param){
- if(param.getId() == null){
- throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
- }
- jyUserShareService.add(param.getId());
- return ResultData.ok();
- }
- @PostMapping("/delete")
- public ResultData delete(@RequestBody UserShareVo param){
- if(param.getId() == null){
- throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
- }
- jyUserShareService.removeById(param.getId());
- return ResultData.ok();
- }
- @PostMapping("/sceneList")
- public ResultData sceneList(@RequestBody UserShareParam param){
- if(param.getJyUserId() == null){
- throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
- }
- return ResultData.ok(PageInfo.PageInfo(jyUserShareService.sceneList(param)));
- }
- }
|