Commit 3db6b0f4 authored by xuxin's avatar xuxin

删除cookie 增加返回字段

parent 2d5f6c08
......@@ -249,8 +249,13 @@ public class ShopController {
* 删除cookie
*/
@DeleteMapping("/cookie/{shopId}")
public void delShopCookie(@PathVariable String shopId) {
shopService.deleteShopCookieById(shopId);
public ResultDto delShopCookie(@PathVariable String shopId) {
Integer result = shopService.deleteShopCookieById(shopId);
ResultDto resultDto = new ResultDto();
resultDto.setStatus(result);
return resultDto;
}
......
......@@ -656,10 +656,16 @@ public class ShopServiceImpl implements ShopService {
}
@Override
public void deleteShopCookieById(String id) {
public Integer deleteShopCookieById(String id) {
Shop shop = shopRepository.findById(id).orElseThrow(() -> new ClientRequestException(BrowserErrorCode.SHOPNOTEXIST));
shop.setShopCookie("");
shopRepository.save(shop);
Shop save = shopRepository.save(shop);
Integer i = 1;
if (StringUtils.isEmpty(save.getShopCookie())) {
i = 0;
}
return i;
}
private String getShopId(String username, ShopResultDto shopResultDto) {
......
......@@ -37,5 +37,5 @@ public interface ShopService {
String queryShopCookieById(String id);
void deleteShopCookieById(String id);
Integer deleteShopCookieById(String id);
}
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