| | |
| | | package com.ruoyi.system.controller.management; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.api.domain.dto.MgtPageDto; |
| | | import com.ruoyi.system.domain.dto.MgtAgreementEditDto; |
| | | import com.ruoyi.system.domain.dto.MgtBannerEditDto; |
| | | import com.ruoyi.system.domain.dto.MgtCooperationEditDto; |
| | | import com.ruoyi.system.domain.dto.MgtServiceMobileEditDto; |
| | | import com.ruoyi.system.domain.vo.MgtBannerPageVo; |
| | | import com.ruoyi.system.service.config.AgreementService; |
| | | import com.ruoyi.system.service.config.BannerService; |
| | | import com.ruoyi.system.service.config.CooperationService; |
| | | import com.ruoyi.system.service.config.CustomConfigService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName MgtConfigController |
| | |
| | | @Resource |
| | | private CooperationService cooperationService; |
| | | |
| | | @Resource |
| | | private AgreementService agreementService; |
| | | |
| | | @Resource |
| | | private BannerService bannerService; |
| | | |
| | | @RequestMapping(value = "/editCooperation", method = RequestMethod.POST) |
| | | @ApiOperation(value = "修改申请合作") |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/editAgreement", method = RequestMethod.POST) |
| | | @ApiOperation(value = "修改协议") |
| | | public R editAgreement(@RequestBody MgtAgreementEditDto mgtAgreementEditDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | mgtAgreementEditDto.setUserId(userId); |
| | | agreementService.editAgreement(mgtAgreementEditDto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/editBanner", method = RequestMethod.POST) |
| | | @ApiOperation(value = "修改banner") |
| | | public R editBanner(@RequestBody MgtBannerEditDto mgtBannerEditDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | mgtBannerEditDto.setUserId(userId); |
| | | bannerService.editBanner(mgtBannerEditDto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pageBanner", method = RequestMethod.POST) |
| | | @ApiOperation(value = "分页获取banner") |
| | | public R<Page<MgtBannerPageVo>> pageMerShopRecommend(@RequestBody MgtPageDto mgtPageDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | mgtPageDto.setUserId(userId); |
| | | Page<MgtBannerPageVo> page = new Page<>(); |
| | | page.setSize(mgtPageDto.getPageSize()); |
| | | page.setCurrent(mgtPageDto.getPageNum()); |
| | | List<MgtBannerPageVo> mgtBannerPageVoList = bannerService.pageMgtBannerVo(page); |
| | | return R.ok(page.setRecords(mgtBannerPageVoList)); |
| | | } |
| | | } |