记得上下班打卡 | git大法好,push需谨慎

Commit d968298a authored by 胡佳晨's avatar 胡佳晨

sweet

parent 4fec91be
...@@ -77,6 +77,7 @@ public class SweetManualShopController { ...@@ -77,6 +77,7 @@ public class SweetManualShopController {
@ApiOperation("修改") @ApiOperation("修改")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "manualShopId", value = "商铺id", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "manualShopId", value = "商铺id", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "manualId", value = "手册id", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "title", value = "标题", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "title", value = "标题", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "picUrl", value = "图片地址", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "picUrl", value = "图片地址", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "describes", value = "描述", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "describes", value = "描述", required = true),
...@@ -85,13 +86,14 @@ public class SweetManualShopController { ...@@ -85,13 +86,14 @@ public class SweetManualShopController {
@ApiImplicitParam(type = "query", dataType = "Integer", name = "sort", value = "排序", required = true), @ApiImplicitParam(type = "query", dataType = "Integer", name = "sort", value = "排序", required = true),
}) })
public ResponseDto<Boolean> change(@RequestParam String manualShopId, public ResponseDto<Boolean> change(@RequestParam String manualShopId,
@RequestParam String manualId,
@RequestParam String title, @RequestParam String title,
@RequestParam String picUrl, @RequestParam String picUrl,
@RequestParam String describes, @RequestParam String describes,
@RequestParam Integer type, @RequestParam Integer type,
@RequestParam Integer isRecommend, @RequestParam Integer isRecommend,
@RequestParam Integer sort) { @RequestParam Integer sort) {
return sweetManualShopService.change(manualShopId, title, picUrl, describes, type, isRecommend, sort); return sweetManualShopService.change(manualShopId, manualId, title, picUrl, describes, type, isRecommend, sort);
} }
...@@ -99,8 +101,10 @@ public class SweetManualShopController { ...@@ -99,8 +101,10 @@ public class SweetManualShopController {
@ApiOperation("删除") @ApiOperation("删除")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "manualShopId", value = "商铺id", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "manualShopId", value = "商铺id", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "manualId", value = "手册id", required = true),
}) })
public ResponseDto<Boolean> delete(@RequestParam() String manualShopId) { public ResponseDto<Boolean> delete(@RequestParam() String manualShopId,
return sweetManualShopService.delete(manualShopId); @RequestParam String manualId) {
return sweetManualShopService.delete(manualShopId, manualId);
} }
} }
...@@ -22,7 +22,7 @@ public interface ISweetManualShopService extends IService<SweetManualShop> { ...@@ -22,7 +22,7 @@ public interface ISweetManualShopService extends IService<SweetManualShop> {
ResponseDto<Boolean> add(String manualId,String title,String picUrl,String describe,Integer type,Integer isRecommend,Integer sort); ResponseDto<Boolean> add(String manualId,String title,String picUrl,String describe,Integer type,Integer isRecommend,Integer sort);
ResponseDto<Boolean> change(String manualShopId,String title,String picUrl,String describe,Integer type,Integer isRecommend,Integer sort); ResponseDto<Boolean> change(String manualShopId,String manualId,String title,String picUrl,String describe,Integer type,Integer isRecommend,Integer sort);
ResponseDto<Boolean> delete(String manualShopId); ResponseDto<Boolean> delete(String manualShopId,String manualId);
} }
...@@ -10,6 +10,7 @@ import com.liquidnet.service.sweet.entity.SweetManualShop; ...@@ -10,6 +10,7 @@ import com.liquidnet.service.sweet.entity.SweetManualShop;
import com.liquidnet.service.sweet.mapper.SweetManualShopMapper; import com.liquidnet.service.sweet.mapper.SweetManualShopMapper;
import com.liquidnet.service.sweet.service.ISweetManualShopService; import com.liquidnet.service.sweet.service.ISweetManualShopService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.liquidnet.service.sweet.utils.RedisDataUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -29,6 +30,8 @@ public class SweetManualShopServiceImpl extends ServiceImpl<SweetManualShopMappe ...@@ -29,6 +30,8 @@ public class SweetManualShopServiceImpl extends ServiceImpl<SweetManualShopMappe
@Autowired @Autowired
private SweetManualShopMapper sweetManualShopMapper; private SweetManualShopMapper sweetManualShopMapper;
@Autowired
private RedisDataUtils redisDataUtils;
@Override @Override
public ResponseDto<List<SweetManualShop>> getList(String manualId, Integer type) { public ResponseDto<List<SweetManualShop>> getList(String manualId, Integer type) {
...@@ -64,6 +67,7 @@ public class SweetManualShopServiceImpl extends ServiceImpl<SweetManualShopMappe ...@@ -64,6 +67,7 @@ public class SweetManualShopServiceImpl extends ServiceImpl<SweetManualShopMappe
sweetManualShop.setSort(sort); sweetManualShop.setSort(sort);
sweetManualShop.setStatus(1); sweetManualShop.setStatus(1);
sweetManualShopMapper.insert(sweetManualShop); sweetManualShopMapper.insert(sweetManualShop);
redisDataUtils.setManualShopRedisData(manualId);
return ResponseDto.success(); return ResponseDto.success();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
...@@ -72,7 +76,7 @@ public class SweetManualShopServiceImpl extends ServiceImpl<SweetManualShopMappe ...@@ -72,7 +76,7 @@ public class SweetManualShopServiceImpl extends ServiceImpl<SweetManualShopMappe
} }
@Override @Override
public ResponseDto<Boolean> change(String manualShopId, String title, String picUrl, String describe, Integer type, Integer isRecommend, Integer sort) { public ResponseDto<Boolean> change(String manualShopId,String manualId, String title, String picUrl, String describe, Integer type, Integer isRecommend, Integer sort) {
try { try {
SweetManualShop sweetManualShop = SweetManualShop.getNew(); SweetManualShop sweetManualShop = SweetManualShop.getNew();
sweetManualShop.setTitle(title); sweetManualShop.setTitle(title);
...@@ -82,6 +86,7 @@ public class SweetManualShopServiceImpl extends ServiceImpl<SweetManualShopMappe ...@@ -82,6 +86,7 @@ public class SweetManualShopServiceImpl extends ServiceImpl<SweetManualShopMappe
sweetManualShop.setIsRecommend(isRecommend); sweetManualShop.setIsRecommend(isRecommend);
sweetManualShop.setSort(sort); sweetManualShop.setSort(sort);
sweetManualShopMapper.update(sweetManualShop, Wrappers.lambdaUpdate(SweetManualShop.class).eq(SweetManualShop::getManualShopId, manualShopId)); sweetManualShopMapper.update(sweetManualShop, Wrappers.lambdaUpdate(SweetManualShop.class).eq(SweetManualShop::getManualShopId, manualShopId));
redisDataUtils.setManualShopRedisData(manualId);
return ResponseDto.success(); return ResponseDto.success();
} catch (Exception e) { } catch (Exception e) {
return ResponseDto.failure(); return ResponseDto.failure();
...@@ -89,11 +94,12 @@ public class SweetManualShopServiceImpl extends ServiceImpl<SweetManualShopMappe ...@@ -89,11 +94,12 @@ public class SweetManualShopServiceImpl extends ServiceImpl<SweetManualShopMappe
} }
@Override @Override
public ResponseDto<Boolean> delete(String manualShopId) { public ResponseDto<Boolean> delete(String manualShopId,String manualId) {
try { try {
SweetManualShop sweetManualShop = SweetManualShop.getNew(); SweetManualShop sweetManualShop = SweetManualShop.getNew();
sweetManualShop.setStatus(0); sweetManualShop.setStatus(0);
sweetManualShopMapper.update(sweetManualShop, Wrappers.lambdaUpdate(SweetManualShop.class).eq(SweetManualShop::getManualShopId, manualShopId)); sweetManualShopMapper.update(sweetManualShop, Wrappers.lambdaUpdate(SweetManualShop.class).eq(SweetManualShop::getManualShopId, manualShopId));
redisDataUtils.setManualShopRedisData(manualId);
return ResponseDto.success(); return ResponseDto.success();
} catch (Exception e) { } catch (Exception e) {
return ResponseDto.failure(); return ResponseDto.failure();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment