收藏夹功能

hunan
liuguijing 2 years ago
parent 53720f250f
commit 86b3317c26

@ -72,4 +72,7 @@ public class DyLevelController extends BaseController {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
}

@ -0,0 +1,54 @@
package com.shxy.xymanager_admin.controller;
import com.shxy.xymanager_common.annotation.Log;
import com.shxy.xymanager_common.base.BaseController;
import com.shxy.xymanager_common.base.ResponseReult;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.bean.ServiceStatus;
import com.shxy.xymanager_common.model.DyLineTreeListModel;
import com.shxy.xymanager_common.model.DyListModel;
import com.shxy.xymanager_common.model.TerminalPhotosModel;
import com.shxy.xymanager_common.util.xinyin.HeaderUtil;
import com.shxy.xymanager_common.vo.FavorVo;
import com.shxy.xymanager_common.vo.LastTowerVo;
import com.shxy.xymanager_service.service.DyLevelService;
import com.shxy.xymanager_service.service.FavorService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Api(value = "收藏夹接口", tags = "收藏夹接口描述")
@RestController
@Slf4j
public class FavorController extends BaseController {
@Autowired
FavorService favorService;
@ApiOperation(value = "新增收藏夹接口", notes = "新增收藏夹接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/addFavorList")
@Log(title = "新增收藏夹接口", type = "新增")
public ResponseReult<DyLineTreeListModel> addFavorList( @RequestBody FavorVo vo) {
ServiceBody<DyLineTreeListModel> serviceBody = favorService.addFavorList(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
}

@ -0,0 +1,32 @@
package com.shxy.xymanager_common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
@ApiModel(value = "收藏对象", description = "收藏对象描述")
public class FavorVo {
@NotEmpty(message = "不能传入空值")
@ApiModelProperty(value = "收藏对象数组", required = true, example = "A0001")
private List<FavorVo.TowerItem> list;
@Data
public static class TowerItem {
@ApiModelProperty(value = "装置编号", example = "123456")
@NotNull(message = "装置编号不能缺少")
private List<Integer> termId;
@ApiModelProperty(value = "是否收藏", example = "0--删除收藏 1--收藏")
private Integer type;
}
}

@ -0,0 +1,24 @@
package com.shxy.xymanager_service.impl;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.DyLineTreeListModel;
import com.shxy.xymanager_common.vo.FavorVo;
import com.shxy.xymanager_service.service.FavorService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
*
*/
@Service
@Slf4j
public class FavorServiceImpl implements FavorService {
@Override
public ServiceBody<DyLineTreeListModel> addFavorList(FavorVo vo) {
return null;
}
}

@ -5,6 +5,7 @@ import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.DyLineTreeListModel;
import com.shxy.xymanager_common.model.DyListModel;
import com.shxy.xymanager_common.model.TerminalPhotosModel;
import com.shxy.xymanager_common.vo.FavorVo;
import com.shxy.xymanager_common.vo.LastTowerVo;
import java.util.List;
@ -38,4 +39,7 @@ public interface DyLevelService {
* @return
*/
ServiceBody<TerminalPhotosModel> getLastTowerList(String requestIp, LastTowerVo vo);
}

@ -0,0 +1,27 @@
package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.DyLineTreeListModel;
import com.shxy.xymanager_common.model.DyListModel;
import com.shxy.xymanager_common.model.TerminalPhotosModel;
import com.shxy.xymanager_common.vo.FavorVo;
import com.shxy.xymanager_common.vo.LastTowerVo;
/**
*
*
* @author
*/
public interface FavorService {
/**
*
*
* @return
*/
ServiceBody<DyLineTreeListModel> addFavorList(FavorVo vo);
}
Loading…
Cancel
Save