更新获取数据接口
This commit is contained in:
parent
414535d152
commit
34f3a620e0
|
@ -137,5 +137,19 @@ public class GlobalExceptionResolver{
|
|||
logger.error("运行时异常:", e);
|
||||
return AjaxResult.error("运行时异常:" + e.getMessage());
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
String[] str={"/api/goview/sys/*","/api/goview/project/*","/api/goview/project/**","/goview/api/goview/project/list"};
|
||||
System.out.println("3333");
|
||||
for (String nourl : str) {
|
||||
AntPathMatcher matcher = new AntPathMatcher();
|
||||
if(matcher.match(nourl,"/goview/api/goview/project/list")) {
|
||||
System.out.println("xxxxxxxxxx");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,9 +6,11 @@ import com.fc.v2.common.domain.ResultTable;
|
|||
import com.fc.v2.model.auto.GoviewProject;
|
||||
import com.fc.v2.model.auto.GoviewProjectData;
|
||||
import com.fc.v2.model.auto.GoviewProjectDataExample;
|
||||
import com.fc.v2.model.custom.GoviewProjectVo;
|
||||
import com.fc.v2.model.custom.Tablepar;
|
||||
import com.fc.v2.service.GoviewProjectDataService;
|
||||
import com.fc.v2.service.GoviewProjectService;
|
||||
import com.fc.v2.util.BeanUtils;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
@ -156,15 +158,20 @@ public class GoviewProjectAPi extends BaseController{
|
|||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取项目存储数据", notes = "获取项目存储数据")
|
||||
@GetMapping("/getData/{id}")
|
||||
@GetMapping("/getData")
|
||||
@ResponseBody
|
||||
public AjaxResult getData(@PathVariable("id") String id, ModelMap map)
|
||||
public AjaxResult getData(String projectId, ModelMap map)
|
||||
{
|
||||
GoviewProjectData blogText=goviewProjectDataService.selectByPrimaryKey(id);
|
||||
GoviewProject goviewProject= goviewProjectService.selectByPrimaryKey(projectId);
|
||||
|
||||
GoviewProjectData blogText=goviewProjectDataService.getProjectid(projectId);
|
||||
if(blogText!=null) {
|
||||
return AjaxResult.successData(200, blogText.getDataToStr()).put("msg","获取成功");
|
||||
GoviewProjectVo goviewProjectVo=new GoviewProjectVo();
|
||||
BeanUtils.copyBeanProp(goviewProjectVo, goviewProject);
|
||||
goviewProjectVo.setContent(blogText.getDataToStr());
|
||||
return AjaxResult.successData(200,goviewProjectVo).put("msg","获取成功");
|
||||
}
|
||||
return AjaxResult.error("获取失败");
|
||||
return AjaxResult.successData(200, null).put("msg","无数据");
|
||||
|
||||
}
|
||||
@ApiOperation(value = "保存项目数据", notes = "保存项目数据")
|
||||
|
|
|
@ -34,5 +34,7 @@ public interface GoviewProjectDataMapper {
|
|||
int updateByPrimaryKeySelective(GoviewProjectData record);
|
||||
|
||||
int updateByPrimaryKey(GoviewProjectData record);
|
||||
|
||||
List<GoviewProjectData> selectByExampleWithBLOBs(GoviewProjectDataExample example);
|
||||
|
||||
}
|
|
@ -0,0 +1,119 @@
|
|||
package com.fc.v2.model.custom;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
public class GoviewProjectVo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty(value = "项目状态[-1未发布,1发布]")
|
||||
private Integer state;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "创建人id")
|
||||
private String createUserId;
|
||||
|
||||
@ApiModelProperty(value = "删除状态[1删除,-1未删除]")
|
||||
private Integer isDelete;
|
||||
|
||||
@ApiModelProperty(value = "首页图片")
|
||||
private String indexImage;
|
||||
|
||||
@ApiModelProperty(value = "项目介绍")
|
||||
private String remarks;
|
||||
|
||||
private String content;
|
||||
|
||||
|
||||
@JsonProperty("id")
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
@JsonProperty("projectName")
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
@JsonProperty("state")
|
||||
public Integer getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(Integer state) {
|
||||
this.state = state;
|
||||
}
|
||||
@JsonProperty("createTime")
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
@JsonProperty("createUserId")
|
||||
public String getCreateUserId() {
|
||||
return createUserId;
|
||||
}
|
||||
|
||||
public void setCreateUserId(String createUserId) {
|
||||
this.createUserId = createUserId;
|
||||
}
|
||||
@JsonProperty("isDelete")
|
||||
public Integer getIsDelete() {
|
||||
return isDelete;
|
||||
}
|
||||
|
||||
public void setIsDelete(Integer isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
@JsonProperty("indexImage")
|
||||
public String getIndexImage() {
|
||||
return indexImage;
|
||||
}
|
||||
|
||||
public void setIndexImage(String indexImage) {
|
||||
this.indexImage = indexImage;
|
||||
}
|
||||
@JsonProperty("remarks")
|
||||
public String getRemarks() {
|
||||
return remarks;
|
||||
}
|
||||
|
||||
public void setRemarks(String remarks) {
|
||||
this.remarks = remarks;
|
||||
}
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String dateToStringConvert(Date date) {
|
||||
if(date!=null) {
|
||||
return DateUtil.format(date, "yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
|
@ -136,6 +136,26 @@ public class GoviewProjectDataService implements BaseService<GoviewProjectData,
|
|||
public int updateVisible(GoviewProjectData goviewProjectData) {
|
||||
return goviewProjectDataMapper.updateByPrimaryKeySelective(goviewProjectData);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据项目id查询项目数据
|
||||
* @Title: getProjectid
|
||||
* @author fuce
|
||||
* @date 2022年5月24日
|
||||
* @param @param projectId
|
||||
* @param @return 参数
|
||||
* @return GoviewProjectData 返回类型
|
||||
* @throws
|
||||
*/
|
||||
public GoviewProjectData getProjectid(String projectId) {
|
||||
GoviewProjectDataExample example=new GoviewProjectDataExample();
|
||||
example.createCriteria().andProjectIdEqualTo(projectId);
|
||||
List<GoviewProjectData> list= goviewProjectDataMapper.selectByExampleWithBLOBs(example);
|
||||
if(list!=null&&list.size()>0) {
|
||||
return list.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue