| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.other.api.domain.Share; |
| | | import com.ruoyi.other.enums.ShareAddType; |
| | | import com.ruoyi.other.enums.ShareAuditStatus; |
| | | import com.ruoyi.other.service.ShareService; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | @ApiOperation(value = "添加", tags = {"后台-分享管理"}) |
| | | @PostMapping("/manage/add") |
| | | public R<Void> manage(@RequestBody Share share){ |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | Long userid = loginUser.getSysUser().getUserId(); |
| | | share.setAddType(1); |
| | | share.setAuditStatus(ShareAuditStatus.SUCCESS.getCode()); |
| | | share.setObjectId(userid.toString()); |
| | |
| | | @ApiOperation(value = "列表", tags = {"后台-分享管理"}) |
| | | @GetMapping("/manage/list") |
| | | public R<Page<Share>> managelist(String name,Integer addType,@RequestParam Integer PageNum,Integer pageSize){ |
| | | Page<Share> page = shareService.lambdaQuery().like(name != null, Share::getName, name).eq(addType != null, Share::getAddType, addType).page(Page.of(pageSize, pageSize)); |
| | | Page<Share> page = shareService.lambdaQuery().like(name != null, Share::getName, name).eq(addType != null, Share::getAddType, addType).page(Page.of(PageNum, pageSize)); |
| | | return R.ok(page); |
| | | } |
| | | |