| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ycl.annotation.LogSave; |
| | | import com.ycl.api.CommonPage; |
| | | import com.ycl.api.CommonResult; |
| | | import com.ycl.common.util.UtilNumber; |
| | | import com.ycl.dto.UmsStoreInfoParam; |
| | | import com.ycl.dto.store.UmsStoreInfoParam; |
| | | import com.ycl.entity.store.StoreInfo; |
| | | import com.ycl.entity.video.VideoPoint; |
| | | import com.ycl.service.store.StoreInfoService; |
| | | import com.ycl.service.video.impl.IVideoPointService; |
| | | import com.ycl.vo.store.StoreInfoVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | UtilNumber utilNumber; |
| | | |
| | | @Autowired |
| | | private IVideoPointService videoPointService; |
| | | |
| | | |
| | | @Autowired |
| | | public void setUmsStoreInfoService(StoreInfoService umsStoreInfoService) { |
| | | this.storeInfoService = umsStoreInfoService; |
| | | } |
| | |
| | | @ResponseBody |
| | | public CommonResult<StoreInfo> getItem(@PathVariable Long id) { |
| | | StoreInfo storeInfo = storeInfoService.getById(id); |
| | | StoreInfoVO vo = new StoreInfoVO(); |
| | | BeanUtils.copyProperties(storeInfo,vo); |
| | | vo.setVideoPoint(videoPointService.getById(storeInfo.getVideoId())); |
| | | return CommonResult.success(storeInfo); |
| | | } |
| | | |
| | | @ApiOperation(value = "添加门店信息") |
| | | @RequestMapping(value = "/add", method = RequestMethod.POST) |
| | | @ResponseBody |
| | | @LogSave(operationType = "门店管理",contain = "添加门店") |
| | | public CommonResult<StoreInfo> add(@Validated @RequestBody UmsStoreInfoParam umsStoreInfoParam) { |
| | | StoreInfo storeInfo = StoreInfo.builder() |
| | | .owner(umsStoreInfoParam.getOwner()) |
| | |
| | | .storeScore(umsStoreInfoParam.getStorescore()) |
| | | .type(umsStoreInfoParam.getType()) |
| | | .description(umsStoreInfoParam.getDescription()) |
| | | .videoId(umsStoreInfoParam.getVideoId()) |
| | | .build(); |
| | | boolean success = storeInfoService.save(storeInfo); |
| | | if (success) { |