package com.ruoyi.shop.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.shop.domain.dto.*;
|
import com.ruoyi.shop.domain.vo.MgtShopInfoVo;
|
import com.ruoyi.shop.domain.vo.MgtShopPageVo;
|
import com.ruoyi.shop.domain.vo.MgtShopTagVo;
|
import com.ruoyi.shop.service.shop.ShopRelTagService;
|
import com.ruoyi.shop.service.shop.ShopService;
|
import com.ruoyi.system.api.domain.dto.MgtBaseGetDto;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import java.util.List;
|
|
/**
|
* @author jqs34
|
* @ClassName ShopController
|
* @description: TODO
|
* @date 2023年04月21日
|
* @version: 1.0
|
*/
|
@Api(value = "管理台商户相关接口", tags = "管理台商户相关接口", description = "管理台商户相关接口")
|
@RestController
|
@RequestMapping("/mgt/shop")
|
public class MgtShopController {
|
|
@Resource
|
private ShopService shopService;
|
|
@Resource
|
private ShopRelTagService shopRelTagService;
|
|
@RequestMapping(value = "/pageMgtShop", method = RequestMethod.POST)
|
@ApiOperation(value = "分页获取商户列表")
|
public R<Page<MgtShopPageVo>> pageMgtShop(@RequestBody MgtShopPageDto mgtShopPageDto) {
|
Page<MgtShopPageVo> page = new Page<>();
|
page.setSize(mgtShopPageDto.getPageSize());
|
page.setCurrent(mgtShopPageDto.getPageNum());
|
List<MgtShopPageVo> mgtShopPageVoList = shopService.pageShop(page,mgtShopPageDto);
|
return R.ok(page.setRecords(mgtShopPageVoList));
|
}
|
|
@RequestMapping(value = "/createMgtShop", method = RequestMethod.POST)
|
@ApiOperation(value = "平台编辑商户")
|
public R createMgtShop(@RequestBody MgtEditShopDto mgtEditShopDto) {
|
Long userId = SecurityUtils.getUserId();
|
mgtEditShopDto.setUserId(userId);
|
shopService.createShop(mgtEditShopDto);
|
return R.ok();
|
}
|
|
@RequestMapping(value = "/getMgtShopInfo", method = RequestMethod.POST)
|
@ApiOperation(value = "获取商户详情")
|
public R<MgtShopInfoVo> getMgtShopInfo(@RequestBody MgtBaseGetDto mgtBaseGetDto) {
|
MgtShopInfoVo mgtShopInfoVo = shopService.getMgtShopInfo(Long.valueOf(mgtBaseGetDto.getId()));
|
return R.ok(mgtShopInfoVo);
|
}
|
|
@RequestMapping(value = "/getMgtShopTag", method = RequestMethod.POST)
|
@ApiOperation(value = "获取商户标签")
|
public R<List<MgtShopTagVo>> getMgtShopTag(@RequestBody MgtBaseGetDto mgtBaseGetDto) {
|
List<MgtShopTagVo> mgtShopInfoVoList = shopRelTagService.listShopTagVo(Long.valueOf(mgtBaseGetDto.getId()));
|
return R.ok(mgtShopInfoVoList);
|
}
|
|
@RequestMapping(value = "/editMgtShopTag", method = RequestMethod.POST)
|
@ApiOperation(value = "修改商户标签")
|
public R editMgtShopTag(@RequestBody MgtEditShopTagDto mgtEditShopTagDto) {
|
shopService.editShopTag(mgtEditShopTagDto);
|
return R.ok();
|
}
|
|
@RequestMapping(value = "/changeMgtCooperationTime", method = RequestMethod.POST)
|
@ApiOperation(value = "修改合作时间")
|
public R changeMgtCooperationTime(@RequestBody MgtChangeCoopDto mgtChangeCoopDto) {
|
Long userId = SecurityUtils.getUserId();
|
mgtChangeCoopDto.setUserId(userId);
|
shopService.changeCooperationTime(mgtChangeCoopDto);
|
return R.ok();
|
}
|
}
|